question

BlitzMax Forums/BlitzMax Beginners Area/question

Cruis.In(Posted 2006) [#1]
what is the difference between this

object:Tobject = new Tobject

and

object = new Tobject

is there any difference? if so what?


H&K(Posted 2006) [#2]
the second one will fail in strict mode


tonyg(Posted 2006) [#3]
They'll both fail as 'Object' is a reserved keyword.
Anyway, the first creates a TObject and saves the pointer to the instance in the variable.
The second creates a new TObject and returns an integer. This integer is used as a x-ref on an internal list holding a link to the TObject. This is the old Blitzbasic method and is, probably, included for transition between BB and Bmax.
Integer handles are not GC managed and, I suspect, are slower.


Cruis.In(Posted 2006) [#4]
thanks