Syntax
address = varptr( var )
address = @var
Description
varptr(var) returns the memory address where the first byte of the variable var is located. You can use this value as a "pointer" to var. If var is a local variable inside a local function, the value returned by varptr(var) may be different each time you execute the function, and is not valid after the function exits. The syntax @var is just a shorthand version of varptr(var).
Note
Because the "@" symbol has a special meaning when it appears after the print keyword, you cannot use the @var syntax as the first item in a list of print items.
print @myVar // This does not work ("@" is misinterpreted)
print (@myVar) // This works
print varptr(myVar) // So does this
See also
@fn; dim; print; peek; poke