B4pobject

edsphu

Member
Licensed User
Hi,
Can someone explain to me about B4POBJECT and how it is used? I checked the syntax from HELP but it explains very briefly. Are there better explanation anywhere?

Thanks!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4PObject is used to pass internal data to external libraries which at its time was not available otherwise.
For example B4PObject(2) passes a data structure with all the controls.
B4PObject(6) passes the last exception that was caught. This is how agraham's Exception library http://www.b4x.com/forum/additional-libraries/2305-exceptions-handling-library.html#post12486 finds the last exception.

As of version 6.80 most of these fields can be passed in a different way without requiring the user to write anything.
 

edsphu

Member
Licensed User
Erel,
Thanks for quick reply. I guess I am a pretty newbie to Basic4PPC so I still can not understand your explanation.

This is what I got from the HELP:
B4PObject exposes an interface of Basic4ppc to external libraries.
Syntax: B4PObject (Number)

Example:

drawer.New2 (ImageList1.Item(0), B4PObject(5))

But where do I find out about the NUMBER and its functionalities.....

Thanks again for quick reply and good product!
 

klaus

Expert
Licensed User
Longtime User
As a user you don't need to care about B4PObject in an Object declaration. B4PObject(x) is needed to declare the object that it can interface between B4PPC and external libraries. The number depends on the type of object and the kind of data to transfer.
In your example: drawer.New2 (ImageList1.Item(0), B4PObject(5))
is used to declare the Drawer object.
Declarations with another number like:
drawer.New2 (ImageList1.Item(0), B4PObject(4)) or
drawer.New2 (ImageList1.Item(0), B4PObject(3)) don't exist.

If you intend to use ImageLib, I would advise you to use the ImageLibEx instead of. ImageLibEx is not an extension to ImageLib but contains all ImageLib functions, but can do much more.

Best regards.
 
Top