I have noticed that structures can automatically be passed by address if needed without the use of '@'. I'm guessing this here to make the structures easier to work with?
The example in the documentation specifies the @ and it was only by accident that I discovered that it worked the same without. I discovered it when I had a pointer to a root structure with a nested structure inside and I needed the address of the nested structure.
Code: Select all
@*myBar\Foo
Code: Select all
*myBar\Foo
Code: Select all
Structure Foo
Val.l
EndStructure
Procedure UpdateFoo(*foo.Foo)
*foo\Val = Random(500)
EndProcedure
Define myFoo.Foo
; The following 2 lines work the same?
;UpdateFoo(myFoo)
UpdateFoo(@myFoo)
Debug "myFoo\Val = " + myFoo\Val
Structure Bar
Foo.Foo
EndStructure
Define *myBar.Bar = AllocateStructure(Bar)
; The following 2 lines work the same?
UpdateFoo(*myBar\Foo)
;UpdateFoo(@*myBar\Foo)
Debug "*myBar\Foo\Val = " + *myBar\Foo\Val
FreeStructure(*myBar)