Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

242 IF Purpose This sets up a test condition which can be used to control the subsequent action of the computer. Examples 100 IF A=1 THEN PRINT "One" ELSE PRINT "Not one" 100 IF month=12 THEN PRINT "December" 100 IF answer$="BANANA" THEN PROCfruit 100 IF height 100 IF length 5 THEN 2140 100 IF RATE=5 THEN Y=6:Z=8 ELSE PRINT "Wrong rate" 100 IF month=11 THEN IF day=5 THEN PRINT "Guy Fawkes" 100 IF month=1 AND day=1 THEN PRINT "New Year" 100 IF X THEN Y=0 A statement forming part of the IF...THEN...ELSE structure. The word THEN is optional as is the ELSE section. Description Syntax IF condition>[ THEN ] | numeric>[ ELSE | numeric>] THEN , ELSE Associated keywords