Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Script args

From: jonkelly::fastmail::fm at: 29-Jul-2007 11:12

Hi, I can't seem to get args working?? I'm running View (Windows) Well, I thought before I posted I should check google and found the FAQ entry. I had mis-read the help text and was using do %t6.r /args "test1 "test2" but there was no error, which seems strange. So what is /args in that expression? Is it a work, but words can't contain the / character. Hmmm what does this mean ...
>> /args: "testing"
== "testing"
>> /args
== /args
>> print /args
>> print mold /args
>> help /args
/args is a refinement
Anyway, there seems to be some discrepancy anyway. When I run a script via "rebol t6.r test1 test2", I can see the args in three places: system/script/parent/args => "test1 test2" system/script/args => "test1 test2" system/options/args => [ "test1" "test2" ] OK, that's good, but what is the script's parent? (the interpeter?) So, now I want to run this script from another script (or the console). do/args %t6.r "test1 test2" the only args that is set is system/script/args and that hardly seems simple. But more; when I do xx: load %t6.r do/args xx "test1 test2" NONE of the args is set. t6.r is ... ------------------ REBOL [ Title: "Testing running scripts" Date: 29-Jul-2007 File: %t7.r Author: "Jonathan Kelly" Version: 0.0.1 ] print [ "A" type? system/script/args mold system/script/args ] print [ "B" type? system/options/args mold system/options/args ] print "T6 system/script" print mold system/script print "T6 system/options" print mold system/options ask "finished"