home *** CD-ROM | disk | FTP | other *** search
/ Explore the World of Soft…ids, Adults, Educational / RocelcoInc-ExploreTheWorldOfSoftware-KidsAdultsEducational-Vol2-Shareware.iso / educate / disk061 / menu.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1987-05-25  |  3.3 KB  |  87 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. 520  WHILE INKEY$<>"" : WEND
  53. 530  '
  54. 540  '           Wait until one of the three command keys are pressed.
  55. 550  '           The up arrow will move the arrow up and select the previous
  56. 560  '           program.  The down arrow will move the arrow down and select
  57. 570  '           the next program.  The ENTER key will run the selected program.
  58. 580  '
  59. 590  K$=INKEY$ : IF K$="" THEN 590
  60. 600  IF K$=CHR$(13) THEN GOTO 790
  61. 610  IF K$=UP$ AND N>1 THEN N=N-1
  62. 620  IF K$=DN$ AND N<6 THEN N=N+1
  63. 630  '
  64. 640  '           Remove the arrow from the current program and place it on the
  65. 650  '           newly selected program.  Also change the current program name
  66. 660  '           back to red and the new program name to blue.
  67. 670  '
  68. 680  PUT (X,Y),ARROW,XOR ' LOCATE ROW,COL : PRINT TITLE$(L);
  69. 690  Y=6+(N-1)*24 : ROW=N*3 : L=N
  70. 700  PUT (X,Y),ARROW,XOR ' LOCATE ROW,COL : PRINT TITLE$(N);
  71. 710  WHILE INKEY$<>"" : WEND
  72. 720  '
  73. 730  '           Go back for another key press.
  74. 740  '
  75. 750  GOTO 590
  76. 760  '
  77. 770  '           The ENTER key was pressed, execute the selected program.
  78. 780  '
  79. 790  ON N GOTO 800,810,820,830,840,850
  80. 800  RUN"ABC"
  81. 810  RUN"BEARABC"
  82. 820  RUN"BUNNY"
  83. 830  RUN"BEAR123"
  84. 840  RUN"FROG"
  85. 850  RUN"TRUCK"
  86. 860  END
  87.