Pointer to variable
Posted: Sun Oct 30, 2016 11:32 am
Having problems with the values modified in variables that are passed as pointers to functions :
For some reason one is always 9876, even though a pointer to one is passed to be modified.
The output is thus :
Before : 9876
Changed to : 1234
After : 9876
Code: Select all
EnableExplicit
Declare.b callback(*one)
Define one
one=9876
Debug "Before : "+Str(one)
callback(@one)
Debug "After : "+Str(one)
Procedure.b callback(*one)
*one=1234
Debug "Changed to : "+Str(*one)
EndProcedure
The output is thus :
Before : 9876
Changed to : 1234
After : 9876