WHILE/ENDWHILE Problems

Mark Sponsler msponsler at COMCAST.NET
Fri Jan 8 13:58:06 EST 2010



Another option is to make sure to put a carriage return after your Endwhile statement. 

Grads needs to see an end-of-line marker or it will not execute the command on the last line.   



This holds true for any command at the end of the script, add an extra <CR>. 

Thanks, 
Mark 

----- Original Message ----- 
From: "Ron Goodson [Edm]" <Ron.Goodson at EC.GC.CA> 
To: GRADSUSR at LIST.CINECA.IT 
Sent: Friday, January 8, 2010 10:17:36 AM GMT -08:00 US/Canada Pacific 
Subject: Re: WHILE/ENDWHILE Problems 

I'd be more inclined to search for spaces or unprintable characters at 
the end of the endwhile line... just in case. 

ron 




-----Original Message----- 
From: GRADSUSR at LIST.CINECA.IT [mailto:GRADSUSR at LIST.CINECA.IT] On Behalf 
Of James T. Potemra 
Sent: January 8, 2010 11:07 AM 
To: GRADSUSR at LIST.CINECA.IT 
Subject: Re: WHILE/ENDWHILE Problems 

Hi Jason: 

This looks okay to me in terms of the while loop, however line 5 doesn't 
really do anything.  In fact. that line should give an error like "name 
to long missing =" (the syntax is define newvar=something).  Is this 
really the entire script? 

Jim 

Jason Snyder wrote: 
> To Whom it May Concern, 
>   
> I tried posting onto onto the GRADS users group website and cannot 
> access it so I decided to post my question here. 
>   
> I am trying to do the while loop with the script below: 
>   
> 'sdfopen uwndavg2001.nc <http://uwndavg2001.nc>' 
> count=1 
> while (count < 10) 
>     'set t 'count 
>     'define uwndavg' 
> count = count + 1 
> endwhile 
>   
> however, I keep getting this error when running this script: 
>   
> unable to locate ENDWHILE statement for the WHILE statement at line 3. 

> I have endwhile statement so I am not sure what is going on with this 
> script.  Can you help me with it? 
>   
> Thanks, 
>   
> Jason 
>   
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100108/eb29c04a/attachment.html 


More information about the gradsusr mailing list