TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: BRIAN MCLAUGHLIN
from: BOB SEWELL
date: 1996-02-23 20:49:00
subject: Compiler quirk?

Brian Mclaughlin peeked from behind the 1040 form long enough to say...
 BM>  FOR test% = 1 TO 3
 BM>    IF test% = 3 THEN
 BM>      test% = -333
 BM>      test% = 999
 BM>    END IF
 BM>    PRINT test%
 BM>  NEXT test%
    Basics have always behaved that way.  Colons separating
 statements after an IF/THEN keep blocks of code together.
 Your code above also behaves as if it were written as:
  FOR test% = 1 TO 3
    IF test% = 3 THEN
      test% = -333: test% = 999
    END IF
    PRINT test%
  NEXT test%
    This goes all the way back to GWBASIC.  You could put
 all kinds of statements to be executed on the IF/THEN and
 plenty more after the ELSE, all on the same line seaparated
 by colons.  An example:
  FOR test% = 1 TO 3
    IF test% = 3 THEN test% = -333: test% = 999 else test% = 4: test% = 666
    PRINT test%
  NEXT test%
    Your output would be:
    666
    666
    999
... COMPUTER SUICIDE: Let len(walk) > len(pier)
--- PPoint 1.96
---------------
* Origin: Seven Wells On-Line * Nashville, TN (1:116/3000.12)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.