Code: Select all
Structure sum
sum.i
EndStructure
Procedure add(a,b)
Static foo.sum
foo\sum = a+b
ProcedureReturn @foo
EndProcedure
*aaa.sum = add(1,2)
Debug *aaa\sum
*bbb.sum = add(3,4)
Debug *bbb\sum
Debug *aaa\sum
However, when using Protected where the variable would be reinitialized every time the debug output shows which seems to be a pointer and also 3 times the same pointer-address.
Does anyone have an idea how I can achieve this?