Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Formlib problem


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-28-2008, 09:02 AM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default Formlib problem

I replied twice to a post and so it probably got missed (Form size 264h).
I tried the Formlib answer but the desktop emulator for PPC jumped to full screen and thus top left corner. I put the object (dll) as for both desktop and PPC because it didn't seem to work with only PPC.
It gave the message object reference not set to an instance of an object.

Sub App_Start
Form1.show
flb.New1("Form1",B4PObject(1))
flb.FullScreen(True)
gw.New1("Form1",0,0,Form1.Width,form1.Height)
...
...
End sub

I realise I have omitted to replace some placeholder but don't understand B4PObject(1)

A second question if I may...
Sprite.value (I read the help but) something escapes me about value.
Thank you
Reply With Quote
  #2 (permalink)  
Old 04-28-2008, 09:43 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,897
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by enonod View Post
II tried the Formlib answer but the desktop emulator for PPC jumped to full screen and thus top left corner. I put the object (dll) as for both desktop and PPC because it didn't seem to work with only PPC.
FullScreen only works properly on the device. The compiler needs the dll on both desktop and device. This is why some libraries that only work on the device have a dummy desktop version.

Quote:
I realise I have omitted to replace some placeholder but don't understand B4PObject(1)
B4pObject(1) is a reference to the form that the FormLib is to be associated with. See below.

Quote:
Sprite.value (I read the help but) something escapes me about value.
Thank you
Sprite.Value is a reference to a Sprite object. You can't use references within B4PPC but you can pass them to and from libraries that understand them. A reference identifies an particular object, in this case a particular sprite. For example GameWindow.Sprite1 holds a reference to one of the sprites involved in a collision. You can assign this reference to a Sprite object and so manipulate that particular sprite. This avoids having to write code for each and every individual Sprite that you create.
Reply With Quote
  #3 (permalink)  
Old 04-28-2008, 11:52 AM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default

Thank you for that explanation. I realise that full screen is only meant for the PPC but it was the PPC emulator on the desktop screen that was going full screen instead of the toolbars disappearing.
I seem to have problems with example code because they tend to use references that are in fact able to be varied by the user but the example seems to use the actual key word, which then makes it ambiguous to me.
i.e. fred could be a sprite, hence fred.value makes sense to me but...
Sprite.value does not because it is now uncertain whether 'Sprite' is a generic term and could be any name or whether 'Sprite' must actually be used as such.
This is because it appears that Sprite1 must be used as Sprite1 because it is a system reference retained as one of the colliding sprites.
I don't think that is very clear but maybe you are smart enough to untangle what I am trying to say.

The example sprite program uses Sprite.New1 & Spr1.New1 & Spr2.New1 'These sprites will be used in the collision events.
I can't make out whether 'Sprite.New1' MUST be used or could it have been fred.New1???
Sorry to be so thick
i.e.
Reply With Quote
  #4 (permalink)  
Old 04-28-2008, 12:13 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 487
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Fred, Burt, Harry or whatever you want can be used but you must make sure to create an object with the same name. This can be done either using code or via the Tools>Add Object menu.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 04-28-2008, 12:16 PM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default

My thanks.
Reply With Quote
  #6 (permalink)  
Old 04-28-2008, 12:17 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,897
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

A Basic4PPC library contains object types, such as Sprite, which from which you create named instances of objects of that type.

"Sprite", or any other type name from a library, is never used as a generic name (with one exception - as a parameter to AddObject). Once an object is created, either at design time, or at runtime by AddObject, it must be instantiated (initialised) by calling one of its' NewX methods. There is nothing to stop you creating a Sprite object named "Sprite" but it could be confusing if you do. The examples use "Sprite" as the name to show the type of object, in use you replace this with your own name. This is a common convention in Basic4PPC documentation.

The Sprite1 and Sprite2 properties of a GameWindow are not Sprite objects but are properties returning a reference to a Sprite object.

Quote:
I can't make out whether 'Sprite.New1' MUST be used or could it have been fred.New1???
You can call it whatever you want. The example sprite program uses Sprite.New1 & Spr1.New1 & Spr2.New1 to create "empty" Sprite objects . Their Value property will be empty until another Sprite reference is assigned to them. This means, as I said before, that you can code once using those objects then manipulate any Sprite whose reference is assigned to them.

Last edited by agraham : 04-28-2008 at 01:29 PM.
Reply With Quote
  #7 (permalink)  
Old 04-28-2008, 01:12 PM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default

That is very clear and helpful, thank you very much.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
FormLib and modules Cableguy Questions & Help Needed 3 10-23-2008 10:26 PM
Always the right justify problem, with Formlib the textbox is so curious. dan kabestan Questions & Help Needed 4 01-18-2008 06:50 PM
where's formlib? Cableguy Questions & Help Needed 2 09-23-2007 05:09 PM
add to formlib Cableguy Basic4ppc Wishlist 0 05-14-2007 08:25 PM
Formlib TextAlignment Jendy Questions & Help Needed 1 05-08-2007 06:17 AM


All times are GMT. The time now is 03:07 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0