0

else if

Grumpy Vern 5 months ago in IQANdesign updated by Christopher Fridstaden 5 months ago 1

Do consecutive else if statements stop at the first true? For example, I expect the code below makes result = 3.

if false then

result:=1

elseif false then

result:=2

elseif true then

result:=3

elseif true then 

result:=4

else

result:=5

endif

+1

Yes, the conditional statements are evaluated from top to bottom. The code for the first statement to be evaluated as TRUE will be run and that will "break" the if-then-else and the code below will be run.