PDA

View Full Version : IF... THEN question.



Rogerio
- 28th October 2013, 14:57
I can't find a definitive answer to this, is this legal?

IF result = 15 OR result = 30 OR result = 45 OR result = 60 THEN
xxx
xxx
ENDIF

How many conditions can you use in an IF THEN ?

Thanks!

BobEdge
- 28th October 2013, 15:20
Hi,

The conditions would be in brackets i.e.

if (a = 1) or (a = 2) then

I think the number is only limited by memory. I tried 10 no problem.

Regards
Bob

Rogerio
- 28th October 2013, 15:59
Thanks a lot Bob!

Art
- 29th October 2013, 02:04
It's still silly though.



var i byte ' counter

FOR i = 15 TO 60 STEP 15

IF result = i THEN
xxx
xxx
ENDIF

NEXT i


Now the maximum in this situation is the overflow of i.