Object(Obj.Object) not working

BlitzPlus Forums/BlitzPlus Programming/Object(Obj.Object) not working

William Drescher(Posted 2007) [#1]
When I use the function "Return Object(Obj.Object)", it gives me the error "Expectin Identifier." Can anyone tell me what's wrong?

b32(Posted 2007) [#2]
Yes, the syntax is wrong. You should use it like this:
Return Object.Object(Obj)
Type Obj
	Field x
End Type

o.Obj = New Obj
o\x = 127
h = Handle(o)
Print "handle = " + h
p.Obj = Object.Obj(h)

Print p\x


Moore(Posted 2007) [#3]
Huh? What does Object do? There's no documentation on it. Does it just return the pointer to the data structure?

b32(Posted 2007) [#4]
Yes, it is an undocumented command.
Handle converts an object (a Type) into an integer number.
Object converts this Handle back into an object.

William Drescher(Posted 2007) [#5]
Thanks b32, this command is very essential to my GUI, so I appreciate the help.