Syntax
Reads the variable, field, array cell, list element or map entry that a handle points at.
GetRef(<handle>)Parts
| <handle> | A handle made with @target, usually kept in an AS HANDLE variable. |
|---|
Returns
The current value of the target. A record comes back as the record itself; assigning it to a variable copies it.
Good to know
- On a released handle, the program stops with "BASIC reference handle has been released". On a
HANDLEvariable never assigned, or on a value that is not a handle, it stops with "BASIC value is not a reference handle". Test withIsRef()first. - A handle made with
@m()or@l()follows the cursor:GetRefreads whatever entry or element is current at that moment, not the one current when the handle was made. - A handle to a map entry,
@m("key"), survives DeleteMapElement():GetRefcreates the entry again with the default value.