home *** CD-ROM | disk | FTP | other *** search
/ The CIA World Factbook 1992 / k3bimage.iso / sel / 04 / 0020 / menu.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1991-12-02  |  3.4 KB  |  89 lines

  1. 10  '                   M E N U . B A S                 5/25/87 11:49 am
  2. 20  '
  3. 30  '   MENU provides a menu for access to Amy's First Primer.  It loads
  4. 40  '   a picture with the menu on it, and then let's a child select the
  5. 50  '   desired program by moving a big blue arrow up or down with the
  6. 60  '   cursor keys.  The name of the program is also highlighted in blue when
  7. 70  '   the arrow points to it.  When the child presses the ENTER key, the
  8. 80  '   program with the arrow pointing to it will be run.
  9. 90  '
  10. 100  '    Converted for IBM-PC Screen 1
  11. 110  '
  12. 120  CLEAR ,48000 : SCREEN 1 : COLOR 0,1 : KEY OFF : CLS
  13. 130  LOCATE 22,12 : PRINT "AMY'S FIRST PRIMER  1.2"
  14. 140  LOCATE 24,1 : PRINT "  copyright 1985, Computing Specialties";
  15. 150  '
  16. 160  '
  17. 170  '         Poke subroutine ALOAD into memory.
  18. 180  '
  19. 190  DEF SEG : ALOAD= 48000
  20. 200  FOR IB=0 TO  95 : READ BYTE : POKE ALOAD+IB,BYTE : NEXT IB
  21. 210  DATA &H55, &H8B, &HEC, &H8B, &H5E, &H0A, &H8A, &H0F, &HB5, &H00, &H8B, &H77
  22. 220  DATA &H01, &H8B, &H5E, &H08, &H8B, &H07, &H8E, &HC0, &HBF, &H00, &H00, &HA4
  23. 230  DATA &HE2, &HFD, &HB0, &H00, &HAA, &H1E, &H06, &H1F, &H07, &HB0, &H00, &HB4
  24. 240  DATA &H3D, &HBA, &H00, &H00, &HCD, &H21, &H72, &H24, &H8B, &HD8, &HB9, &H07
  25. 250  DATA &H00, &HBA, &H00, &H00, &HB4, &H3F, &HCD, &H21, &H3B, &HC1, &H74, &H05
  26. 260  DATA &HB8, &H0D, &H00, &H75, &H0F, &HBE, &H05, &H00, &H8B, &H0C, &HB4, &H3F
  27. 270  DATA &HBA, &H00, &H00, &HCD, &H21, &HB8, &H00, &H00, &H8B, &H7E, &H06, &H26
  28. 280  DATA &H89, &H05, &HB4, &H3E, &HCD, &H21, &H06, &H1F, &H5D, &HCA, &H06, &H00
  29. 290  '
  30. 300  '           Load the menu picture onto the screen.
  31. 310  '
  32. 320  SEG2%=&HB800 : BERR%=0 : FILE$="MENU1.PIC" : CALL ALOAD(FILE$,SEG2%,BERR%)
  33. 330  MYNAME$="AMY"
  34. 340  LOCATE 22,15-LEN(MYNAME$) : PRINT MYNAME$;
  35. 350  '
  36. 360  '           Initialize all necessary variables.
  37. 370  '
  38. 380  UP$=CHR$(0)+CHR$(72) : DN$=CHR$(0)+CHR$(80)
  39. 390  TITLE$(1)="ABC SONG"
  40. 400  TITLE$(2)="BEARY FUN LETTERS"
  41. 410  TITLE$(3)="BUNNY LETTERS"
  42. 420  TITLE$(4)="BEARY FUN COUNTING"
  43. 430  TITLE$(5)="HELP THE FROGGY"
  44. 440  TITLE$(6)="LOAD THE TRUCK"
  45. 450  '
  46. 460  '           Get the arrow into an array, then point it at the first
  47. 470  '           program on the menu.
  48. 480  '
  49. 490  DIM ARROW(200) : GET (6,1)-(55,28),ARROW : LINE (6,1)-(55,28),0,BF
  50. 500  N=1 : X=6 : Y=1 : PUT (X,Y),ARROW,XOR : ROW=3 : COL=22 : L=1
  51. 510  ' LOCATE ROW,COL : PRINT TITLE$(N);
  52. 515  LOCATE 23,10 : PRINT "<ESC> to return to DOS"
  53. 520  WHILE INKEY$<>"" : WEND
  54. 530  '
  55. 540  '           Wait until one of the three command keys are pressed.
  56. 550  '           The up arrow will move the arrow up and select the previous
  57. 560  '           program.  The down arrow will move the arrow down and select
  58. 570  '           the next program.  The ENTER key will run the selected program.
  59. 580  '
  60. 590  K$=INKEY$ : IF K$="" THEN 590
  61. 595  IF K$=CHR$(27) THEN SYSTEM
  62. 600  IF K$=CHR$(13) THEN GOTO 790
  63. 610  IF K$=UP$ AND N>1 THEN N=N-1
  64. 620  IF K$=DN$ AND N<6 THEN N=N+1
  65. 630  '
  66. 640  '           Remove the arrow from the current program and place it on the
  67. 650  '           newly selected program.  Also change the current program name
  68. 660  '           back to red and the new program name to blue.
  69. 670  '
  70. 680  PUT (X,Y),ARROW,XOR ' LOCATE ROW,COL : PRINT TITLE$(L);
  71. 690  Y=6+(N-1)*24 : ROW=N*3 : L=N
  72. 700  PUT (X,Y),ARROW,XOR ' LOCATE ROW,COL : PRINT TITLE$(N);
  73. 710  WHILE INKEY$<>"" : WEND
  74. 720  '
  75. 730  '           Go back for another key press.
  76. 740  '
  77. 750  GOTO 590
  78. 760  '
  79. 770  '           The ENTER key was pressed, execute the selected program.
  80. 780  '
  81. 790  ON N GOTO 800,810,820,830,840,850
  82. 800  RUN"ABC"
  83. 810  RUN"BEARABC"
  84. 820  RUN"BUNNY"
  85. 830  RUN"BEAR123"
  86. 840  RUN"FROG"
  87. 850  RUN"TRUCK"
  88. 860  END
  89.