Passing parameters into a script

Eric Salathé salathe at WASHINGTON.EDU
Wed May 3 17:53:59 EDT 2006


Herb-

Your script works as expected in version 1.9b4 on linux. So this may be
a PC GrADs issue...

-Eric


On May 1, 2006, at 11:13 AM, Herb Philbrick wrote:

> 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
>
>
--
Eric Salathé
Climate Impacts Group             <salathe at washington.edu>
University of Washington
<http://www.atmos.washington.edu/~salathe>



More information about the gradsusr mailing list