IF+ , IF-

 
 
 
 
IF+
 
 
 
Purpose:
To detect occurrence of event.
 
 
Format:
IF+ x THEN clause [ELSE clause]
 
 
Description: x is any expression
 
clause is a BASIC statement or sequence of statements (separated by commas), or a line number to branch to
 
If x is true, and on the previous check it was false, the clause following the THEN is executed. Otherwise the clause after the ELSE is executed.
 
Example:
10
IF+ CHILLER THEN GOSUB 40
 
 
 
 
20
IF+ TIME >  12:00 THEN GOSUB 60
 
 
 
30 END
 
 
 
 
40
PRINT “THE CHILLER HAS JUST COME ON”
 
 
 
50 RETURN
 
 
 
 
60
REM RING LUNCH BELL
 
 
 
70
START BELL
 
 
 
80
WAIT 00:00:05
 
 
 
90
STOP BELL
 
 
 
100 RETURN
 
 
 
 
 
 
IF-
 
 
 
Purpose:
To detect occurrence of event.
 
 
 
Format:
IF- x THEN clause [ELSE clause]
 
 
 
Description: x is any expression
 
clause is a BASIC statement or sequence of statements (separated by commas), or a line number to branch to
 
 
 
If x is False, and on the previous check it was true the clause following the THEN is executed. Otherwise the clause after the ELSE is executed.
 
 
Example:     10 IF- CHILLER THEN GOSUB 30 20 END
 
30 PRINT “THE CHILLER HAS JUST GONE OFF”
 
40 RETURN