|
Pages: [1]
|
 |
|
Author
|
Topic: Passing arguments to scripts (Read 477 times)
|
|
Stoop
|
Using one fo the examples to pass arguments to a script from the command line. So for example:
REBOL [ Title: "Command-Line Argument Example" ]
print mold system/options/args print mold system/script/args
Called the file getarg.r. However when I run it with arguments I get this:
>> do %getarg.r 54321 Launch! Script: "Command-Line Argument Example" (none) none none ** Script Error: Launch! has no value ** Near: Launch!
What is the problem here?
|
|
|
|
|
Logged
|
|
|
|
|
Gabriele
|
do/args %getarg.r [54321 Launch!]
|
|
|
|
|
Logged
|
|
|
|
|
Stoop
|
Thanks for that, that gets the argument in, but now I am having trouble doing a "find" with it. This used to work, did arguments change in the newer versions of REBOL?
Anyway I am trying to get a name into the script and then do a find against the lines of a log file to track a user when he has problems.
So I can get the user name into the script with :
do/args %usertrk.r [John Smith]
And I assign that to a variable in my script as follows:
finduser: system/script/args
Now the line in my script that does work is if I code the name directly as follows:
if found? find line "John Smith"
I get a nice output file with all occurences of the user.
However if instead I subsitute this code:
if found? find line finduser
Then my output file is empty.
How do I need to modify the argument variable so it can be used as a string search?
|
|
|
|
« Last Edit: February 20, 2006, 08:08:43 PM by Stoop »
|
Logged
|
|
|
|
|
Gabriele
|
If you need a string, pass a string.  do/args %usertrk.r "John Smith"
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |