Passing parameters into a script

Herb Philbrick herb.philbrick at MITTALSTEEL.COM
Mon May 1 14:13:18 EDT 2006


Hello all,

I am unable to use parameters passed into a script and would very much
appreciate some guidance or an example.

I see from the .pdf doc that there are two ways of invoking a script.
  - using EXEC allows for 10 arguments referred to as &0-&9 in the script
(p49)
  - using RUN does not allow for &0-&9 and I'm not sure how the arguments
are received. (p52)

Apparently, EXEC does not accommodate the full scripting language, so RUN is
my focus.

The sample script meteogram_avn.gs has  * function main(args) *  as its
first executable line.  "args" is parsed to find individual arguments.
There is no  * return *  statement matching the  * function main(args) *
statement.

I have tried a simple script along the lines of:
        function main(args)
        arg0=subwrd(args,1)
        arg1=subwrd(args,2)
        arg2=subwrd(args,3)
        say 'arg0='arg0 '  arg1='arg1 '  arg2='arg2

The script bombs on the first line.  (PCGrADS 1.8)

        I have tried searching the archives but, I haven't been able to gain
access, even after registering in numerous manners.
        A tip on accessing the archives would be greatly appreciated, too.


Thank you,

Herb Philbrick
     Burns Harbor Plate
     voice 219-787-3321
     fax    219-787-2690
     herb.philbrick at mittalsteel.com



More information about the gradsusr mailing list