Addr
Belongs to : FunctionDescription
The Addr function returns the address of a Variable, Function or Procedure.
It is similar to the @ operator, but is not constrained by the $TypedAddress compiler directive – it always returns an untyped Pointer.
You can cast this to a typed pointer, as in the example.
Example code
1 2 3 4 5 6 7 8 9 10 11 12 13 |
var myString : string; ptrString : PString; begin // Set up variable values myString := 'Hello there'; ptrString := Addr(myString); ShowMessage('myString : '+ptrString^); end; { myString : Hello there } |