![]() ![]() ![]() ![]() | Table Of Contents | Index |
When used with a variable, Loc returns the location of a variable rather than it's contents. Thus B = Loc A sets B to point to A.
Example:The rule is that all indirect location references are resolved in the process of evaluating an expression.
Var A B B = Loc A B = 9 Writeln A ;returns 9Example:
Var ATestLoc (Loc A) Writeln A ;returns 9
Procedure TestLoc (B) B = 9 EndProc
Example:As you would expect, qualifiers and multidimensional array addressing works with indirect addressing.
Var A B C D B = Loc A C = Loc B D = Loc C D = 9 Writeln A ; Returns 9
Example:
var A B C D EA[3] = 12 C = 3 B = Loc C
D = Loc E D[7] = 8
TestLoc (Loc A[B]) Writeln A[B,9,E[7]]
Procedure TestLoc (X) Writeln X X[9,D[7]] = 6 Writeln X[9,E[7]] EndProc
See Also: | Run | Actual |
---|
Category: | Variable |
---|
![]() ![]() ![]() ![]() | Table Of Contents | Index |
|