You can use parenthesis to control the way in which pointers are dereferenced in 4D or, more importantly, the order in which they are dereferenced.
The example in this Tech Tip illustrates this with the following:
-An array of pointers named ptr1
-An array of pointers named ptr2
-A Text array named $sample
Each element in ptr2 points to an element in ptr1. Each element in ptr1 points to an element in $sample. In order to dereference an element in ptr2 and, eventually, reach one of the elements in $sample the following syntax is used:
( (arrayptr{index}) -> )->
Used in an example:
ARRAY POINTER(ptr1;5) ARRAY POINTER(ptr2;5) ARRAY TEXT($sample;5) For ($i;1;5) |
The Alert display will be the value of each element in the $sample Text array.
Related Sources:
Dereferencing pointer to an array vs. array of pointer