86 This prints YES because 6=6 is TRUE . 5 H=-1 10 IF H THEN PRINT "YES" ELSE PRINT "NO" >RUN YES The above program prints YES because H is TRUE since it has the value -1. 5 H=0 10 IF H THEN PRINT "YES" ELSE PRINT "NO" >RUN NO This program sets H=FALSE at line 5 so the program prints NO . -1 implies TRUE and 0 implies FALSE . What about other values of H? In fact all non-zero values (except non-integers between -1 and +1) are regarded as TRUE , as the following shows: 5 H=-55 10 IF H THEN PRINT "YES" ELSE PRINT "NO" >RUN YES Here are some other peculiar examples: 10 G= (6=6) 20 PRINT G >RUN -1 because (6=6) is TRUE .
10 IF 5-6 THEN PRINT "TRUE" >RUN TRUE This works because (5-6) is -1 which is TRUE . These tricks are more than academic. They can be very useful – not least when you are trying to fathom out what on earth the computer thinks it is doing!