[gradsusr] if... else..... endif syntax error in GRADS

Rafanoharana Serge Claudio rafanoharana at gmail.com
Thu Jul 7 04:12:19 EDT 2011


Dear all,

I found it, Thank you anyway.

if (a> b)
'define c= b'
else
'define c= a'
endif
'define d=c/b'

Regards,

Serge


On Thu, Jul 7, 2011 at 12:40 AM, 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
>



-- 
Serge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110707/ad901e55/attachment-0003.html 


More information about the gradsusr mailing list