string comparison

Ping Liu pliu at HAWAII.EDU
Wed Apr 20 17:54:44 EDT 2005


The following script is expected to say letter a but it says a to g one
by one. Any comments? GrADS version v1.8SL9.

str='abcdefg'
rec=math_strlen(str)
i=1
while(i<=rec)
ss=substr(str,i,1)
if(ss = 'a') then
* What is wrong here?
 say ss
endif
i=i+1
endwhile

ga-> run teststr.gs
a
b
c
d
e
f
g



More information about the gradsusr mailing list