REFERENCE Type

Previous  Next

 

DIM var-name AS REFERENCE

 


 

The REFERENCE type is the same as a pointer in other programming languages. The REF function will return the address to a variable and this can be stored in a REFERENCE variable.  A REFed variable can be "UNREFed" by using UNREF.

 

Note that once a REFERENCE has been referenced it will be used as the referenced variable and must be unreferenced first before it can be referenced to another variable or array again.

 

A reference can be used where a value to a function needs to be passed as BYREF

 

Examples:

 

DIM ptr AS REFERENCE

DIM n AS INTEGER

 

ptr = REF( n )