[Thread Prev][Thread Next][Index]

Re: Yet more on variable # of args to go script...

On Thu, 13 Jun 2002, Gary Strand wrote:
> Arguments 1-4 will always be there; what I don't get is how I can
> check for the existence of args 5+ so I can use them in the script.

Hi Gary,

You're on the right track... just a few modifications.  Try the following:

! mytest.jnl
\can mode verify
IF  $3"False|*>True" THEN
  say $1.$2.$3
ELIF $2"False|*>True" THEN
   say $1.$2 
ELIF $1"False|*>True" THEN
   say $1
set mode/last verify

Here's what happens when you run this script:

yes? go mytest
yes? go mytest hello
yes? go mytest hello there
yes? go mytest hello there Gary

Hope that helps,


Andrew Wittenberg          Program in Atmospheric and Oceanic Sciences
andyw@splash.princeton.edu                        Princeton University

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement