Object KeyWord

Blitz3D Forums/Blitz3D Beginners Area/Object KeyWord

ziggy(Posted 2004) [#1]
Can anybody tell me how to use the keyword 'Object'.

I have seen some samples that uses 'Object' keyword to do things, but there's no documentation about this keyword.

I don't know what is it for.

can anybody help?


DJWoodgate(Posted 2004) [#2]
They should not be using it! All sorts of terrible things might happen if you do use it. Some things are best left unsaid (and undocumented) - It's use has been reserved for the Illuminati ;)


Ross C(Posted 2004) [#3]
You should visit blitzcoder.com for for th undocumented commsnds


Zethrax(Posted 2004) [#4]
Basically you use it in combination with the undocumented 'Handle' command, like this:-

Type MY_TYPE
Field whatever
End Type

Global a_custom_type.MY_TYPE = New MY_TYPE ; This could also be a local type pointer.

integer_variable% = Handle( a_custom_type.MY_TYPE )

a_custom_type.MY_TYPE = Object.MY_TYPE( integer_variable% )

'Handle' takes the type pointer value stored in the type pointer variable between the parenthesis and outputs it as an integer value.

'Object' takes the integer value between the parenthesis and outputs it as a type pointer value. The 'Object' keyword should be followed by a full stop and then the name of the type you want to output ('MY_TYPE', in the example above).


ziggy(Posted 2004) [#5]
Thanks!!!

This can be a great help to 'emulate' object oriented programming.

Why it isn't documented?

Arrrgggg!!


ziggy(Posted 2004) [#6]
Polimorphism, enabling the pass of any structure (not fixed-type) to a function,etc etc... great, I'm happy, thanks Axeman.