Antoy,<br>In your bold line (543), the variable "sig_waves" appears to have been obtained using the subwrd statement from a line of text output from another command. Thus, the variable sig_waves is being stored as a string (character/text) and not a number. To get around this, simply put sig_waves in single quotes in line 543. See if that works.<br>
<br>Note also that if you do this anywhere else in the script, you'll need to surround those variables with single quotes as well to avoid this same problem.<br><br>Jeff<br><br><div class="gmail_quote">On Tue, Nov 17, 2009 at 9:11 PM, Antoy Chang <span dir="ltr"><<a href="mailto:antoyc@yahoo.com">antoyc@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
<div>Dear Jeff,<br> <br>I manage to solve the error but another error is encountered :<br> <br>in my script ;<br> <br>'d
ave(wht,t='y',t='y+2')'
<br>
<br> <br>sigwa=sublin(result,2)
<br> <br>sig_waves=subwrd(sigwa,4)
<br> <br>if
sig_waves=9.999e+20
<br>SIG.incr="undefined"
<br>else <br>fmt =
'%4.1f' <br>*SIG.incr=math_format(fmt,sig_waves) <br><b>SIG.incr=math_nint(sig_waves*10.0) --------> line 543 <br>
</b><br>if
SIG.incr<3<br>SIG.incr=3<br>endif <br>SIG.incr=math_format(fmt,SIG.incr/10)<br>endif
<br>SIG=SIG%","%SIG.incr <br> <br><br>'d ave(mpr,t='y',t='y+2')'
<br><br>wavper=sublin(result,2)
<br>wave_per.incr=subwrd(wavper,4) <br>if
wave_per.incr=9.999e+20
<br>PER.incr="undefined"
<br>else
<br>* <br>PER.incr =
math_nint(wave_per.incr)<br>endif
<br>PER=PER%","%PER.incr </div>
<div> </div>
<div> </div>
<div> </div>
<div>with same error message as previous one.</div>
<div> </div>
<div>Thank you very much.</div>
<div>Best Regards,</div>
<div>Antoy <br><br>--- On Wed, 11/18/09, Jeffrey Duda <<a href="mailto:jdduda@iastate.edu" target="_blank">jdduda@iastate.edu</a>> wrote:<br><br><br>From: Jeffrey Duda <<a href="mailto:jdduda@iastate.edu" target="_blank">jdduda@iastate.edu</a>><br>
Subject: Re: my script error<br>To: <a href="mailto:antoyc@yahoo.com" target="_blank">antoyc@yahoo.com</a><br>Date: Wednesday, November 18, 2009, 12:25 AM<div><div></div><div class="h5"><br><br><br>Try putting line 454 and the one after it in single quotes. Since you're using these variables in a display command, they need to be defined outside the script.<br>
<br>Jeff Duda<br><br><br>On Tue, Nov 17, 2009 at 2:09 AM, Antoy Chang <<a href="mailto:antoyc@yahoo.com" target="_blank">antoyc@yahoo.com</a>> wrote:<br><br><br><br><br><br><br>Dear All,<br>Can someone here help me this script error, my script is as below :<br>
<br>'d wdr' <br>wind_dirn.incr=subwrd result,4) <br>if wind_dirn.incr=9.999e+20 <br>wind_dirn.incr="undefined" <br>else <br>'define wind_dirn.incr = math_nint(wind_dirn.incr)' <br>endif <br>* <br>
<br>* <br>*determine the resultant wind for three output times <br>pi = 3.1415926 <br>d2r = pi/180
<br>r2d = 1/d2r <br>fmt = '%-6.4f' <br><br>wamv=cos(0.0174532*wdr)*w10 -----> Line 454 <br>wamu=sin(0.0174532*wdr)*w10<br><br>'d sum(wamu,t= 'y',t= 'y+2')' <br>udirs=sublin(result,2) <br>
udir=subwrd(udirs,4)/3 <br><br> The error message : <br> <br>DEFINE error: Name too long; missing '='<br>Non numeric args to numeric operation<br>Error occurred processing function arguments<br> Error occurred on line 454<br>
In file E\KC\WORK\Adhoc_~1\Langkawi.gs<br>ga-><br> <br><br><br><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/%7Ejdduda" target="_blank">www.meteor.iastate.edu/~jdduda</a><br>
</div></div></div></td></tr></tbody></table><br>
</blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/~jdduda">www.meteor.iastate.edu/~jdduda</a><br>