lang • type • pointer

Pointer

DIM Var AS Pointer

This native datatype represents a pointer, i.e. an address in memory.

In Gambas 3, Pointer is a true datatype, and you cannot replace them with integer numbers.

Example

This example puts the (hex) representation of a Single number into the variable "f". See Single Precision

Dim i As Integer ' 4 bytes
Dim f As Single  ' 4 bytes
Dim hH As Pointer ' Needs to be allocated

i = &h3EAAAAAA& 'IEEE representation of 1/3

hH = Alloc(4)
Write #hH, i
Read #hH, f
Free(hH)

See also