1.18 pointers

BlitzMax Forums/BlitzMax Beginners Area/1.18 pointers

It is a very intuitive way:

Objects can NEVER be stored by Value in BlitzMax.
Everytime you do something like a:TPixmap or the like, this is already a reference (managed pointer) to a TPixmap object.

Thus the = will set the reference to the same object (and do some internal stuff needed for the garbage collector).

If you want to do a b = a with a copy of the actual object a, you will have to write your own clone method to do so, that returns a copy.

Pointers are unmanaged reference and because of that reason not adviceable within BM (you will have to manually memfree ANYTHING assigned to Byte Ptr from extern or Cstring!) and there is no real reason to do so (beside a few exceptions where possible work arounds exist).

BM is not a managed environment for some funny reason ;-) It makes many many things easier (like assigning a wrong type will result in compile errors as the interfaces do not match and the like)