Syntax
Writes a value into the variable, field, array cell, list element or map entry that a handle points at.
SetRef(<handle>, <value>)Parts
| <handle> | A handle made with @target. |
|---|---|
| <value> | The value to write. It is converted to the target's type, as any write to that target would be. |
Returns
The value actually stored, after conversion: SetRef(h, 300) on an AS uint8 target returns 44.
Good to know
- The target's type wins: a handle to an
AS integervariable drops decimals, one to anAS uint8variable wraps at 256. - On a released handle, the program stops with "BASIC reference handle has been released". On a
HANDLEvariable never assigned, it stops with "BASIC value is not a reference handle". - Unlike a
REFparameter, a handle can be kept in a variable, a record or a list and used later.