No pointers to objects!?

BlitzMax Forums/BlitzMax Beginners Area/No pointers to objects!?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

They are -- two New statements, two objects:
SuperStrict
Graphics 800,600

Type TThing
	Field nextTThing:TThing
	Field prevTTHing:TThing
	Field value:Int
End Type

Local thingA:TThing = New TTHing
Local thingB:TThing = New TThing

thingA.nextTThing = thingB
thingB.value = 123
DrawText thingA.nextTThing.value,10,10
thingA.nextTThing.value = 321
DrawText thingB.value,10,30

Flip
WaitKey

Given what you can do with pretty much any order of language these days, I'd say that having to explicitly denote references is what makes C/C++ irrevocably mid-level whereas not having to is what defines BMax as high level (and readable). Be aware, though, that the circular references will befuddle the garbage collector so null/update the appropriate fields when you attempt to release one of those objects.