home *** CD-ROM | disk | FTP | other *** search
/ Nibble Magazine / nib40b.dsk / GOTO.GOSUB.bas < prev    next >
BASIC Source File  |  2023-02-26  |  641b  |  28 lines

  1. 10  REM  ***********************
  2. 20  REM  * GOTO -- GOSUB DEMO  *
  3. 30  REM  * BY FRANK H. SWEET   *
  4. 40  REM  * COPYRIGHT (C) 1990  *
  5. 50  REM  * MINDCRAFT PUBL.CORP.*
  6. 60  REM  * CONCORD, MA 01742   *
  7. 70  REM  ***********************
  8. 130 :
  9. 140  REM  A short program to illustrate the
  10. 150  REM     possibilities of using GOTO
  11. 160  REM  and GOSUB to debug a BASIC program
  12. 170 :
  13. 180  HOME 
  14. 190  INPUT "Enter a name ";N$
  15. 200  INPUT "Enter number of times to print it ";N
  16. 210  GOSUB 290
  17. 220 X = 12
  18. 230 :
  19. 240  FOR K = 1 TO 12
  20. 250  PRINT K,K *X
  21. 260  NEXT 
  22. 270  END 
  23. 280 :
  24. 290  REM  SUBROUTINE
  25. 300  FOR K = 1 TO N
  26. 310  PRINT N$
  27. 320  NEXT K
  28. 330  RETURN