[gradsusr] if... else..... endif syntax error in GRADS
NAGARAJU CHILUKOTI
chilukotinagaraju at gmail.com
Thu Jul 7 08:37:02 EDT 2011
Hi you try like this
if (a> b) then
c= b
else
c= a
On Thu, Jul 7, 2011 at 1:10 PM, Rafanoharana Serge Claudio <
rafanoharana at gmail.com> wrote:
> Dear all,
>
> My file contains 2 variables a and b. I have the following condition:
>
> if a>b => c=b
> if a<b => c=a
>
> so: d=c/b
>
> in my .gs file, I tried:
>
> '!if (a> b)'
> 'c= b'
> '!else'
> 'c= a'
> '!endif'
> 'define d=c/b'
>
> but it gives syntax error.
>
> Then I tried to define the c like:
>
> '!if (a> b)'
> 'define c= b'
> '!else'
> 'define c= a'
> '!endif'
> 'define d=c/b'
>
> Again, syntax error.
>
> ERROR:
> sh: -c: line 1: syntax error: unexpected end of file
> sh: -c: line 0: syntax error near unexpected token `else'
> sh: -c: line 0: `else'
> sh: endif: command not found
>
>
> Thank you in advance,
>
>
> Best regards,
>
> --
> Serge
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
--
Nagaraju Chilukoti
CCCR,
IITM, Pashan
Pune 411008
Mob.* 09224278979*
cnraju at tropmet.res.in <http://goog_932359822>
chilukotinagaraju at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110707/7d6eca88/attachment-0003.html
More information about the gradsusr
mailing list