home *** CD-ROM | disk | FTP | other *** search
- '********************************************************************
- 'HELPMENU.BAS - AN EXAMPLE OF USING HELPMENU TO VIEW A FILE
- '********************************************************************
- REM $DYNAMIC
- DEFINT A-Z 'Make all variables integers by default.
- DIM SHARED a%(2000) 'Dimension an integer array for our window.
- CALL QWINIT(4) 'Need to call this command before using any QW commands.
-
- CLS 'Clear the screen.
- CALL MSHOW 'Make mouse cursor visible.
- DIM SHARED menu$(300) 'Dimension string array to hold lines from file.
- maxlines = 300 'Maximum # of lines to view.
- numoptions = i
- x1 = 5 'Left side of window.
- x2 = 75 'Right side.
- y1 = 4 'Top of window.
- y2 = 21 '& Bottom.
- style = 2 'Set window border = 2 = Double line.
- options = 200 'Set # of items in menu = 200
- battr = 2 'Set attribute for border =
- cattr = &H17 'Set attribute for characters =
- barattr = 3 'Set attribute for bar on right side of menu.
- winid = 1 'Setup id# for window.
- relpos = 0 'Relative starting line in the file.
- 'This could be a index into file for specific help.
-
- '----- Open File & Fill Array to display ----
- OPEN "HELPMENU.BAS" FOR INPUT AS 1
- numlines = 0
- WHILE (NOT EOF(1)) AND (numlines <= maxlines)
- LINE INPUT #1, menu$(numlines)
- numlines = numlines + 1
- WEND
- CLOSE 1
-
- '---- Open a window to use for display ----
- CALL WOPEN(x1, y1, x2, y2, style, battr, "HELPMENU", a(), winid)
- CALL WCOLOR(winid, cattr)
- LOCATE 22, 1
- PRINT "Press ESC to end"
- CALL HELPMENU(winid, relpos, barattr, numlines, VARPTR(menu$(0)), flag)
- LOCATE 22, 1
- PRINT "Exit flag: "; flag; SPACE$(10)
- PRINT "Press any key..."
- WHILE INKEY$ = "": WEND
- END
-
-
-