Skip to content

Pointers

Chris A edited this page Aug 9, 2026 · 3 revisions

AddressOf

address% = AddressOf ( var )

Returns the memory address of var as an Int. Works on Locals, Globals, params, array elements (AddressOf arr(i)), and type fields (AddressOf obj\field). Doesn't work on a custom type variable itself, use Handle for that.

PtrPeekInt / PtrPokeInt / PtrPeekFloat / PtrPokeFloat

value% = PtrPeekInt ( address )
PtrPokeInt address, value%
value# = PtrPeekFloat ( address )
PtrPokeFloat address, value#

Reads or writes the value at a raw memory address, such as one returned by AddressOf.

  • Pointers to Locals/params die when the function returns.
  • Pointers into an array can be invalidated by Dim'ing that array again.
  • Pointers to type fields die when the object is Deleted.

Clone this wiki locally