L
Laura Stern
Guest
Yes, the parameter is by reference - different from the assignment, which makes a copy. Try this code: DEFINE VAR mm AS MEMPTR. SET-SIZE(mm) = 10. PUT-STRING(mm, 1) = "ABC". RUN foo(mm). MESSAGE "In caller" SKIP GET-STRING(mm, 1) SKIP GET-POINTER-VALUE(mm) VIEW-AS ALERT-BOX. PROCEDURE foo: DEFINE INPUT PARAMETER mm2 AS MEMPTR. PUT-STRING(mm2, 4) = "XXX". MESSAGE "Inside foo" SKIP GET-STRING(mm2, 1) SKIP GET-POINTER-VALUE(mm) VIEW-AS ALERT-BOX. END.
Continue reading...
Continue reading...