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

Rafanoharana Serge Claudio rafanoharana at gmail.com
Tue Jul 12 11:18:14 EDT 2011


Dear Nagaraju,

Thank you for your answer but I've already found it. Below is the script:

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

Anyway, the if expression in grads is not accompanied by then.

Regards,

Serge

On Thu, Jul 7, 2011 at 5:37 AM, NAGARAJU CHILUKOTI <
chilukotinagaraju at gmail.com> wrote:

> 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
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


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


More information about the gradsusr mailing list