home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI03.ARJ / ictari.03 / GFA / TUTORIAL / FORNXT_4.LST < prev    next >
File List  |  1989-07-29  |  801b  |  28 lines

  1. '  ***                                   ***
  2. '  *** Demo Of Use Of EXIT IF... In Loop ***
  3. '  ***                                   ***
  4. '  *** Good programmers will avoid this, ***
  5. '  ***  REPEAT_2.LST shows a better way  ***
  6. '  ***   of achieving the same effect    ***
  7. '  ***                                   ***
  8. '
  9. key%=120                             !*** 120 Is ASCII Of 'x' ***
  10. PRINT "Press '";CHR$(key%);"' to exit program"
  11. PRINT
  12. '
  13. FOR attempt%=5 DOWNTO 1
  14.   PRINT attempt%;" attempt(s) left:"
  15.   test%=INP(2)
  16.   EXIT IF test%=key%                 !*** Exit If Pressed 'x' ***
  17. NEXT attempt%                        !*** Exit If No Attempts Left ***
  18. '
  19. IF attempt%=0
  20.   PRINT CHR$(10);"YOU FAILED!"
  21. ELSE
  22.   PRINT CHR$(10);"YOU PASSED!"
  23. ENDIF
  24. '
  25. PRINT CHR$(7);
  26. VOID INP(2)
  27. EDIT
  28.