HELP wrote:
Addresses of variables
To find the address of a variable in your code, you use the at symbol (@). A common reason for using this is when you want to pass a structured type variable to a procedure. You must pass a pointer to this variable as you cannot pass structured variables directly.
Example
Code: Select all
Structure astruct a.w b.l c.w EndStructure Procedure SetB(*myptr.astruct) *myptr\b = 69 EndProcedure Define.astruct myvar SetB(@myvar) Debug myvar\b
In reality, if you use
SetB(myvar)
the address of the structure is passed anyway.
At most the use of "@" is a good practice to make your intentions clear, and maybe this is what should be written here.
This page in the help seems to express this as mandatory when it isn't.
Or the compiler is changed (I can hear the screams!) to adhere to the help or the help is more sincere and tell this is not really needed but a suggested practice.
"@" should have been mandatory from the start for other reasons too, I think. Anyway at least mention somewhere the name of a structure it's equivalent to its address.
edit: corrected horrific typo