Charles, i have tried everything and no solution has been found.
Even if i access the data directly at the address, the string remains the same after exiting the module.
it looks like the CHAR variable is being re-created rather than re-assigned, creating a completely different
address for the variable data.
Can you show me how to do it?
This is my non-working code:
FUNCTION BYREFPAR(byref char s) AS INT
MSGBOX str(@s) & chr(10, 13) & s, , "INSIDE BEFORE"
s = "* changed in module *"
MSGBOX str(@s) & chr(10, 13) & s, , "INSIDE AFTER"
END FUNCTION
FUNCTION PBMAIN2() AS INT
CHAR s[21]
s = "*ORIGINAL STR*" & CHR(0)
MSGBOX str(@s) & chr(10, 13) & s, , "OUTSIDE BEFORE"
BYREFPAR(s)
MSGBOX str(@s) & chr(10, 13) & s, , "OUTSIDE AFTER"
END FUNCTION
PBMAIN2() ' invoke entry point