@Raziel
FYI, it's not limited to ReadLn. It's the way REXX works (not just AREXX). Here is another example:
/**/
ADDRESS COMMAND /* Sets outgoing AREXX port to COMMAND */
'ECHO "test 1 2 3"' /* Sent to the COMMAND port */
Command='ECHO "test 4 5 6"'
Command /* Alternative method */
ProgList="date requestfile shownetstatus"
DO i=1 TO 3
SubWord(ProgList,i,1) /* Sends result to the COMMAND port */
End
Exit
Think about what you'd expect if you used:
ADDRESS COMMAND ReadLn(File)
Assuming no AREXX port had been manually set yet, that will temporarily switch to the COMMAND port, run the result, and switch back to the REXX port. In the script example above, COMMAND was already set as the AREXX port ahead of time.
When you use ReadLn() without anything proceeding it, by default it sends the result to the REXX port. That's what was happening in your script.
I remember when writing something for Regina REXX, I couldn't use "Call Function()" when I didn't need to store the result, so I just used "Null=Function()" instead, because Function() on its own would cause havoc.
Wrap your head around this one!
/**/
Word="'hello'"
Temp='"SAY 'Word'"'
Temp /* Prints hello */
Exit
The Word variable is set to 'hello' (single quotes included)
Temp is set to "SAY 'hello'" (both types of quotes included)
Then the contents of Temp is sent to the REXX port. Those contents direct it to say the word hello.
Edit: Removed stuff that may have caused confusion.
Edited by MickJT on 2018/10/4 1:57:24
Edited by MickJT on 2018/10/4 2:01:42
Edited by MickJT on 2018/10/4 2:02:32
Edited by MickJT on 2018/10/4 2:06:34
Edited by MickJT on 2018/10/4 2:10:39