Object KeyWord
Blitz3D Forums/Blitz3D Beginners Area/Object KeyWord
| ||
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? |
| ||
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 ;) |
| ||
You should visit blitzcoder.com for for th undocumented commsnds |
| ||
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). |
| ||
Thanks!!! This can be a great help to 'emulate' object oriented programming. Why it isn't documented? Arrrgggg!! |
| ||
Polimorphism, enabling the pass of any structure (not fixed-type) to a function,etc etc... great, I'm happy, thanks Axeman. |