Home   Archive   Permalink



Command-line arguments and the launch function

When you run a REBOL script by executing the REBOL interpreter from a command line, you can provide run-time arguments to the script. It appears that if you run a REBOL script by using the 'launch' function from another script, you can NOT provide command-line arguments to the launched script. I can accept that, but I thought I would ask if there might be a way to provide command-line arguments to script that has been executed with the 'launch' function and I just might not know what it is; perhaps some undocumented feature that someone has discovered.
    
Thank you. Happy non-denomination and politically-correct holiday season.

posted by:   Steven White       27-Dec-2016/12:29:09-8:00



You can use 'call for that:
    
call/show rejoin [{chmod 755 } (to-local-file file)]

posted by:   Nick       28-Dec-2016/19:24:30-8:00



Among others, this was one of the examples at http://re-bol.com/examples.txt
    
call/show "notepad.exe c:\config.sys"

posted by:   Nick       28-Dec-2016/22:29:29-8:00



Thank you. I did think of "call" and have used it successfully, but the reason I wanted to use "launch" was for OS-independence. What I finally did was write into a text file the data I wanted to pass, and then had the launched program read that file. It doesn't sit well with me for some reason, maybe because it leaves "stuff" lying around, although I suppose I could just have the launched program delete the file after reading it. Didn't think of that until just now...
    
It also crossed my mind to dig into your examples again and have the programs communicate over a tcp port. That could be fun, but right now I just have to get some things done so we will put off experimenting until later.

posted by:   Steven White       30-Dec-2016/11:24:40-8:00