When you call a routine that returns a result, you must enclose the parameters in parentheses:
text = VRGet( "EF_1", "Value" ) Always assign the value of a function to a variable, or use the CALL statement as described below. Otherwise REXX will pass the return
value to the default host environment, leading to strange and possibly damaging behaviour on some systems.For example, if VRGet returns a numeric return code, then: VRGet( "EF_1", "Value" ) and
call VRGet "EF_1", "Value" will do the same thing -- IN YOUR PROGRAM. However, the numeric return code will be passed to the host environment for execution. In
some editors, for example, a command consisting of a number will move the current line n lines -- leading to obscure and possibly disastrous consequences.Furthermore, even if the response (and thus the host command) is null, and
has no effect as a host command (not always the case for a null command!), the attempted host execution costs some performance. If you are calling a routine that does not return a value, or you wish to ignore the return value,
you should use the CALL instruction: call VRSet "EF_1", "BackColor", "Blue" Note that there
is no comma between the name of the routine and the first parameter. Note also that parentheses are not used when using the CALL instruction. If the called routine does return a value in such cases, it is placed in special
REXX variable "RESULT". |