GLBasic User Manual

Main sections

ALIAS

ALIAS name#%$ AS some.thing[123].value[78]



This command internally generates a pointer to the variable to the right of "AS". You can quite quickly access variables, lessen your typing work and avoid the calculation of [123] and [78] for each variable access.

<B>ATTENTION:</B>
If the size of any involved arrays gets changed (using commands like DIMPUSH, DIMDEL and DELETE), <B>this pointer will almost certainly be broken and your program will crash</B> ...if you're lucky.

TYPE Tfoo
f
ENDTYPE

TYPE Tbar
fb[] AS Tfoo
ENDTYPE
LOCAL bar AS Tbar

ALIAS myfoo AS bar.fb[0].f
moo(myfoo)

FUNCTION moo: BYREF bb

ENDFUNCTION

See also...