Page 1 of 1

Compare 2 truth values

Posted: Tue Jul 18, 2006 11:07 am
by savagedavid
I am trying to write an IF-THEN statement to compare 2 values which are either tru or false. The statement is of the form:

IF (condition = true AND condition = true) THEN do action

An example I tried is :

:if ([/ping 10.0.0.254 count=1] & [/ping 10.0.0.253 count=1] = 1) do {:put "Both Gateways reachable"}

The script returns an error saying

Cannot compute logical AND of integer and truth values.

How can I compare 2 truth values?

Thanks
David

Posted: Mon Jul 24, 2006 10:22 am
by Eugene
:if ([/ping 10.0.0.254 count=1]=1 && [/ping 10.0.0.253 count=1]=1) do {:put "Both Gateways reachable"}
Eugene

Posted: Mon Jul 24, 2006 11:48 am
by savagedavid
Thanks - I initially had the right idea - just my formatting of the statement was wrong. It is working properly now.