evaluate an "IF"


Recommended Posts

Posted

I'm trying to evaluate a if sequence.

global cx = 1

global cy = 1

execute("if (alarmtt"+doubletostr(cx)+"==0 && alarmtr"+doubletostr(cx)+"==0)")

cx=2

endif

but I get the following alert

C1048 No endif found - Error compiling sequence , Line Number 1: Line 3 - Unable to perform quick sequence action

I've tried to evaluate the ENDIF but still the same alert.

Thanks.

Posted

You can't do an if() inside an execute that way. Without going into detail why, or how you would do an if() inside an execute, you really want to use evaluate():

if (evaluate("alarmtt"+doubletostr(cx)+"==0 && alarmtr"+doubletostr(cx)+"==0"))

Archived

This topic is now archived and is closed to further replies.