The example was constructed to show the ambiguity that would arise without $. These two are identical:PeterH wrote:Sorry: I don't understand this code at all. Maybe there's an error in it?admin wrote:I would not recommend it but currently this works:$getInfo(file) is an unquoted string where $getInfo is interpolated. Without the $ it would be ambiguous with a function getInfo().Code: Select all
::set $getInfo, "file"; msg "This is ". $getInfo(file);
($getInfo is setted to "file"??)
What I wanted to say: a name followed by "(" is (from my point of view, or from REXX...?) a function, not a variable. So if you recognize a name as a function name, you should not interpret it as variable name.
With this, your 2nd statement would expand to call the function $getInfo with parm file - where file is an (undefined?) variable?
Code: Select all
::set $getInfo, "file"; msg "This is ". $getInfo(file);
::set $getInfo, "file"; msg "This is ". $getInfo . "(file)";
RPG? You mean PHP? $a = $b; is not here yet, but I will add that soon. With the new syntax is easy to parse.PeterH wrote:Just another question: does RPG require the set-command to set a variable? So there's no construct:
$a = $b;
Or is it just not been defined by you?
XYplorer Beta Club