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

Rafanoharana Serge Claudio rafanoharana at gmail.com
Thu Jul 7 03:40:12 EDT 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110707/ee220681/attachment-0003.html 


More information about the gradsusr mailing list