home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Basic / QLIB57.ZIP / INPUT.DOC < prev    next >
Encoding:
Text File  |  1993-03-31  |  28.0 KB  |  714 lines

  1.  
  2.   INPUT subroutines replace BASIC's INKEY$ or INPUT commands, and add
  3.   functions not available with BASIC alone.
  4.  
  5.  
  6.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  7.  
  8.     Subroutine: ClearKey
  9.     object file: clearkey.obj (getkey.obj)
  10.  
  11.         Removes all keypresses from the keyboard's "type ahead" buffer.
  12.     Works with standard and enhanced keyboards.
  13.  
  14.     Example:
  15.         CALL ClearKey
  16.  
  17.  
  18.  
  19.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  20.  
  21.     Function: keycode% = DGetKey
  22.     object file: dgetkey.obj
  23.  
  24.          Using DOS functions, DGetKey returns the ASCII character code of
  25.     the first keypress waiting in the keyboard buffer.  If the key code
  26.     returned > 255, then the key pressed is an extended keycode (such as
  27.     the function keys F1 - F10) and the ASCII code of the key is (code%
  28.     AND 255).  If no keypresses are waiting in the keyboard buffer,
  29.     DGetKey waits until a key is pressed before it returns to BASIC.
  30.     Unlike GetKey, below, input to DGeyKey may be redirected from the
  31.     command line.  DGeyKey does not support F11 or F12 function keys.
  32.     DGetKey allows ^C to pass through as keycode% = 3 without causing your
  33.     program to stop.  ^<Break> works the same as ^C in compiled programs;
  34.     in the QuickBASIC or QBX development enviornment, ^<break> causes
  35.     suspension of program operation (as it normally does).  See your BASIC
  36.     manual for ASCII character codes.
  37.  
  38.     Example:
  39.         REM $INCLUDE: 'qlib.bi'
  40.         keycode% = DGetKey
  41.         IF keycode% < 255 THEN PRINT CHR$(keycode%)   ' prints key pressed
  42.  
  43.  
  44.  
  45.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  46.  
  47.     Function: GPullDown(VARPTR(menu$(0)), choice0%, choice1%)
  48.     object files: gpulldn.obj (q$menu.obj and several others)
  49.               (for graphics modes; requires QuickBASIC or BC7
  50.                without /fs switch -  NOT for QBX development
  51.                enviornment or VBDOS)
  52.  
  53.     Function: PullDown(VARPTR(menu$(0)), choice0%, choice1%)
  54.     object files: pulldown.obj (q$menu.obj and several others)
  55.               (for text modes)
  56.  
  57.     Subroutine: MenuOption(optionnumber%, option% [option$ for option 6])
  58.     object file: q$menu.obj
  59.  
  60.     Pull-down menu system similar to the menus in the QuickBASIC
  61.     development environment.  You may specify initial main choice and
  62.     initial submenu choice (choice0% and choice1%).  PullDown returns to
  63.     BASIC when either ESC or RETURN is pressed, and returns the menu choice
  64.     in choice0% and choice1%.  Use cursor keys, home/end, pgup/pgdown or
  65.     mouse to move cursor.  PullDown will also jump to a menu choice when an
  66.     alphabetic key is pressed if that menu choice includes a capitalized
  67.     letter, and the key pressed matches the capital letter ("Hotkey"
  68.     feature).  Menu choices are disabled if all lower case.
  69.  
  70.     PullDown (and GPullDown) saves the screen under the menu, and restores
  71.     the screen when it exits.
  72.  
  73.     If choice1% (initial submenu choice) < 0, the main selections
  74.     will be printed without submenus.  You may move among the main
  75.     headings with left & right arrow keys or with the mouse.  Submenus
  76.     are displayed when Enter or any mouse buttons are pressed, or when
  77.     up or down arrows are pressed, or when the mouse pointer is moved up
  78.     or down.  Esc will erase the main headings and return to BASIC.
  79.  
  80.     MenuOption is used to specify colors.  Options supported are:
  81.  
  82.     option 0 = normal text color
  83.     option 1 = highlight color (menu choice)
  84.     option 2 = menu box color
  85.     option 3 = hotkey color
  86.  
  87.     If you do not specify colors, PullDown uses bright white text and
  88.     menu box, reverse video menu choice and hotkey color.
  89.  
  90.     Other options are:
  91.  
  92.     option 4 = user-specified exit key code (see GetKey for keycodes)
  93.     option 5 = exit when hotkey is pressed
  94.     option 6 = user-specified string printed at right edge of screen
  95.                (PullDown only - NOT for VBDOS, QBX or PDS /FS option)
  96.     option 7 = allow selection of string without capital letter
  97.                (VertList only)
  98.  
  99.     Any menu option may be canceled by setting the option = 0.
  100.  
  101.     Example:
  102.        see MENU.BAS example program
  103.  
  104.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  105.  
  106.     Function: keycode% = GetKey
  107.     object file: getkey.obj (asmflags.obj)
  108.  
  109.         Returns the ASCII character code of the first keypress waiting in
  110.     the keyboard buffer.  If the key code returned > 255, then the key
  111.     pressed is an extended keycode (such as the function keys F1 - F10)
  112.     and the ASCII code of the key is (code% AND 255).  If no keypresses are
  113.     waiting in the keyboard buffer, GetKey waits until a key is pressed
  114.     before it returns to BASIC.  GetKey supports F11 and F12 on 101-key
  115.     keyboards if the PC's BIOS also supports 101-key keyboards (See GetKBD).
  116.     See your BASIC manual for most ASCII character codes.
  117.  
  118.     ASCII character codes for F11 and F12 are not listed in some BASIC
  119.     manuals:
  120.                    with SHIFT     with CTRL      with ALT
  121.     F11       133       135            137            139
  122.     F12       134       136            138            140
  123.  
  124.     Example:
  125.          REM $INCLUDE: 'qlib.bi'
  126.          keycode% = GetKey
  127.          IF keycode% AND 256 THEN
  128.               keycode% = keycode% AND 255
  129.               IF keycode% = 138 THEN PRINT "CTRL+F12 was pressed"
  130.               ELSE
  131.            .
  132.            .
  133.            .
  134.          END IF
  135.  
  136.  
  137.  
  138.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  139.  
  140.     Function: keycode% = GVertList(VARPTR(a$(0)), x0%, y0%, choice%)
  141.     object files: gvlist.obj (q$menu.obj, m$input.obj, gprint.obj, others)
  142.  
  143.          Vertical List menu subroutine for all QLIB graphics modes; prints
  144.     a list of menu choices on the screen at (x, y), user selects one menu
  145.     choice with cursor keys or with a "hot key".  Use of the "hot key"
  146.     requires at least one capital letter (A-Z) in the menu choice; the
  147.     "hot key" is that letter.  If IsMouse was called earlier in the
  148.     program, the mouse may also be used to select a menu choice. GVertList
  149.     returns to the calling program when Enter, ESC, or (optionally) a
  150.     user-defined exit key or hotkey or mouse button is pressed.  If a mouse
  151.     button was pressed, keycode% = 768 OR [button code].
  152.  
  153.     Button codes are:
  154.       1 = left button
  155.       2 = right button
  156.       4 = center button
  157.  
  158.     GVertList restores the previous screen contents on exit.
  159.  
  160.     GVertList shares the MenuOption subroutines with other QLIB menu
  161.     subroutines.  GVertList recognizes options 0 - 5.  See MenuOption.
  162.  
  163.     Example:
  164.          REM $INCLUDE: 'qlib.bi'
  165.  
  166.          ' set up list of menu choices, using programmer's string data
  167.          ' in DATA statement
  168.          DIM a$(10)
  169.          FOR i = 0 to 9: READ a$(i): NEXT i
  170.          a$(10) = ""         ' make sure NUL string is at end of string array
  171.  
  172.          SCREEN 12
  173.          ' specify bright red color for menu choice and "hot key"
  174.          ' and specify F10 as additional exit key
  175.          CALL MenuOption(1, 12): CALL MenuOption(3, 12)
  176.          CALL MenuOption(4, (256 OR 68))
  177.  
  178.          ' start with cursor at top of list
  179.          choice = 0
  180.          p = VARPTR(a$(0)): x0 = 100: y0 = 100
  181.          keycode = GVertList(p, x, y, choice)
  182.          SELECT CASE keycode
  183.              CASE 13               ' ENTER was pressed
  184.                  SELECT CASE choice
  185.                        .
  186.                        .
  187.                  END SELECT
  188.              CASE 27               ' ESC was pressed
  189.                  .
  190.                  .
  191.              CASE (256 OR 68)      ' F10 was pressed
  192.                  .
  193.                  .
  194.              CASE 769 to 772       ' mouse button pressed
  195.                  .
  196.          END SELECT
  197.  
  198.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  199.  
  200.     Subroutine: HideMouse
  201.     object file: mouse.obj (mousedat.obj)
  202.  
  203.          Makes the mouse cursor disappear.  The mouse driver continues to
  204.     track the mouse's motion and button status.
  205.  
  206.     Example:
  207.          HideMouse
  208.  
  209.  
  210.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  211.  
  212.     Subroutine: HideGMouse
  213.     object file: gmouse.obj (mousedat.obj, $graph.obj)
  214.  
  215.          Makes the alternate graphics mouse cursor disappear.  QLIB's
  216.     alternate mouse driver continues to track the mouse's motion.
  217.     See GMouse in GRAPHICS.DOC.
  218.  
  219.     Example:
  220.          HideGMouse
  221.  
  222.  
  223.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  224.  
  225.     Function: k% = IsAlpha(keycode%)
  226.     object file: isalpha.obj
  227.  
  228.     Function: k% = IsDigit(keycode%)
  229.     Function: k% = IsLower(keycode%)
  230.     Function: k% = IsUpper(keycode%)
  231.  
  232.          These function quickly determine if keycode% is an alphabetic
  233.     character (A-Z, a-z: IsAlpha), a numeric digit (0-9: IsDigit), a
  234.     lower-case alphabetic character (a-z: IsLower) or an upper-case
  235.     alphabetic character (A-Z: IsUpper).  k% = keycode% if keycode%
  236.     meets the function's search criteria, or k% = 0 if keycode is not
  237.     0-9, A-Z, or a-z (depending on the function).  Keycode% may be the
  238.     output of LineEdit, GLineEdit or the GetKey or DGetKey functions.
  239.  
  240.     Example:
  241.       REM $INCLUDE: 'qlib.bi'
  242.       REM I want to input only lowercase a-z
  243.  
  244. 10:   k% = IsLower(GetKey)
  245.       IF k% = 0 GOTO 10
  246.  
  247.  
  248.  
  249.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  250.  
  251.     Function: JaNein
  252.     object file: janein.obj
  253.  
  254.     German language version of YesNo.  Waits for either "J" or "N" to be
  255.     pressed, then returns the ASCII character code of the key pressed.
  256.     The character code returned will be the code for UPPER case "J" or "N",
  257.     regardless of whether the key pressed was upper or lower case.
  258.  
  259.     Example:
  260.          REM $INCLUDE: 'QLIB.BI'
  261.          PRINT "Are you sure? (J/N)"
  262.          REM  ASC("J") = 74, ASC("N") = 78
  263.          IF JaNein = 78 THEN
  264.                    .         ' instructions for N response
  265.                    .
  266.                    .
  267.               ELSE
  268.                    .         ' instructions for J response
  269.                    .
  270.                    .
  271.          END IF
  272.  
  273.  
  274.  
  275.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  276.  
  277.     Function: k% = KeyFilter(s1$, s2$, keycode%)
  278.     object file: keyfilt.obj
  279.  
  280.         KeyFilter compares keycode% to each character in the strings
  281.     s1$ and s2$, and returns k% = 0 unless keycode% matches a character
  282.     in the search strings.  If keycode% is a normal character (i.e., not
  283.     a function key), then s1$ is used.  If keycode% is an extended keycode,
  284.     (keycode% > 255) then s2$ is used.  See example.
  285.  
  286.     Example:
  287.     REM $INCLUDE: 'qlib.bi'
  288.     REM  I want to input only the letters a, c and g (upper or lower case)
  289.     REM  and I also want to watch for F10 (keycode% = 256 OR 68)
  290.     s1$ = "aAcCgG"
  291.     s2$ = CHR$(68)
  292. 10: k% = KeyFilter(s1$, s2$, keycode%)
  293.     IF k% = 0 GOTO 10
  294.  
  295.     REM  Note that KeyFilter may also be called using one of QLIB's input
  296.     REM  functions such as GetKey, DGetKey or KeyIfWaiting like this:
  297.     REM  10: k% = KeyFilter(s1$, s2$, KeyIfWaiting)
  298.     REM      IF k% = 0 GOTO ...
  299.  
  300.  
  301.  
  302.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  303.  
  304.     Function: keycode% = KeyIfWaiting
  305.     object files: kifwait.obj (getkey.obj, asmflags.obj)
  306.  
  307.     Uses BIOS calls to determine whether a key is waiting in the keyboard
  308.     buffer, returning the key to BASIC.  If no key is waiting, KeyIfWaiting
  309.     returns keycode% = 0.  KeyIfWaiting supports F11 and F12 keys on 101-key
  310.     keyboards if the PC's BIOS also supports these keyboards.
  311.  
  312.     Example:
  313.          keycode% = KeyIfWaiting
  314.  
  315.  
  316.  
  317.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  318.  
  319.     Subroutine: KeyOrButton(buttons%, keycode%)
  320.     object files: mouse.obj (getkey.obj)
  321.  
  322.     Returns first key pressed or mouse button pressed.  If no key is waiting
  323.     in the keyboard buffer and no mouse button is pressed, KeyOrButton waits
  324.     until one of these events happens.  If a key is waiting in the keyboard
  325.     buffer before KeyOrButton is called, the key is returned to QB without
  326.     checking mouse buttons.  Buttons% = 0 if a key has been read, otherwise
  327.     buttons% indicates which buttons are pressed.  See GetKey for key codes,
  328.     and see the example below for buttons% codes.  More than one button may
  329.     be pressed.
  330.  
  331.     Example:
  332.         CALL KeyOrButton(buttons%, keycode%)
  333.         msg$ = ""
  334.         IF buttons% THEN
  335.                IF buttons% AND 1 THEN msg$ = "left button pressed "
  336.                IF buttons% AND 2 THEN msg$ = msg$ + "right button pressed "
  337.                IF buttons% AND 4 THEN msg$ = msg$ + "center button pressed"
  338.                PRINT msg$
  339.                ELSE
  340.                            ' action for key pressed
  341.         END IF
  342.  
  343.  
  344.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  345.  
  346.     Function: a% = KeyWaiting
  347.     object file: getkey.obj (asmflags.obj)
  348.  
  349.     Uses BIOS calls to determine whether a key is waiting in the keyboard
  350.     buffer, without reading the key.  KeyWaiting supports F11 and F12 keys on
  351.     101-key keyboards if the PC's BIOS also supports these keyboards.
  352.  
  353.     Example:
  354.          REM $INCLUDE: 'qlib.bi'
  355.          IF KeyWaiting% THEN PRINT "A key has been pressed"
  356.  
  357.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  358.  
  359.     Subroutine: LineEdit(st$, row%, col%, attr%, options%, keycode%)
  360.     Subroutine: StartEdit(startcol%)
  361.     Function: LastEdit
  362.     object files: lineedit.obj (q$edit.obj, crt.obj, q$qprn.obj, cursor.obj,
  363.                                 getkey.obj)
  364.  
  365.          LineEdit displays st$ at (row%, col%) and provides many editing
  366.     functions, returning the edited string to BASIC.  The length of st$
  367.     will not change during the editing process.  Options are provided to
  368.     restrict legal input or to provide additional information, depending on
  369.     the bits set in options%.  See LineEdit's Summary of Commands, below.
  370.     See GetKey to interpret the keycode% returned by LineEdit.
  371.          StartEdit may be used before calling LineEdit in order to begin or
  372.     resume editing at a specified position in st$ (default position is
  373.     1, the left end of the string).  LastEdit is used after LineEdit returns
  374.     to BASIC, to determine the cursor position in st$ when control was
  375.     returned to BASIC.
  376.          LineEdit turns the cursor off when returning to BASIC.  You may
  377.     use BASIC's LOCATE command or QLIB's CursorON subroutine to restore
  378.     the cursor.  LineEdit works only in text mode.  Use GLineEdit in graphics
  379.     modes (See GLineEdit in GRAPHICS.DOC.).  LineEdit will edit any string up
  380.     to 32,767 bytes long.  See also WindowEdit.
  381.  
  382.     Thanks to Thomas Cullins for his bug report on the BC7/QBX version of
  383.     LineEdit.
  384.  
  385.      Summary of LineEdit commands:
  386.  
  387.      Enter, Esc = return string to BASIC
  388.      Left arrow, Right arrow = move cursor
  389.      Insert = toggle insert/overstrike modes
  390.      Home = move cursor to start of line
  391.      End = move cursor to end of text
  392.      Delete = delete character at cursor and close up space
  393.      Backspace = move cursor back one space, delete character, and close space
  394.      Ctrl+End = clear from cursor to end of line
  395.      Ctrl+Left, Ctrl+Right = move cursor one word
  396.  
  397.      LineEdit options and examples are on the next page.
  398.  
  399.  
  400.      LineEdit options:
  401.  
  402.      1 = Lower Case
  403.      2 = Upper Case
  404.      1 + 2 = Numerals only
  405.      1 + 2 + 4 = Numerals and numeric punctuation ($,.%-+*/)
  406.      8 = use BIOS to display string (default is DVM)
  407.      32 = Return to BASIC if cursor is past end of string
  408.      64 = Return to BASIC if normal key pressed
  409.      128 = Return to BASIC if extended key (F1 - F10, etc.) is pressed.
  410.               NOTE: if this option is used and an extended key is pressed,
  411.               keycode% returned as 256 + the ASCII code of the extended
  412.               key.  This may be used along with StartEdit and LastEdit
  413.               to trap specified extended key presses.  See examples.
  414.      256 = Return to calling program if ALT key is pressed.  keycode%
  415.               is returned = 256.
  416.      &H4000 = Return to calling program if TAB key is pressed
  417.      &H8000 = Use alternate reverse video cursor instead of the blinking
  418.               hardware cursor.  This option may cause "snow" on CGA monitors.
  419.               The cursor position is indicated by a black character on a
  420.               white background; in insert mode, either the character blinks
  421.               or the background is high intensity, depending on the last call
  422.               to SetBLINK (see VIDEO.DOC).  To preserve compatability with
  423.               future versions of LineEdit, do not use this option with
  424.               option 8.  This version of LineEdit ignores option -32768 if
  425.               option 8 is used.
  426.  
  427.     Use BASIC's OR operator to combine options.
  428.  
  429.     Example 1:
  430.          st$ = "This is the string to be edited              "
  431.                                   ' extra spaces allow for inserted characters
  432.          row% = 5: col% = 10
  433.          options% = 0             ' allow all characters, no fancy stuff
  434.          CALL LineEdit(st$, row%, col%, attr%, options%, keycode%)
  435.  
  436.     Example 2:
  437.          REM $INCLUDE: 'qlib.bi'
  438.          st$ = "This is the string to be edited": row% = 5: col% = 10
  439.          options% = 2 OR 128 ' All text input converted to upper case and
  440.                              ' return to calling program if extended key
  441.                              ' pressed.
  442.                              ' I want to trap F1, which returns the ASCII
  443.                              ' code a% = 59 (see your BASIC manual for
  444.                              ' extended key codes)
  445. 10       CALL LineEdit(st$, row%, col%, attr%, options%, keycode%)
  446.          IF keycode% AND 256 THEN
  447.               a% = keycode% AND 255
  448.               IF a% = 59 THEN ...      ' do F1 stuff
  449.                                        '    else go back to LineEdit:
  450.               CALL StartEdit(LastEdit) ' re-set cursor location
  451.               GOTO 10                  ' and go back to LineEdit
  452.          END IF
  453.  
  454.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  455.  
  456.     Function: keycode% = MaskEdit(mask$, row%, column%, attr%, options%)
  457.     object file: maskedit.obj (getkey.obj, qprint.obj, cursor.obj)
  458.  
  459.          Permits a string with fixed fields and fixed delimiters to be
  460.     edited.  This can be used, for example, to input telephone numbers
  461.     or ZIP codes, or other fixed-field data.  MaskEdit will permit only
  462.     the characters in the input string which are numbers, letters or
  463.     space characters to be edited, skipping over field delimiters.
  464.     MaskEdit will optionally limit input to numerals, or will force
  465.     lower-case input, or upper-case input.  MaskEdit returns to your
  466.     BASIC program when either ESC or ENTER is pressed.  MaskEdit options
  467.     are:
  468.  
  469.         1 = a-z forced to upper case 
  470.         2 = A-Z forced to lower case 
  471.         3 = numerals only allowed
  472.     &H400 = exit if TAB pressed while cursor is in last field of mask$
  473.  
  474.     row% and column% are the location on the screen where you want
  475.     the string to be printed, and attr% is the color attribute to be used.
  476.     You may use the TAB key to jump from one field to the next, and
  477.     shift+TAB jumps the cursor back to the previous field.  You may also
  478.     use the left, right, home and end keys to move the cursor.
  479.  
  480.     Example:
  481.        REM $INCLUDE: 'qlib.bi'
  482.        REM  define the mask for entering telephone numbers
  483.        REM  I'm using CHR$(255) as a non-editable space character
  484.  
  485.        mask$ = "(   )"+CHR$(255)+"   -    "
  486.  
  487.        REM  Note that the mask may contain a default response
  488.        REM  such as mask$ = "(916)" + CHR$(255) + "721-8762"
  489.  
  490.        phone$ = mask$                 ' don't disturb mask$
  491.        options% = 3
  492.        keycode% = MaskEdit(phone$, row%, column%, attr%, options%)
  493.        IF keycode% = 27 THEN          ' ESC was pressed
  494.  
  495.  
  496.  
  497.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  498.  
  499.     Subroutine: MouseStatus(x%, y%, buttons%)
  500.     object file: mstatus.obj (mousedat.obj)
  501.  
  502.          Returns the mouse button status and mouse position.  Buttons% is
  503.     a code which indicates which mouse buttons, if any, are pressed, and
  504.     the PIXEL coordinates of the mouse cursor, even in text modes.
  505.     Pixel coordinates start with (0,0) in the upper left corner.
  506.     X-coordinates are horizontal and Y-coordinates are vertical (increasing
  507.     from top of screen to bottom).  See KeyOrButton to decode buttons%.
  508.     To determine mouse cursor position in terms of text locations, see
  509.     TMouseStatus.
  510.  
  511.     Example:
  512.          CALL MouseStatus(x%, y%, buttons%)
  513.  
  514.  
  515.  
  516.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  517.  
  518.     Function: OuiNon
  519.     object file: ouinon.obj
  520.  
  521.     French language version of YesNo.  Waits for either "O" or "N" to be
  522.     pressed, then returns the ASCII character code of the key pressed.
  523.     The character code returned will be the code for UPPER case "O" or "N",
  524.     regardless of whether the key pressed was upper or lower case.
  525.  
  526.     Example:
  527.          REM $INCLUDE: 'QLIB.BI'
  528.          PRINT "Are you sure? (O/N)"
  529.          REM  ASC("O") = 79, ASC("N") = 78
  530.          IF OuiNon = 78 THEN
  531.                    .         ' instructions for N response
  532.                    .
  533.                    .
  534.               ELSE
  535.                    .         ' instructions for O response
  536.                    .
  537.                    .
  538.          END IF
  539.  
  540.  
  541.  
  542.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  543.  
  544.     Subroutine: ShowMouse
  545.     object file: mouse.obj (mousedat.obj)
  546.  
  547.          ShowMouse makes the mouse cursor visible.
  548.  
  549.     Example:
  550.          CALL ShowMouse
  551.  
  552.  
  553.  
  554.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  555.  
  556.     Subroutine: ShowGMouse
  557.     object file: gmouse.obj (mousedat.obj, $graph.obj)
  558.  
  559.          ShowGMouse makes the alternate graphics mouse cursor visible.
  560.     See GMouse in GRAPHICS.DOC.
  561.  
  562.     Example:
  563.          CALL ShowGMouse
  564.  
  565.  
  566.  
  567.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  568.  
  569.     Function: SiNo
  570.     object file: sino.obj
  571.  
  572.     Spanish language version of YesNo.  Waits for either "S" or "N" to be
  573.     pressed, then returns the ASCII character code of the key pressed.
  574.     The character code returned will be the code for UPPER case "S" or "N",
  575.     regardless of whether the key pressed was upper or lower case.
  576.  
  577.     Example:
  578.          REM $INCLUDE: 'QLIB.BI'
  579.          PRINT "Are you sure? (S/N)"
  580.          REM  ASC("S") = 83, ASC("N") = 78
  581.          IF SiNo = 78 THEN
  582.                    .         ' instructions for N response
  583.                    .
  584.                    .
  585.               ELSE
  586.                    .         ' instructions for S response
  587.                    .
  588.                    .
  589.          END IF
  590.  
  591.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  592.  
  593.     Subroutine: TMouseStatus(col%, row%, buttons%)
  594.     object file: tmstatus.obj
  595.  
  596.     TMouseStatus is similar to MouseStatus, but returns the mouse cursor's
  597.     position as (col%, row%) character coordinates instead of pixel
  598.     coordinates.  Note that most QLIB subroutines use column and row
  599.     coordinates in reverse order (row%, col%) instead of TMouseStatus'
  600.     (col%, row%).  Buttons% is the mouse's button status.  See KeyOrButton
  601.     to decode button status.
  602.  
  603.     Example:
  604.          CALL TMouseStatus(col%, row%, buttons%)
  605.  
  606.  
  607.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  608.  
  609.     Function: keycode% = VertList(VARPTR(a$(0)), row%, col%, choice%)
  610.     object files: vlist.obj (q$menu.obj, m$input.obj, crt.obj, q$qprn.obj,
  611.                              several others)
  612.  
  613.     Vertical list menu system; requires an array of varable-length strings,
  614.     upper left corner coordinates (row%, col%) and starting position
  615.     (choice%).  VertList returns to BASIC when Esc, Enter or an
  616.     optional user-defined exit key is pressed, or when a mouse button is
  617.     pressed.  The keycode of the key pressed is returned as keycode% and
  618.     the menu selection is returned as choice%.  If a mouse button was
  619.     pressed, keycode% = 768 OR [button code].  Button codes are:
  620.  
  621.      1 = left button
  622.      2 = right button
  623.      4 = center button
  624.  
  625.     VertList uses all menu options except option 6 (user-specified
  626.     prompt string).  See MenuOption.  Option 7 enables the selection of
  627.     strings without capital letters.  If the option value is -1, any string
  628.     may be selected.  A character other than a capital letter may be used
  629.     if the option value = ASC(character).
  630.  
  631.     Example 1:
  632.     REM $INCLUDE: 'qlib.bi'
  633.  
  634.     DIM mainmenu$(9)      ' 10 menu strings, 0-9; last string is NUL
  635.     FOR I= 0 TO 9
  636.       READ mainmenu$(I)   ' strings are in a DATA statement
  637.                           ' end of menu string data marked with a NUL string
  638.     NEXT I
  639.     row% = 5: col% = 10: choice% = 0
  640.                           ' "light bar" positioned at mainmenu$(0)
  641.     mm% = VARPTR(mainmenu$(0))
  642.     keycode% = VertList(mm%, row%, col%, choice%)
  643.  
  644.  
  645.     Example 2:
  646.     REM  my list of strings is a list of filenames including the
  647.     REM  "\" and "..\"
  648.     REM  I want to enable the selection of the "..\" and "\" choices.
  649.     CALL MenuOption(7, ASC("\"))   ' enable selection of "\" character
  650.     mm% = VARPTR(filelist$(0))
  651.     keycode% = VertList(mm%, row%. col%, choice%)
  652.     
  653.  
  654.  
  655.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  656.  
  657.     Subroutine: WindowEdit(st$, r0%, c0%, r1%, c1%, attr%, options%, keycode%)
  658.     Subroutine: WStartEdit(start%)
  659.     Function: WLastEdit
  660.     object files: wedit.obj (qprintw.obj(crt.obj, q$qprn.obj, q$clrw.obj),
  661.                              cursor.obj, getkey.obj)
  662.  
  663.          Similar to LineEdit, WindowEdit edits the string st$ in a window on
  664.     a text-mode screen and returns the result to BASIC.  WindowEdit is still
  665.     in the early stages of development; your comments and suggestions will
  666.     influence my development of this subroutine.
  667.  
  668.     WindowEdit differs from LineEdit in that it includes word wrap and
  669.     up/down cursor movement, and varies the length of the string st$, depending
  670.     on text inserted or deleted.  WindowEdit does not yet scroll to allow
  671.     editing strings longer than the window can display (but this is on my
  672.     list of enhancements).  WindowEdit also does not yet use any options%.
  673.     Note that you should use options% = 0 for compatability with future
  674.     versions of WindowEdit.  WStartEdit and WLastEdit are used with
  675.     WindowEdit as StartEdit and LastEdit are used with LineEdit.
  676.  
  677.     Summary of WindowEdit commands:
  678.  
  679.      Enter, Esc = return string to BASIC
  680.      Left, Right, Up, Down arrows = move cursor
  681.      Insert = toggle insert/overstrike modes
  682.      Home = move cursor to start of line
  683.      End = move cursor to end of line
  684.      Delete = delete character at cursor and close up space
  685.      Backspace = move cursor back one space, delete character, and close space
  686.      Ctrl+Left, Ctrl+Right = move cursor one word
  687.  
  688.  
  689.  
  690.  
  691.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  692.  
  693.     Function: YesNo
  694.     object file: yesno.obj
  695.  
  696.          Waits for either "Y" or "N" to be pressed, then returns the ASCII
  697.     character code of the key pressed.  The character code returned will be
  698.     the code for UPPER case "Y" or "N", regardless of whether the key pressed
  699.     was upper or lower case.
  700.  
  701.     Example:
  702.          REM $INCLUDE: 'QLIB.BI'
  703.          PRINT "Are you sure? (Y/N)"
  704.          REM  ASC("Y") = 89, ASC("N") = 78
  705.          IF YesNo = 78 THEN
  706.                    .         ' instructions for N response
  707.                    .
  708.                    .
  709.               ELSE
  710.                    .         ' instructions for Y response
  711.                    .
  712.                    .
  713.          END IF
  714.