I'm tick at times - ptr confusion

BlitzMax Forums/BlitzMax Beginners Area/I'm tick at times - ptr confusion

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Welcome to the forums :)

Well, types are always passed by reference - a type variable is a pointer. You don't have to do anything special to make the field in another type point to a type. For example:

Type PointsAtAnother
 Field pointer:TheObject
End Type

Type TheObject
 Field Dat$
End Type

Local A:PointsAtAnother=New PointsAtAnother, B:TheObject=New TheObject

A.pointer=B
B.dat="hi!"
Print A.pointer.dat
B.dat="See, it works!"
Print A.pointer.dat