i have a script that calls a different procedure up then this procedure will retun to the main procedure. how do you pass a variable from the procedure back to the main procedure?
thanks.
proc mangle
param string name
usermsg "passed value = %s" name
name = "bar"
endproc
For any values that are passed to the procedure (regardless of if they are passed by value or reference), you need to have a corresponding param declaration at the beginning of the procedure.
The & in the argument for the procedure call means that sName is being passed by reference and not by value, which means that the procedure can modify this value and it will be reflected in the calling procedure. If you ran the same script without the ampersand, the value of sName would not be modified by the procedure call.
For more information, check out the ASPECT help discussion of the call and param commands, as well as the Parameter Variables link near the bottom of the param discussion.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.