home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Basic / QWINDO.ZIP / HELPMENU.BAS < prev    next >
Encoding:
BASIC Source File  |  1990-01-01  |  1.8 KB  |  49 lines

  1. '********************************************************************
  2. 'HELPMENU.BAS - AN EXAMPLE OF USING HELPMENU TO VIEW A FILE
  3. '********************************************************************
  4. REM $DYNAMIC
  5. DEFINT A-Z              'Make all variables integers by default.
  6. DIM SHARED a%(2000)     'Dimension an integer array for our window.
  7. CALL QWINIT(4)          'Need to call this command before using any QW commands.
  8.  
  9. CLS                     'Clear the screen.
  10. CALL MSHOW              'Make mouse cursor visible.
  11. DIM SHARED menu$(300)   'Dimension string array to hold lines from file.
  12. maxlines = 300          'Maximum # of lines to view.
  13. numoptions = i
  14. x1 = 5                  'Left side of window.
  15. x2 = 75                 'Right side.
  16. y1 = 4                  'Top of window.
  17. y2 = 21                 '& Bottom.
  18. style = 2               'Set window border = 2 = Double line.
  19. options = 200           'Set # of items in menu = 200
  20. battr = 2               'Set attribute for border =
  21. cattr = &H17            'Set attribute for characters =
  22. barattr = 3             'Set attribute for bar on right side of menu.
  23. winid = 1               'Setup id# for window.
  24. relpos = 0              'Relative starting line in the file.
  25.             'This could be a index into file for specific help.
  26.  
  27. '----- Open File & Fill Array to display ----
  28. OPEN "HELPMENU.BAS" FOR INPUT AS 1
  29. numlines = 0
  30. WHILE (NOT EOF(1)) AND (numlines <= maxlines)
  31.    LINE INPUT #1, menu$(numlines)
  32.    numlines = numlines + 1
  33. WEND
  34. CLOSE 1
  35.  
  36. '---- Open a window to use for display ----
  37. CALL WOPEN(x1, y1, x2, y2, style, battr, "HELPMENU", a(), winid)
  38. CALL WCOLOR(winid, cattr)
  39. LOCATE 22, 1
  40. PRINT "Press ESC to end"
  41. CALL HELPMENU(winid, relpos, barattr, numlines, VARPTR(menu$(0)), flag)
  42. LOCATE 22, 1
  43. PRINT "Exit flag: "; flag; SPACE$(10)
  44. PRINT "Press any key..."
  45. WHILE INKEY$ = "": WEND
  46. END
  47.  
  48.  
  49.