Table Of Contents | Index |
In MarxMenu, variables can point to other variables allowing parameters to be passed to procedures by reference as well as by value. A pointer variable stores the location of another variable. Any time a pointer variable is accessed, MarxMenu acts upon the variable that the pointer variable is pointing to. Pointer variables are set using the Loc (location) command.
Example:MarxMenu supports complex location pointers and pointers to other pointers. MarxMenu will resolve all references until real data is found.
Var A B C A = Loc B
Example:Pointers can also be passed as parameters to procedures. Thus if A is an array of strings we can sort A as follows:
B = Loc A C = Loc B C[5] = 20 Writeln A[5] ;returns 20
Procedure SortTest (TestArray) SortArray(TestArray) EndProcSortTest (Loc A) ;sorts array A
Table Of Contents | Index |
|