home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / baswind8.zip / WINDTOOL.DOC < prev   
Text File  |  1990-09-14  |  89KB  |  3,295 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                  WINDOW TOOLS
  9.  
  10.  
  11.                         Programming 'Toolbox' Routines
  12.  
  13.                                  version 8.0
  14.  
  15.                                    for the
  16.  
  17.                      Microsoft QuickBASIC 4.5 (tm) Compiler
  18.  
  19.                                   Sept 1990
  20.  
  21.                                       by
  22.  
  23.                               James P. Morgan
  24.                               5226 Via Hacienda #115
  25.                               Orlando Fl, 32809
  26.                               USA
  27.                               Compuserve 71121,2006
  28.  
  29.                                      AND
  30.  
  31.                         based on public domain works by
  32.                                   Dave Evers
  33.  
  34.  
  35.                    Copyright (C) 1989,1990 by James P. Morgan
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.                               TABLE OF CONTENTS
  66.  
  67.  
  68.           Overview..................................................... 03
  69.  
  70.           Basic Requirements........................................... 04
  71.  
  72.           Routine Overview............................................. 05
  73.  
  74.           Keyboard Conventions ........................................ 09
  75.  
  76.           Mouse Conventions ........................................... 10
  77.  
  78.           Calling Conventions.......................................... 11
  79.  
  80.  
  81.                POPMENU ................................................ 12
  82.                POPLIST ................................................ 14
  83.                POPDIR ................................................. 15
  84.                TAGLIST ................................................ 16
  85.                TAGDIR ................................................. 17
  86.  
  87.                BARMENU ................................................ 18
  88.                MENU123 ................................................ 19
  89.  
  90.                CALENDAR ............................................... 20
  91.                CALENDR3 ............................................... 21
  92.                KEYCAL ................................................. 22
  93.  
  94.                QUERY .................................................. 23
  95.                CAUTION ................................................ 24
  96.                QUESTION................................................ 25
  97.                WARNING ................................................ 26
  98.  
  99.                ROW25 .................................................. 27
  100.                TITLE .................................................. 28
  101.                FULLMENU ............................................... 29
  102.                WAITTIME ............................................... 30
  103.  
  104.                FASTPRT ................................................ 31
  105.                MAKEWIND ............................................... 32
  106.                SAVESCRN ............................................... 34
  107.                RESTSCRN ............................................... 35
  108.                SAVEWIND ............................................... 36
  109.                RESTWIND ............................................... 37
  110.  
  111.                SCROLL   ............................................... 38
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.                                    Page 01
  125.  
  126.  
  127.  
  128.  
  129.                MMBUTTON ............................................... 39
  130.  
  131.                MMCHECK  ............................................... 40
  132.  
  133.                MMCLICK  ............................................... 41
  134.  
  135.                MMCURSORON ............................................. 42
  136.  
  137.                MMCURSOROFF............................................. 43
  138.  
  139.                MMGETLOC ............................................... 44
  140.  
  141.                MMSETLOC ............................................... 45
  142.  
  143.                MMSETRANGE ............................................. 46
  144.  
  145.        What is a QUADRANT ............................................. 47
  146.  
  147.       Comments and Suggestions ........................................ 48
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.                                    Page 02
  187.  
  188.  
  189.  
  190.           OVERVIEW
  191.           --------
  192.  
  193.           The Window Tool routines are designed and enhanced to perform
  194.           tasks that are common to many programs; and they were created
  195.           to perform these tasks in a manner that will enhance the value
  196.           of the programs they work with. Window Tools were also design-
  197.           ed to be as universal as possible, so that they can be adapted
  198.           easily to work in your programs. They were enhanced to be as
  199.           aesthetically pleasing, to give your programs that commercial
  200.           'look and feel'.
  201.  
  202.           All of these routines use, as a base, the BASWIND package which
  203.           is included in these libraries.  The  routines in BASWIND allow
  204.           for fast screen writing (which is fundamental to all of  these
  205.           procedures);  the ability  to  easily  create a colored 'window'
  206.           on the screen; and to let you save and restore the contents of
  207.           the  screen  so  that you can create 'pop-up' window features in
  208.           your program with a minimum of effort.
  209.  
  210.           The  Window Tools routines build upon these basic functions to
  211.           provide for more 'high-level' applications. A simple call to a
  212.           Window  Tool  procedure, with the appropriate parameters,  will
  213.           enable you to perform relatively complex tasks such as choosing
  214.           a filename from a directory, by simply selecting it from a list.
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.                                    Page 03
  249.  
  250.  
  251.  
  252.           BASIC REQUIREMENTS
  253.           ------------------
  254.  
  255.           All  of  the  BASWIND  and  Window  Tools  routines  require the
  256.           Microsoft QuickBASIC 4.5 Compiler.
  257.  
  258.           You CANNOT use these routines with the  BASIC  or  BASICA  inter-
  259.           preter.  Attempting  to  do so will surely cause your computer to
  260.           become spastic; possibly to the  point  of  damage  to  files  on
  261.           disk.  So  PLEASE  DO  NOT  ATTEMPT  TO  USE THEM WITH THE INTER-
  262.           PRETER.
  263.  
  264.  
  265.           There is basically ONE(1) way to use the routines included in
  266.           this package (for now):
  267.  
  268.  
  269.                 1) In a standalone EXE file created by compiling the
  270.                    main program with the 'BC /O' option; and then linking
  271.                    with the correct WINDQB45 library. Programs created
  272.                    in this manner will be large; but they will be totally
  273.                    self-sufficient.  These routines were NOT meant to be used
  274.                    from within the QuickBASIC environment (at this time)
  275.                    because the QB environment handles arrays differently than
  276.                    it does when a program is compiled as standalone.
  277.  
  278.                    HOWEVER, testing has been done in the QB 4.5 environment
  279.                    with no problems found, so far (for version 7.0 and above).
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.                                    Page 04
  311.  
  312.  
  313.  
  314.           ROUTINE OVERVIEW
  315.           ----------------
  316.  
  317.           The  following  is a brief summary of the function of each of the
  318.           routines contained in the Window Tools package:
  319.  
  320.  
  321.                    FASTPRT - A method of direct-screen writing to replace
  322.                              the relatively slow PRINT statement. Allows
  323.                              you to place a message string at a given row
  324.                              and column using any valid screen attributes.
  325.  
  326.                   MAKEWIND - A routine to create a colored window on the
  327.                              screen, with either no border or a line-
  328.                              graphic border in one of 4 styles; with or
  329.                              without a true  'shadow' underneath; and
  330.                              either immediately appearing on the screen
  331.                              or 'growing' into position.
  332.  
  333.                   SAVESCRN - Saves the contents of the current screen into
  334.                              an array.
  335.  
  336.                   RESTSCRN - Restores the screen from the saved array.
  337.  
  338.                   SAVEWIND - Like SAVESCRN, but instead saves only the
  339.                              screen data from a particular window area;
  340.                              rather than the entire screen. Saves time
  341.                              and memory.
  342.  
  343.                   RESTWIND - Restores the area of the screen saved by
  344.                              SAVEWIND.
  345.  
  346.                     SCROLL - Allows you to scroll a section of the screen
  347.                              either up or down and optionally write a new
  348.                              string into the line created at either the
  349.                              bottom or top, respectively. BIOS dependant.
  350.  
  351.                    POPMENU - Creates a 'pop-up' menu on the screen in a
  352.                              window; allows you to scroll through the
  353.                              menu with a 'select bar', and returns the
  354.                              number of the option selected when [RETURN]
  355.                              is pressed. Really sub-function of POPLIST.
  356.  
  357.                    POPLIST - While POPMENU is a display of several menu
  358.                              items; all on screen at the same time; POP-
  359.                              LIST displays a window with a few items from
  360.                              a list that can be much larger than the on-
  361.                              screen window. You may scroll through the
  362.                              list with the cursor keys, move to the beg-
  363.                              inning or end of the list with HOME and END,
  364.                              respectively; or use the PG UP and PG DN
  365.                              keys to move a 'window-full' at a time.
  366.                              [RETURN] makes the selection or right mouse
  367.                              button click on HI-LITED item.
  368.  
  369.  
  370.  
  371.  
  372.                                    Page 05
  373.  
  374.  
  375.  
  376.                     POPDIR - A special case of the POPLIST routine; where
  377.                              the list displayed is the directory of a disk
  378.                              obtained by specifying a filespec. The filespec
  379.                              may contain the wildcard characters "*" and
  380.                              "?".
  381.  
  382.                    TAGLIST - Where POPLIST is intended to select one value
  383.                              from a list, TAGLIST allows you to 'Tag' one
  384.                              or more items to be returned when [RETURN] is
  385.                              pressed. Items that have been tagged can be
  386.                              'untagged' (de-selected). Click on with mouse.
  387.  
  388.                     TAGDIR - Again, a special case of the TAGLIST routine
  389.                              where the list of items is a directory.
  390.  
  391.                    BARMENU - If you like the user interface of QuickBASIC
  392.                              Version 2/3, you will like this routine. A menu
  393.                              bar across the top serves as the basis for
  394.                              individual 'pull-down' menus from which you
  395.                              can select via the cursor keys or mouse.
  396.  
  397.                    MENU123 - If you prefer the menu style of Lotus 1-2-3,
  398.                              you may find this routine more to your liking
  399.                              with its highlighting of the selected option
  400.                              and the expanded description below.
  401.  
  402.                   CALENDAR - Given a month number and a year number, this
  403.                              routine returns with a calendar in a window
  404.                              for that month. As best as can be determined,
  405.                              this calendar routine allows for leap years
  406.                              and leap centuries correctly; and will provide
  407.                              correct calendars for all years.
  408.  
  409.                   CALENDR3 - As above, this routine creates a calendar in
  410.                              a window for a given month and year. However,
  411.                              this one also provides calendars for the pre-
  412.                              vious and following months.
  413.  
  414.                     KEYCAL - Starting from a month and year, this routine
  415.                              allows you to advance or retreat months and
  416.                              years by means of the cursor keys (in the
  417.                              same fashion as Sidekick).
  418.  
  419.                     QUERY  - Is a general-purpose window handler for such
  420.                              function types as QUESTION/WARNING/CAUTION.
  421.                              The above pseudo QUERY functions are still
  422.                              included for downward compatibility ONLY.
  423.  
  424.                    CAUTION - Creates a yellow 'Caution' window on the
  425.                              screen with message strings that you pass it.
  426.                              You then select whether to Cancel or Continue
  427.                              with the operation you are cautioning against.
  428.                              NOT a true function, based on QUERY function.
  429.  
  430.  
  431.  
  432.  
  433.  
  434.                                    Page 06
  435.  
  436.  
  437.  
  438.                    QUESTION- Allows you to present a user with a question,
  439.                              and get back a YES or NO reply to your question.
  440.                              NOT a true function, based on QUERY function.
  441.  
  442.                    WARNING - A bit more dramatic than CAUTION with its
  443.                              red color and blinking 'WARNING' message;
  444.                              but otherwise works exactly the same.
  445.                              NOT a true function, based on QUERY function.
  446.  
  447.                   FULLMENU - Used when you want to create a full-screen
  448.                              menu with several options requiring more
  449.                              explanation than can be given in POPMENU.
  450.  
  451.                      TITLE - A 'sub-function' of the FULLMENU routine,
  452.                              that places a title bar at the top of the
  453.                              screen.
  454.  
  455.                      ROW25 - Also a spinoff of the FULLMENU routine. This
  456.                              function lets you put a message on the bottom
  457.                              row of the screen framed by flashing charac-
  458.                              ters. Keeps the rest of the screen full of
  459.                              data while prompting the operator.
  460.  
  461.                   WAITTIME - Pass it the number of seconds or fractions
  462.                              thereof and it will pause for that long; re-
  463.                              gardless of processor speed (unlike FOR-
  464.                              NEXT loops).
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.                                    Page 07
  497.  
  498.  
  499.  
  500.                   MMCHECK  - Test for presence of a mouse and initializes it.
  501.  
  502.                   MMCLICK  - Returns the number of times a mouse button has
  503.                              pressed and released, since last time function
  504.                              called.
  505.  
  506.                   MMBUTTON - Returns whether a mouse button is pressed and
  507.                              currently held down.
  508.  
  509.                   MMGETLOC - Returns the current screen location of the mouse
  510.                              cursor.
  511.  
  512.                   MMSETLOC - Moves the mouse cursor to the screen location
  513.                              specified.
  514.  
  515.                MMCURSORON  - Turns on the mouse cursor, by making it visible.
  516.  
  517.                MMCURSOROFF - Turns off the mouse cursor, by making it invisible.
  518.  
  519.                MMSETRANGE  - Restricts the mouses movements to an area of the
  520.                              screen.
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.                                    Page 08
  559.  
  560.  
  561.  
  562.           KEYBOARD CONVENTIONS
  563.           --------------------
  564.  
  565.            The keyboard ,as well as the mouse , may be used to allow you
  566.           to move within the windows, make window selections and page up
  567.           and down.
  568.  
  569.            The keyboard is the primary input device. If an action is made
  570.           with the keyboard, the mouse will 'follow' the keyboards actions.
  571.           In otherwords, the mouse's cursor will re-position to the location
  572.           of the screen cursor, if the keyboard is used to move around the
  573.           screen.
  574.  
  575.            The 'standard' keyboard key press and function are :
  576.  
  577.           keyboard               function that is performed
  578.           --------       -----------------------------------------------------
  579.  
  580.           ENTER          Pressing the ENTER key is the normal way to 'select'
  581.                          an item from a window. ENTER signals that you are
  582.                          through processing this window.
  583.  
  584.           First Letter   For most all windows you may select an items by
  585.                          pressing the key that corresponds to the 'first
  586.                          character' (case sensitive) of the item you may
  587.                          want to select. If there are multiple items that
  588.                          start with the same character, each will be high-
  589.                          lighted in-turn.
  590.  
  591.           CURSOR keys    The CURSOR UP and CURSOR DOWN keys are normally used
  592.                          to move the high-lighted select bar up or down within
  593.                          a window. If there are more items than can be displayed
  594.                          in the window, The CURSOR UP/CURSOR DOWN causes the
  595.                          window selections to 'scroll' into or out of the
  596.                          window. The CURSOR LEFT and CURSOR RIGHT keys are
  597.                          normally used with a horizontal 'bar' type menu. You
  598.                          cursor left or right to position to an item and it is
  599.                          high-lighted. Positioning on a 'bar' item in some cases
  600.                          causes a 'drop-down' window , with additional options,
  601.                          to be displayed. You move the cursor up or down within
  602.                          the 'drop-down' window  and/or cursor left/right to
  603.                          select another 'bar' menu item.
  604.  
  605.          PgUp/PgDn       If a window has more selection items than can be
  606.                          displayed at once, you can page up or page down to see
  607.                          a 'new' window of different selection items.
  608.  
  609.          Home/End        If a window has more selection items than can be
  610.                          displayed at once, you can view the first window of
  611.                          items by pressing Home. To view the last window of
  612.                          items , press the End key.
  613.  
  614.          ESC             Most all windows/menus allow you to 'not select' an
  615.                          option. If you decide that you really do not want to
  616.                          make a selection off the window, then press the ESC
  617.                          key.
  618.  
  619.  
  620.                                    Page 09
  621.  
  622.  
  623.  
  624.           MOUSE CONVENTIONS
  625.           -----------------
  626.  
  627.            The mouse ,as well as the keyboard , may be used to allow you
  628.           to move within the windows, make window selections and page up
  629.           and down.
  630.  
  631.            The keyboard is the primary input device. If an action is made
  632.           with the keyboard, the mouse will 'follow' the keyboards actions.
  633.           In otherwords, the mouse's cursor will re-position to the location
  634.           of the screen cursor, if the keyboard is used to move around the
  635.           screen.
  636.  
  637.            The 'standard' mouse usage and function is :
  638.  
  639.           Mouse                  function that is performed
  640.           --------       -----------------------------------------------------
  641.  
  642.           Click on       Select an item within a window. Clicking on a high-
  643.           high-lighted   lighted window item signals that this item is the
  644.           item           one you want and that you are through processing
  645.                          this window. You may click on an item to 'tag' or
  646.                          'untag' it also. Right button click same as ENTER.
  647.  
  648.           Move Mouse     For most all windows you may move to a new item by
  649.           pointer        moving the mouse cursor, within the window or
  650.                          on a 'bar' menu. Again, for most all windows, you may
  651.                          move the mouse out of a window and back in.
  652.  
  653.           Click on top   If a window has more selection items than can be
  654.           or bottom of   displayed at once, you can page up or page down to
  655.           window frame   see a 'new' window of different selection items.
  656.                          If a 'little arrow (up or down type)' is displayed
  657.                          on the top or bottom in the window frame, you can
  658.                          click on the 'little arrow' to  get a window of
  659.                          different selection items.
  660.  
  661.           click outside  Most all windows/menus allow you to 'not select' an
  662.           window or off  option. If you decide that you really do not want to
  663.           menu 'bar'     make a selection off the window, then click outside
  664.                          the window or off the 'bar' menu (if one displayed).
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.                                    Page 10
  683.  
  684.  
  685.  
  686.           CALLING CONVENTIONS
  687.           -------------------
  688.  
  689.  
  690.           In  all  of the following descriptions, numeric variables MUST be
  691.           integers; either globally defined early in the program  by  means
  692.           of  a  DEFINT statement, or locally at the statement level by the
  693.           integer assignment '%'. The EXCEPTION is for the WAITTIME routine.
  694.           The parameter passed to WAITTIME MUST be a single precision var-
  695.           iable, to allow for fractions of a second.
  696.  
  697.           You  may  also  replace  the variables in the parameter list with
  698.           constants. Strings  must  be  quoted (i.e., "This is a String").
  699.  
  700.           To see how each of these routines would be used in a typical  ap-
  701.           plication  program,  please  see  the  files  on  the disk marked
  702.           DEMO1.BAS and DEMO2.BAS. These are the source code files for  the
  703.           demo  programs  distributed  with BASWIND. DEMO1 consists mainly
  704.           of CALLS to  MAKEWIND,  SAVESCRN,  RESTSCRN,  and  SCROLL.  DEMO2
  705.           includes a complete demo of all/most of the Window Tool Routines.
  706.           Run the DEMO1.EXE and DEMO2.EXE files to see the .BAS compiled
  707.           programs in action. The DEMO programs support a MS compatible mouse
  708.           if one is available.
  709.  
  710.           To support QuickBasic 4.5 DIM syntax : DIM Array ( -x TO +y),
  711.           most ALL routines NOW require an extra parameter, RETURN.CODE%,
  712.           be specified. If you are using BASWIND6 or earlier routines then
  713.           you will have to allow for extra parameter.
  714.  
  715.           Also, to allow for OPTION BASEs other than 0 or 1 , most ALL
  716.           programs 'normalize' their internal array processing AS IF you
  717.           had passed arrays dimensioned as OPTION BASE 1. SO, the value
  718.           returned (menu item number selected) is NOT THE ARRAY ELEMENT
  719.           of your array BUT is a 'normalized' Nth element. To convert to
  720.           an ACTUAL array you would do something like:
  721.  
  722.           Array.element.value=Array(UBOUND(Array)+Win.Selection%-1)
  723.  
  724.  
  725.  
  726.           The routines that save/restore copy of screen images NOW EXPECT
  727.           the stored images to be in FAR memory (DYNAMIC), SO , BOTH
  728.           the memory segment and memory offset address MUST be passed,
  729.           (even if they ARE IN BASICs DGROUP (near memory)).
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.                                    Page 11
  745.  
  746.  
  747.  
  748.           Routine: POPMENU
  749.                    -------
  750.  
  751.           Purpose: Provides a menu window from which  you may make choices by
  752.                    moving the 'select bar' by means of the cursor keys or mouse.
  753.                    All the menu items to choose from are displayed at once.
  754.  
  755.  
  756.           CALL POPMENU(HEADER.TITLE$,NUMBER.ITEMS%,ITEMS$(),_
  757.                         TYPE.FRAME%,FOREGROUND%,BACKGROUND%,_
  758.                         HEADER.FORE%,HEADER.BACK%,QUADRANT$,_
  759.                         SHADOW%,SELECTION%,RETURN.CODE%)
  760.  
  761.           Passed:
  762.  
  763.            HEADER.TITLE$ - A message that appears in the top row of the window.
  764.                            The  length of the header  will determine the
  765.                            width of the menu window unless a choice des-
  766.                            cription in array ITEMS$() is longer.
  767.  
  768.            NUMBER.ITEMS% - The number of items to choose from in the  menu.
  769.  
  770.                 ITEMS$() - An array with the individual menu descriptions
  771.                            for each choice.
  772.  
  773.              TYPE.FRAME% - The type of frame that will go around the window:
  774.  
  775.                                 0 - No frame. Just a border of spaces
  776.                                     of the background color.
  777.  
  778.                                 1 - A single line frame.
  779.  
  780.                                 2 - A double line frame.
  781.  
  782.                                 3 - A single horizontal line,
  783.                                     double vertical line frame.
  784.  
  785.                                 4 - A double horizontal line,
  786.                                     single vertical line frame.
  787.  
  788.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  789.                            to 15 (BRIGHT WHITE). This will be the color
  790.                            of the frame.
  791.  
  792.              BACKGROUND% - The background color (the color of the window).
  793.                            Can range from 0 (BLACK) to 7 (WHITE).
  794.  
  795.             HEADER.FORE% - The foreground color of the Header.
  796.  
  797.             HEADER.BACK% - The background color of the Header.
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.                                    Page 12
  807.  
  808.  
  809.  
  810.                QUADRANT$ - The quadrant or row:column co-ordinates
  811.                            of where the window will be on the screen.
  812.  
  813.                              (see description of QUADRANT, page 47)
  814.  
  815.                  SHADOW% - A switch to determine if the menu window will
  816.                            have a shadow underneath. Any non-zero value
  817.                            will produce a shadow.
  818.  
  819.  
  820.               SELECTION% - The number of the item to be initially high-lighted.
  821.                            This allow you to select the initial 'default' menu
  822.                            selection item presented to the user.
  823.  
  824.  
  825.           Returns:
  826.  
  827.               SELECTION% - The number of the item selected. This can be
  828.                            used in a  SELECT CASE  .... statement to route
  829.                            program flow to the desired section.
  830.  
  831.                              -1  -   If [ESC] is pressed or mouse clicked
  832.                                     outside the menu window.
  833.  
  834.             RETURN.CODE% -
  835.                              -1  -   If [ESC] is pressed or mouse clicked
  836.                                     outside the menu window.
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.                                    Page 13
  869.  
  870.           Routine: POPLIST
  871.                    -------
  872.  
  873.           Purpose: To display a list of items from which to select one.
  874.                    If there are more items in the list than can fit within
  875.                    the window, you can scroll the list up or down, using
  876.                    the cursor keys or the mouse.
  877.  
  878.           CALL POPLIST(HEADER.TITLE$,SHOWITEMS%,NUMBER.ITEMS%,_
  879.                        ITEMS$(),FOREGROUND%,BACKGROUND%,_
  880.                        HEADER.FORE%,HEADER.BACK%,QUADRANT$,_
  881.                        SHADOW%,SELECTION%,RETURN.CODE%)
  882.  
  883.           Passed:
  884.  
  885.            HEADER.TITLE$ -  A message that appears in the top row of the window.
  886.                             The  length of the header  will determine the
  887.                             width of the menu window unless a choice des-
  888.                             cription in array ITEMS$() is longer.
  889.  
  890.               SHOWITEMS% - The number of items to display in the list window
  891.                            at one time, in case there are more than can be
  892.                            displayed in the window at one time.
  893.  
  894.            NUMBER.ITEMS% - The total number of items in the list array.
  895.  
  896.                 ITEMS$() - A description for each item in the list array,
  897.                            from which to choose.
  898.  
  899.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  900.                            to 15 (BRIGHT WHITE). This will be the color of
  901.                            the frame.
  902.  
  903.              BACKGROUND% - The background color (the color of the window).
  904.                            Can range from 0 (BLACK) to 7 (WHITE).
  905.  
  906.             HEADER.FORE% - The foreground color of the Header.
  907.  
  908.             HEADER.BACK% - The background color of the Header.
  909.  
  910.                QUADRANT$ - The quadrant or row:column co-ordinates
  911.                            of where the window will be on the screen.
  912.  
  913.                              (see description of QUADRANT, page 47)
  914.  
  915.                  SHADOW% - A switch to determine if list window will
  916.                            have a black shadow underneath. Any non-zero
  917.                            value will produce a shadow.
  918.  
  919.               SELECTION% - The number of the item to be initially high-lighted.
  920.                            This allow you to select the initial 'default' menu
  921.                            selection item presented to the user.
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.                                    Page 14
  931.  
  932.  
  933.  
  934.  
  935.           Returns:
  936.  
  937.               SELECTION% - The number of the item  selected. The actual
  938.                            list item selected can be determined by
  939.                            LIST$(SELECTION%).
  940.  
  941.                             -1  - If [ESC] is pressed or mouse clicked
  942.                                   outside window.
  943.  
  944.             RETURN.CODE% -
  945.                             -1  - If [ESC] is pressed or mouse clicked
  946.                                   outside the menu window.
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.                                    Page 14a
  994.  
  995.  
  996.  
  997.           Routine: POPDIR
  998.                    ------
  999.  
  1000.           Purpose: Produce a window on the screen containing a list of files,
  1001.                    using the filespec in SEARCH$. The filespec may contain
  1002.                    the wildcards '*' and '?'. Select one file from the list
  1003.                    using the cursor keys or mouse.
  1004.  
  1005.  
  1006.           CALL POPDIR(SEARCH$,SHOWITEMS%,FOREGROUND%,BACKGROUND%,_
  1007.                       HEADER.FORE%,HEADER.BACK%,_
  1008.                       QUADRANT$,SHADOW%,NUMFILES%,SELECTFILE$,RETURN.CODE%)
  1009.  
  1010.           Passed:
  1011.  
  1012.                  SEARCH$ - The file specification used to determine
  1013.                            which files will be displayed in the
  1014.                            directory window. May contain the wildcard
  1015.                            characters "*" and "?". For example, "*.*"
  1016.                            or "BAS?????.TXT".
  1017.  
  1018.               SHOWITEMS% - The number of items to display in the
  1019.                            directory window at one time, in case there
  1020.                            are more than can be displayed in the window
  1021.                            at one time.
  1022.  
  1023.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  1024.                            to 15 (BRIGHT WHITE). This will be the color of
  1025.                            the frame.
  1026.  
  1027.              BACKGROUND% - The background color (the color of the window).
  1028.                             Can range from 0 (BLACK) to 7 (WHITE).
  1029.  
  1030.             HEADER.FORE% - The foreground color of the Header.
  1031.  
  1032.             HEADER.BACK% - The background color of the Header.
  1033.  
  1034.                QUADRANT$ - The quadrant or row:column co-ordinates
  1035.                            of where the window will be, on the screen
  1036.  
  1037.                              (see description of QUADRANT, page 47)
  1038.  
  1039.                  SHADOW% - A switch to determine if list window will
  1040.                            have a black shadow underneath. Any non-zero
  1041.                            value will produce a shadow.
  1042.  
  1043.           Returns:
  1044.  
  1045.                NUMFILES% - The number of files that match the  SEARCH$
  1046.                            filespec.
  1047.  
  1048.              SELECTFILE$ - The full filename of the  file selected.
  1049.  
  1050.             RETURN.CODE% -
  1051.                             -1  - If [ESC] is pressed or mouse clicked
  1052.                                   outside the menu window.
  1053.  
  1054.           NOTE: The header for this routine consists of the SEARCH$ string.
  1055.  
  1056.                                    Page 15
  1057.  
  1058.           Routine: TAGLIST
  1059.                    -------
  1060.  
  1061.           Purpose: Produces a window on the screen with a list of items
  1062.                    as in POPLIST; only instead of returning only a single
  1063.                    selection from the list, allows you to 'tag' a number
  1064.                    of items using the 'Ins' key or 'untag' items with the
  1065.                    'Del' key. You may click on an item to tag/untag it also.
  1066.  
  1067.           CALL TAGLIST(HEADER.TITLE$,SHOWITEMS%,NUMBER.ITEMS%,_
  1068.                        NUMTAGGED%,ITEMS$(),TAGITEMS%(),FOREGROUND%,_
  1069.                        BACKGROUND%,HEADER.FORE%,HEADER.BACK%,_
  1070.                        QUADRANT$,SHADOW%,RETURN.CODE%)
  1071.  
  1072.           Passed:
  1073.  
  1074.            HEADER.TITLE$ - A message that appears in the top row of the window.
  1075.                            The length of the header  will determine the
  1076.                            width of the menu window unless a choice des-
  1077.                            cription in array ITEMS$() is longer.
  1078.  
  1079.               SHOWITEMS% - The number of items to display in the window
  1080.                            window at one time, in case there are more
  1081.                            items than can be displayed in the window
  1082.                            at one time.
  1083.  
  1084.            NUMBER.ITEMS% - The total number of items in the list array.
  1085.  
  1086.                 ITEMS$() - A description for each item in the list array,
  1087.                            from which to choose.
  1088.  
  1089.  
  1090.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  1091.                            to 15 (BRIGHT WHITE). This will be the color of
  1092.                            the frame.
  1093.  
  1094.              BACKGROUND% - The background color (the color of the window).
  1095.                            Can range from 0 (BLACK) to 7 (WHITE).
  1096.  
  1097.             HEADER.FORE% - The foreground color of the Header.
  1098.  
  1099.             HEADER.BACK% - The background color of the Header.
  1100.  
  1101.                QUADRANT$ - The quadrant or row:column co-ordinates
  1102.                            of where the window will be, on the screen.
  1103.  
  1104.                             (see description of QUADRANT, page 47)
  1105.  
  1106.                  SHADOW% - A switch to determine if list window will
  1107.                            have a black shadow underneath. Any non-zero
  1108.                            value will produce a shadow.
  1109.  
  1110.               NUMTAGGED% - The maximum number of items allowed to be tagged
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.                                    Page 16
  1118.  
  1119.  
  1120.           Returns:
  1121.  
  1122.               NUMTAGGED% - The total number of tagged items.
  1123.  
  1124.              TAGITEMS%() - An array holding the element numbers of the
  1125.                            tagged items.
  1126.  
  1127.             RETURN.CODE% -
  1128.                             -1  - If [ESC] is pressed or mouse clicked
  1129.                                   outside the menu window.
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.                                    Page 16a
  1180.  
  1181.  
  1182.  
  1183.           Routine: TAGDIR
  1184.                    ------
  1185.  
  1186.           Purpose: Produce a window on the screen containing a list of files,
  1187.                    using the filespec in SEARCH$. The filespec may contain
  1188.                    the wildcards '*' and '?'. Instead of returning only a
  1189.                    single selection from the list, you to 'tag' a number
  1190.                    of items using the 'Ins' key or 'untag' items with the
  1191.                    'Del' key. You may also click on an item to tag/untag it.
  1192.  
  1193.  
  1194.           CALL TAGDIR(SEARCH$,SHOWITEMS%,FOREGROUND%,BACKGROUND%,_
  1195.                       HEADER.FORE%,HEADER.BACK%,QUADRANT$,_
  1196.                       SHADOW%,NUMTAGGED%,TAG$()$,RETURN.CODE%)
  1197.  
  1198.           Passed:
  1199.  
  1200.                  SEARCH$ - The file specification used to determine
  1201.                            which files will be displayed in the
  1202.                            directory window. May contain the wildcard
  1203.                            characters "*" and "?". For example, "*.*"
  1204.                            or "BAS?????.TXT".
  1205.  
  1206.               SHOWITEMS% - The number of items to display in the
  1207.                            directory window at one time, in case there
  1208.                            are more than can be displayed in the window
  1209.                            at one time.
  1210.  
  1211.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  1212.                            to 15 (BRIGHT WHITE). This will be the color of
  1213.                            the frame.
  1214.  
  1215.              BACKGROUND% - The background color (the color of the window).
  1216.                            Can range from 0 (BLACK) to 7 (WHITE).
  1217.  
  1218.             HEADER.FORE% - The foreground color of the Header.
  1219.  
  1220.             HEADER.BACK% - The background color of the Header.
  1221.  
  1222.                QUADRANT$ - The quadrant or row:column co-ordinates
  1223.                            of where the window will be, on the screen
  1224.  
  1225.                             (see description of QUADRANT, page 47)
  1226.  
  1227.                  SHADOW% - A switch to determine if list window will
  1228.                            have a black shadow underneath. Any non-zero
  1229.                            value will produce a shadow.
  1230.  
  1231.               NUMTAGGED% - The maximum number of filenames that can be tagged.
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.                                    Page 17
  1243.  
  1244.  
  1245.  
  1246.           Returns:
  1247.  
  1248.               NUMTAGGED% - The number of filenames that were tagged.
  1249.  
  1250.                   TAG()$ - An array containing the full filenames of the
  1251.                            files tagged.
  1252.             RETURN.CODE% -
  1253.                             -1  - If [ESC] is pressed or mouse clicked
  1254.                                   outside the menu window.
  1255.  
  1256.  
  1257.  
  1258.           NOTE: The header for the window consists of the  SEARCH$ string.
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.                                    Page 17a
  1306.  
  1307.  
  1308.           Routine: BARMENU
  1309.                    -------
  1310.  
  1311.           Purpose: Produces a display similar to the editing screen of
  1312.                    QuickBASIC with a bar across the top and 'pull-down'
  1313.                    menus for each selection.
  1314.  
  1315.           CALL BARMENU(HEADER.TITLE$,FOREGROUND%,BACKGROUND%,_
  1316.                        BLKSIZE%,BLKNUM%,MAXSIZE%(), MAXITEMS%(),ITEMS$(),_
  1317.                        MENUSLCT%,SELECTION%,RETURN.CODE%)
  1318.  
  1319.           Passed:
  1320.  
  1321.            HEADER.TITLE$ - The Menu Headings that will be placed on the
  1322.                            second screen line (to allow for a screen border
  1323.                            if desired).
  1324.  
  1325.              FOREGROUND% - The foreground color of the HEADER.TITLE$ string.
  1326.  
  1327.              BACKGROUND% - The background color of the HEADER.TITLE$ string.
  1328.  
  1329.                 BLKSIZE% - The HEADER.TITLE$ string is divided into blocks
  1330.                            of fixed size, which will be highlighted as each
  1331.                            is selected and the appropriate menu  'drops down'
  1332.                            beneath it. BLKSIZE% sets the size of these blocks.
  1333.  
  1334.                  BLKNUM% - The number of fixed blocks of BLKSIZE% that are
  1335.                            present in HEADER.TITLE$.
  1336.  
  1337.               MAXSIZE%() - An array with one element for each menu that will
  1338.                            appear (i.e., BLKNUM%). This array element holds
  1339.                            the maximum length of the  items contained in the
  1340.                            corresponding menu. HOWEVER, with BASWIND7, this
  1341.                            array is NOT really effective, as BASWIND7 looks
  1342.                            at ALL the ITEMS$() and adjusts the window size.
  1343.  
  1344.              MAXITEMS%() - An array with one element per menu, holding the
  1345.                            number of items in each corresponding menu.
  1346.  
  1347.                 ITEMS$() - A two-dimensional array (i.e. ITEMS$(1,1)
  1348.                            holding the actual menu item description.
  1349.                            The first dimension holds the menu number, and
  1350.                            the second holds the item number, within a
  1351.                            menu. Thus, ITEMS$(1,1) would be the first
  1352.                            item in Menu #1; and ITEMS$(5,10) would be
  1353.                            the 10th item in Menu #5 (depending on your
  1354.                            OPTION BASE or DIM statement).
  1355.  
  1356.               SELECTION% - The number of the item to be initially high-lighted.
  1357.                            This allow you to select the initial 'default' menu
  1358.                            selection item presented to the user.
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.                                    Page 18
  1368.  
  1369.  
  1370.  
  1371.           Returns:
  1372.  
  1373.                MENUSLCT% - The menu number,  of the menu selected.
  1374.  
  1375.               SELECTION% - The item number,  within the menu selected.
  1376.  
  1377.                             -1  - If ESC pressed or mouse clicked outside
  1378.                                    menu window.
  1379.  
  1380.             RETURN.CODE% -
  1381.                             -1  - If [ESC] is pressed or mouse clicked
  1382.                                   outside the menu window.
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.                                    Page 18a
  1431.  
  1432.  
  1433.  
  1434.           Routine: MENU123
  1435.                    -------
  1436.  
  1437.           Purpose: Produces two-line menus,  similar to those used with
  1438.                    LOTUS 1-2-3.
  1439.  
  1440.  
  1441.           CALL MENU123(HEADER.TITLE$,ROW%,FOREGROUND%,BACKGROUND%,_
  1442.                        NUMBER.ITEMS%,ITEMS$(),SELECTION%,RETURN.CODE%)
  1443.  
  1444.           Passed:
  1445.  
  1446.            HEADER.TITLE$ - A description the top menu line; from
  1447.                            which selection is made. The individual
  1448.                            names in the HEADER.TITLE$ string must be
  1449.                            separated by at least one space.
  1450.  
  1451.                     ROW% - The screen row on  which the menu is to appear.
  1452.                            This allows  you to place the menu on either the
  1453.                            top or bottom of the screen.
  1454.  
  1455.              FOREGROUND% - The foreground color of the HEADER.TITLE$ and
  1456.                            the Description Line under it.
  1457.  
  1458.              BACKGROUND% - The background color of the HEADER.TITLE$ and
  1459.                            the Description Line under it.
  1460.  
  1461.            NUMBER.ITEMS% - The number of individual names within the
  1462.                            HEADER.TITLE$.
  1463.  
  1464.                 ITEMS$() - An array of descriptions, one for each selection
  1465.                            item in the HEADER.TITLE$.
  1466.  
  1467.               SELECTION% - The number of the item to be initially high-lighted.
  1468.                            This allow you to select the initial 'default' menu
  1469.                            selection item presented to the user.
  1470.  
  1471.  
  1472.           Returns:
  1473.  
  1474.               SELECTION% - The number of the item selected.
  1475.  
  1476.  
  1477.                             -1  - If ESC pressed or mouse clicked off menu.
  1478.  
  1479.             RETURN.CODE% -
  1480.                             -1  - If [ESC] is pressed or mouse clicked
  1481.                                   outside the menu window.
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.                                    Page 19
  1493.  
  1494.  
  1495.  
  1496.           Routine: CALENDAR
  1497.                    --------
  1498.  
  1499.           Purpose: Displays a calendar for the month and year desired.
  1500.  
  1501.  
  1502.          CALL CALENDAR(MONTH%,YEAR%,QUADRANT$,FOREGROUND%,BACKGROUND%,SHADOW%,_
  1503.                        RETURN.CODE%)
  1504.  
  1505.           Passed:
  1506.  
  1507.                   MONTH% - The number of the month desired.
  1508.  
  1509.                    YEAR% - The year in 4 digit format; that is, 1986,1987 etc.
  1510.  
  1511.                QUADRANT$ - The quadrant or row:column co-ordinates
  1512.                            of where the window will be, on the screen
  1513.  
  1514.                            (see description of QUADRANT, page 47)
  1515.  
  1516.              FOREGROUND% - The foreground color; ranging from 0
  1517.                              (BLACK) to 15 (BRIGHT WHITE). This
  1518.                              will be the color of the frame.
  1519.  
  1520.              BACKGROUND% - The background color (the color of the
  1521.                              window). Can range from 0 (BLACK) to
  1522.                              7 (WHITE).
  1523.  
  1524.                  SHADOW% - A switch to determine if list window will
  1525.                            have a black shadow underneath. Any non-zero
  1526.                            value will produce a shadow.
  1527.  
  1528.  
  1529.            Returns:
  1530.  
  1531.  
  1532.             RETURN.CODE% -
  1533.  
  1534.                            No returned parameters.
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.              NOTE:   The calendar routines do no error checking, so for
  1547.                      proper results, you must insure that month and years
  1548.                      fall within proper ranges.
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.                                    Page 20
  1555.  
  1556.  
  1557.  
  1558.           Routine: CALENDR3
  1559.                    --------
  1560.  
  1561.           Purpose: Displays a calendar for the month and year desired and also
  1562.                    for the previous and following month.
  1563.  
  1564.  
  1565.           CALL CALENDR3(MONTH%,YEAR%,ROW%,FOREGROUND%,BACKGROUND%,SHADOW%,_
  1566.                         RETURN.CODE%)
  1567.  
  1568.           Passed:
  1569.  
  1570.                   MONTH% - The number of the month desired.
  1571.  
  1572.                    YEAR% - The year in 4 digit format; that is, 1986,1987 etc.
  1573.  
  1574.                     ROW% - The row that the 3 calendars will be displayed on.
  1575.                            Since the 3 calendars produced by this routine
  1576.                            take up nearly the entire width of the screen,
  1577.                            there is no need to specify column parameter
  1578.  
  1579.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  1580.                            to 15 (BRIGHT WHITE). This will be the color of
  1581.                            the frame.
  1582.  
  1583.              BACKGROUND% - The background color (the color of the window).
  1584.                            Can range from 0 (BLACK) to 7 (WHITE).
  1585.  
  1586.                  SHADOW% - A switch to determine if list window will
  1587.                            have a black shadow underneath. Any non-zero
  1588.                            value will produce a shadow.
  1589.  
  1590.            Returns:
  1591.  
  1592.             RETURN.CODE% -
  1593.                             No returned parameters.
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.              NOTE:   The calendar routines do no error checking, so for
  1613.                      proper results, you must insure that month and years
  1614.                      fall within proper ranges.
  1615.  
  1616.                                    Page 21
  1617.  
  1618.  
  1619.  
  1620.           Routine: KEYCAL
  1621.                    ------
  1622.  
  1623.           Purpose: Display a calendar for the month and year desired.
  1624.                    However, using the cursor keys, you may advance or
  1625.                    back up months and years automatically.
  1626.  
  1627.  
  1628.           CALL KEYCAL(MONTH%,YEAR%,QUADRANT$,FOREGROUND%,BACKGROUND%,SHADOW%,_
  1629.                       RETURN.CODE%)
  1630.  
  1631.           Passed:
  1632.  
  1633.                   MONTH% - The number of the month desired.
  1634.  
  1635.                    YEAR% - The year in 4 digit format; that is, 1986,1987 etc.
  1636.  
  1637.                QUADRANT$ - The quadrant or row:column co-ordinates
  1638.                            of where the window will be, on the screen
  1639.  
  1640.                            (see description of QUADRANT, page 47)
  1641.  
  1642.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  1643.                            to 15 (BRIGHT WHITE). This will be the color of
  1644.                            the frame.
  1645.  
  1646.              BACKGROUND% - The background color (the color of the window).
  1647.                            Can range from 0 (BLACK) to 7 (WHITE).
  1648.  
  1649.                  SHADOW% - A switch to determine if list window will
  1650.                            have a black shadow underneath. Any non-zero
  1651.                            will produce a shadow.
  1652.  
  1653.  
  1654.  
  1655.           Returns:
  1656.  
  1657.             RETURN.CODE% -
  1658.                            No returned parameters.
  1659.  
  1660.                            However, you may use the cursor keys
  1661.                            to vary the calendar displayed as  follows:
  1662.  
  1663.                               UP ARROW    - Increment Year
  1664.  
  1665.                               DOWN ARROW  - Decrement Year
  1666.  
  1667.                               RIGHT ARROW - Increment Month
  1668.  
  1669.                               LEFT ARROW  - Decrement Month
  1670.  
  1671.                               You may exit the routine by pressing
  1672.                               either RETURN or ESCAPE.
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.                                    Page 22
  1679.  
  1680.  
  1681.           Routine: QUERY
  1682.                    -----
  1683.  
  1684.           Purpose: Allow a user to make a YES/NO or STOP/GO type of decision
  1685.                   based on a 'prompt', with supporting messages.
  1686.  
  1687.           CALL QUERY(NUMBER.ITEMS%,ITEMS$(),QUADRANT$,HEADER.TITLE$,_
  1688.                      LEFT.BUTTON.MSG$,LEFT.BUTTON.REPLY$,_
  1689.                      RIGHT.BUTTON.MSG$,RIGHT.BUTTON.REPLY$,_
  1690.                      QUERY.TYPE%,SELECTION%)
  1691.  
  1692.           Passed:
  1693.  
  1694.            NUMBER.ITEMS% - The number of lines of message data to appear in
  1695.                            the QUERY window. Allow for any blank lines
  1696.                            you may want.
  1697.  
  1698.                 ITEMS$() - The array of the text message data to appear in
  1699.                            the window. You must provide null strings ("")
  1700.                            for any blank lines
  1701.  
  1702.                QUADRANT$ - The quadrant or row:column co-ordinates
  1703.                            of where the window will be, on the screen
  1704.  
  1705.                            (see description of QUADRANT, page 47)
  1706.  
  1707.           HEADER.TITLE$  - A message that reflects the main reason for display-
  1708.                            ing this QUERY window.
  1709.  
  1710.         LEFT.BUTTON.MSG$ - The QUERY prompt that you want to appear in the left
  1711.                            window 'button', such as "YES"
  1712.  
  1713.       LEFT.BUTTON.REPLY$ - The valid allowable user keyboard responses to
  1714.                            select this option. For example: for a YES reply you
  1715.                            would specify "Yy" (to allow for upper/lower case)
  1716.  
  1717.        RIGHT.BUTTON.MSG$ - The QUERY prompt you want to appear in the right
  1718.                            window 'button', such as "NO"
  1719.  
  1720.      RIGHT.BUTTON.REPLY$ - The valid allowable user keyboard responses to
  1721.                            select this option. For example: for a NO  reply you
  1722.                            would specify "Nn" (to allow for upper/lower case)
  1723.  
  1724.             QUERY.TYPE%  - The type of QUERY window to be displayed, as follows:
  1725.  
  1726.                               0 - CAUTION/QUESTION type window
  1727.                               1 - WARNING type window
  1728.  
  1729.               SELECTION% - The number of the item to be initially high-lighted.
  1730.                            This allow you to select the initial 'default'
  1731.                            dialog button presented to the user.
  1732.  
  1733.           Returns:
  1734.  
  1735.               SELECTION% - A  0 or 1, indicating selection as follows:
  1736.  
  1737.                                   0 - left window 'button' selected
  1738.                                   1 - right window 'button' selected
  1739.                                  -1 - ESC key was pressed OR mouse clicked
  1740.                                       outside window.
  1741.  
  1742.                                    Page 23
  1743.  
  1744.  
  1745.  
  1746.           Routine: CAUTION
  1747.                    -------
  1748.  
  1749.           Purpose: Produces a yellow (or brown, depending on your monitor)
  1750.                    Caution window with given text messages, allowing the
  1751.                    user to either Cancel or Continue with the operation at
  1752.                    hand. The CAUTION window is now only a special case of the
  1753.                    QUERY window function.
  1754.  
  1755.           CALL CAUTION(NUMBER.ITEMS%,ITEMS$(),QUADRANT$,SELECTION%)
  1756.  
  1757.           Passed:
  1758.  
  1759.            NUMBER.ITEMS% - The number of lines of message data to appear in
  1760.                            the CAUTION window. Allow for any blank lines
  1761.                            you may want.
  1762.  
  1763.                 ITEMS$() - The array of the text message data to appear in
  1764.                            the window. You must provide null strings ("")
  1765.                            for any blank lines
  1766.  
  1767.                QUADRANT$ - The quadrant or row:column co-ordinates
  1768.                            of where the window will be, on the screen
  1769.  
  1770.                            (see description of QUADRANT, page 47)
  1771.  
  1772.               SELECTION% - The number of the item to be initially high-lighted.
  1773.                            This allow you to select the initial 'default'
  1774.                            dialog button  presented to the user.
  1775.  
  1776.           Returns:
  1777.  
  1778.               SELECTION% - A  0 or 1, indicating selection as follows:
  1779.  
  1780.                                   0 - CANCEL selected.
  1781.  
  1782.                                   1 - CONTINUE selected.
  1783.  
  1784.                                  -1 - ESC key was pressed OR mouse clicked
  1785.                                       outside window.
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.                                    Page 24
  1805.  
  1806.  
  1807.  
  1808.           Routine: QUESTION
  1809.                    --------
  1810.  
  1811.           Purpose: Produces a yellow (or brown, depending on your monitor)
  1812.                    Question window with given text messages, allowing the
  1813.                    user to answer either Yes or No to the question.
  1814.                    The QUESTION window is now only a special case of the
  1815.                    QUERY window function.
  1816.  
  1817.  
  1818.           CALL QUESTION (NUMBER.ITEMS%,ITEMS$(),QUADRANT$,SELECTION%)
  1819.  
  1820.           Passed:
  1821.  
  1822.            NUMBER.ITEMS% - The number of lines of message data to appear in
  1823.                            the QUESTION window. Allow for any blank lines
  1824.                            you may want.
  1825.  
  1826.                 ITEMS$() - The array of the text message data to appear in
  1827.                            the window. You must provide null strings ("")
  1828.                            for any blank lines
  1829.  
  1830.                QUADRANT$ - The quadrant or row:column co-ordinates
  1831.                            of where the window will be, on the screen
  1832.  
  1833.                            (see description of QUADRANT, page 47)
  1834.  
  1835.               SELECTION% - The number of the item to be initially high-lighted.
  1836.                            This allow you to select the initial 'default'
  1837.                            dialog button presented to the user.
  1838.  
  1839.           Returns:
  1840.  
  1841.               SELECTION% - A  0 or 1, indicating selection as follows:
  1842.  
  1843.                                   0 - NO     selected.
  1844.  
  1845.                                   1 - YES    selected.
  1846.  
  1847.                                  -1 - ESC key was pressed OR mouse clicked
  1848.                                       outside window.
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.                                    Page 25
  1867.  
  1868.  
  1869.  
  1870.           Routine: WARNING
  1871.                    -------
  1872.  
  1873.           Purpose: Similar to CAUTION above, but more dramatic with its
  1874.                    red color and flashing "WARNING" message.
  1875.                    The WARNING window is now only a special case of the
  1876.                    QUERY window function.
  1877.  
  1878.  
  1879.           CALL WARNING(NUMBER.ITEMS%,ITEMS$(),QUADRANT$,SELECTION%)
  1880.  
  1881.           Passed:
  1882.  
  1883.            NUMBER.ITEMS% - The number of lines of message data to appear in
  1884.                            the WARNING  window. Allow for any blank lines
  1885.                            you may want.
  1886.  
  1887.                 ITEMS$() - The array of the text message data to appear in
  1888.                            the window. You must provide null strings ("")
  1889.                            for any blank lines
  1890.  
  1891.                QUADRANT$ - The quadrant or row:column co-ordinates
  1892.                            of where the window will be, on the screen
  1893.  
  1894.                            (see description of QUADRANT, page 47)
  1895.  
  1896.               SELECTION% - The number of the item to be initially high-lighted.
  1897.                            This allow you to select the initial 'default'
  1898.                            dialog button presented to the user.
  1899.  
  1900.  
  1901.           Returns:
  1902.  
  1903.               SELECTION% - A  0 or 1, indicating selection as follows:
  1904.  
  1905.                                   0 - CANCEL selected.
  1906.  
  1907.                                   1 - CONTINUE selected.
  1908.  
  1909.                                  -1 - ESC key was pressed OR mouse clicked
  1910.                                       outside window.
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.                                    Page 26
  1929.  
  1930.  
  1931.  
  1932.           Routine: ROW25
  1933.                    -----
  1934.  
  1935.           Purpose: Produces a message centered on row 25 of the screen.
  1936.  
  1937.  
  1938.           CALL ROW25(HEADER.TITLE$,RETURN.CODE%)
  1939.  
  1940.           Passed:
  1941.  
  1942.            HEADER.TITLE$ - A message that is to be placed on Row 25 of
  1943.                            the screen. This string must be of length 72
  1944.                            or less for proper display.
  1945.  
  1946.  
  1947.  
  1948.           Returns:
  1949.  
  1950.             RETURN.CODE% -
  1951.                            No parameters returned.
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.            NOTE:  The string in HEADER.TITLE$ displayed centered  on Row 25
  1987.                    bracketed by flashing highlights.
  1988.  
  1989.  
  1990.                                   Page 27
  1991.  
  1992.  
  1993.  
  1994.           Routine: TITLE
  1995.                    -----
  1996.  
  1997.           Purpose: Produces a message centered in a Title Block.
  1998.  
  1999.  
  2000.           CALL TITLE(HEADER.TITLE$,RETURN.CODE%)
  2001.  
  2002.           Passed:
  2003.  
  2004.             HEADER.TITLE$ - A message that is to be used to title the screen.
  2005.  
  2006.  
  2007.  
  2008.           Returns:
  2009.  
  2010.             RETURN.CODE% -
  2011.  
  2012.                            No parameters returned
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.          NOTE:   The HEADER.TITLE$ displayed in a  Title Bar at the top
  2049.                  of the screen.
  2050.  
  2051.  
  2052.                                    Page 28
  2053.  
  2054.  
  2055.  
  2056.           Routine: FULLMENU
  2057.                    --------
  2058.  
  2059.           Purpose: Produces a full screen menu with choices selected by
  2060.                    pressing number keys.
  2061.  
  2062.  
  2063.           CALL FULLMENU(HEADER.TITLE$,ITEMS$(),MAIN%,NUMBER.ITEMS%,SELECTION%,_
  2064.                         RETURN.CODE%)
  2065.  
  2066.           Passed:
  2067.  
  2068.            HEADER.TITLE$ - A message to be displayed in the screen title,
  2069.                            (uses TITLE function).
  2070.  
  2071.                 ITEMS$() - An array of the descriptions of each of the menu
  2072.                            selections
  2073.  
  2074.                    MAIN% - A switch indicating if this is the Main Menu
  2075.                            of the program. This determines if the Menu
  2076.                            description accompanying the [ESC] selection
  2077.                            states "Return to Previous Menu" or "Exit Program".
  2078.  
  2079.            NUMBER.ITEMS% - The number of choices available for the menu.
  2080.  
  2081.  
  2082.  
  2083.           Returns:
  2084.  
  2085.               SELECTION% - The number of the item selected. This can be used
  2086.                            in a SELECT CASE .... statement to route  program
  2087.                            flow to the desired section.
  2088.  
  2089.             RETURN.CODE% -
  2090.                            -1 - If ESC is pressed
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.                                    Page 29
  2115.  
  2116.  
  2117.  
  2118.           Routine: WAITTIME
  2119.                    --------
  2120.  
  2121.           Purpose: Waits a given number of seconds or fractions thereof
  2122.                    regardless of processor speed or until ESC pressed.
  2123.  
  2124.  
  2125.           CALL WAITTIME(SECONDS!,RETURN.CODE%)
  2126.  
  2127.           Passed:
  2128.  
  2129.                 SECONDS! - A single precision number, holding the number of
  2130.                            seconds or fractions thereof to wait.
  2131.  
  2132.  
  2133.           Returns:
  2134.  
  2135.             RETURN.CODE% -
  2136.                             -1  - If [ESC] is pressed
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.           NOTE:  Returns to the calling program after the  selected time
  2163.                  period or when the ESC key pressed.
  2164.  
  2165.                  The SECONDS was changed from a interger to a  single precision
  2166.                  to allow for fractions of a  second.
  2167.  
  2168.                  The WAITTIME was enhanced to allow for "rollover" at
  2169.                  midnite from a value of 86400 , back to 0  and still
  2170.                  correctly wait number of seconds specified.
  2171.  
  2172.                  A "backdoor" out of WAITTIME was added. The user can press
  2173.                  the ESC key and immediately cause a "timeout" to occur.
  2174.  
  2175.  
  2176.                                    Page 30
  2177.  
  2178.  
  2179.  
  2180.  
  2181.           Routine: FASTPRT
  2182.                    -------
  2183.  
  2184.           Purpose: Performs direct write to the memory screen buffer. Writes
  2185.                    a string at a row and column location, using the specified
  2186.                    attributes. This is an adaptation of the QPRINT routine
  2187.                    that has been around for awhile.
  2188.  
  2189.  
  2190.           CALL FASTPRT(HEADER.TITLE$,ROW%,COLUMN%,ATTR%,RETURN.CODE%)
  2191.  
  2192.           Passed:
  2193.  
  2194.            HEADER.TITLE$ - The information to be written directly to the
  2195.                            memory screen buffer (bypassing DOS).
  2196.  
  2197.                     ROW% - The row at which the HEADER.TITLE$ is to be written.
  2198.  
  2199.                  COLUMN% - The column at which the HEADER.TITLE$ to be written.
  2200.  
  2201.                    ATTR% - The screen attribute with which to display the
  2202.                            HEADER.TITLE$.
  2203.                            ATTR% is derived from the followung formula:
  2204.  
  2205.                                ATTR% = (backgrnd * 16) + foregrnd
  2206.  
  2207.  
  2208.  
  2209.           Returns:
  2210.  
  2211.             RETURN.CODE% -
  2212.                            No return parameter.
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.                                    Page 31
  2240.  
  2241.  
  2242.  
  2243.           Routine: MAKEWIND
  2244.                    --------
  2245.  
  2246.           Purpose: Produces a window of the given size and color at a
  2247.                    specified location on the screen; with options such
  2248.                    as a frame in various styles, a shadow underneath,
  2249.                    and 'growing' onto the screen.
  2250.  
  2251.           CALL MAKEWIND(ULR%,ULC%,LRR%,LRC%,TYPE.FRAME%,FOREGROUND%,_
  2252.                         BACKGROUND%,GROW%,SHADOW%,HEADER.TITLE$,_
  2253.                         RETURN.CODE%)
  2254.  
  2255.           Passed:
  2256.  
  2257.                     ULR% - An integer holding the upper left hand
  2258.                            corner row value.
  2259.  
  2260.                     ULC% - An integer holding the upper left hand
  2261.                            corner column value.
  2262.  
  2263.                     LRR% - An integer holding the lower right hand
  2264.                            corner row value.
  2265.  
  2266.                     LRC% - An integer holding the lower right hand
  2267.                            corner column value.
  2268.  
  2269.              TYPE.FRAME% - An integer defining the type of frame style
  2270.                            for the window as follows:
  2271.  
  2272.                               0 - No frame. Just a border of spaces
  2273.                                   of the background color. This is the
  2274.                                   default if an invalid value is specified.
  2275.  
  2276.                               1 - A single line frame.
  2277.  
  2278.                               2 - A double line frame.
  2279.  
  2280.                               3 - A single horizontal line,
  2281.                                   double vertical line frame.
  2282.  
  2283.                               4 - A double horizontal line,
  2284.                                   single vertical line frame.
  2285.  
  2286.              FOREGROUND% - The foreground color; ranging from 0 (BLACK)
  2287.                            to 15 (BRIGHT WHITE). This will be the color of
  2288.                            the frame. To get a blinking frame add 128 to
  2289.                            FOREGROUND%.
  2290.  
  2291.              BACKGROUND% - The background color (the color of the window).
  2292.                            Can range from 0 (BLACK) to 7 (WHITE).
  2293.  
  2294.                    GROW% - A switch to determine if the window will grow
  2295.                            from the center outward. Any non-zero value will
  2296.                            produce a growing window.
  2297.  
  2298.                  SHADOW% - A switch to determine if the window will
  2299.                            have a black shadow underneath. Any non-zero
  2300.                            value will produce a shadow.
  2301.  
  2302.                                    Page 32
  2303.  
  2304.  
  2305.  
  2306.            HEADER.TITLE$ - A string that will be used to produce a
  2307.                            label in CENTERED in the top line of the
  2308.                            window frame. The label will be framed
  2309.                            by square brackets ( [ ] ). If the
  2310.                            HEADER.TITLE$ string is a null string ("") the
  2311.                            the label will not be displayed. If the
  2312.                            HEADER.TITLE$ is longer than the width of the
  2313.                            window, the  label will be truncated.
  2314.  
  2315.           Returns:
  2316.  
  2317.             RETURN.CODE% -
  2318.                            No parameters returned.
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.           NOTES:
  2348.                 Once the window is placed on the screen, it is up to you
  2349.                 to fill it with data, by means of LOCATE, COLOR, and
  2350.                 PRINT statements.
  2351.  
  2352.                 The frame is drawn around the window coordinates. Thus the
  2353.                 dimensions of the windows will actually be two columns greater
  2354.                 in width and two row greater in length.
  2355.  
  2356.                 Adding a shadow increases the effective window size by 3
  2357.                 columns to the left and 1 row below.
  2358.  
  2359.                 You can use constants in the argument list of the CALL, so you
  2360.                 do not have to pre-assign variables to all parameters.
  2361.  
  2362.  
  2363.  
  2364.                                    Page 33
  2365.  
  2366.  
  2367.          Routine: SAVESCRN
  2368.                   --------
  2369.  
  2370.          Purpose: Saves the screen buffer contents to an  array.
  2371.  
  2372.  
  2373.          CALL SAVESCRN(NOTEST%,SCRNARRY.SEGMENT%,SCRNARRY.OFFSET%,RETURN.CODE%)
  2374.  
  2375.  
  2376.           Passed:
  2377.                  NOTEST% - A switch to determine whether to test horizontal
  2378.                            retrace status during data transfers to minimize
  2379.                            screen snow. The IBM CGA requires these tests;
  2380.                            but many non-IBM color cards and the EGA do not.
  2381.                            Operations can be significantly speeded up on
  2382.                            monitors NOT requiring a test of the horizontal
  2383.                            retrace.
  2384.  
  2385.                               A value of 0 for NOTEST% will cause the
  2386.                               routine to check horizontal retrace status.
  2387.                               Any other value will bypass status checking.
  2388.  
  2389.                               Regardless of this value, monochrome cards
  2390.                               will always bypass status checking.
  2391.  
  2392.        SCRNARRY.SEGMENT% - The memory location of the  array that is to hold
  2393.                                                        -----
  2394.                            the screen data. The memory location must be able to
  2395.                            hold 4000 bytes ((25 rows x 80 columns) * 2).
  2396.                             The memory location is determined as follows:
  2397.                            (see NOTE below)
  2398.  
  2399.        SCRNARRY.OFFSET%  - The memory location of the element of the array
  2400.                                                       ---------------------
  2401.                            that is to hold the screen data. There must be at
  2402.                            least 4000 bytes from this element to the end of the
  2403.                            array.
  2404.  
  2405.           Returns:
  2406.  
  2407.                            The data in the screen stored at the specified
  2408.                            memory location (of the array).
  2409.  
  2410.         NOTE: Example of how to generate the array SEGMENT and OFFSET addresses
  2411.  
  2412.                            SCRNARRY.SEGMENT%=VARSEG(ARRY%(0))
  2413.                            SCRNARRY.OFFSET%=VARPTR(ARRY%(0))
  2414.  
  2415.         NOTE: This routine does not save the current cursor location. If you
  2416.               require that it be saved, you must issue the following statement
  2417.               BEFORE you call SAVESCRN:
  2418.  
  2419.                                   OLDX% = POS(0):OLDY% = CSRLIN
  2420.  
  2421.                You can restore the cursor position with the following statement
  2422.  
  2423.                                   LOCATE OLDY%,OLDX%
  2424.  
  2425.  
  2426.                                    Page 34
  2427.  
  2428.  
  2429.  
  2430.          Routine: RESTSCRN
  2431.                   --------
  2432.  
  2433.          Purpose: Moves screen data , that had been saved with SAVESCRN,
  2434.                   from the specified memory location ( in an array) back into
  2435.                   the screen memory buffer.
  2436.  
  2437.          CALL RESTSCRN(NOTEST%,SCRNARRY.SEGMENT%,SCRNARRY.OFFSET%,RETURN.CODE%)
  2438.  
  2439.           Passed:
  2440.  
  2441.                  NOTEST% - A switch to determine whether to test horizontal
  2442.                            retrace status during data transfers to minimize
  2443.                            screen snow. The IBM CGA requires these tests;
  2444.                            but many non-IBM color cards and the EGA do not.
  2445.                            Operations can be significantly speeded up on
  2446.                            monitors NOT requiring a test of the horizontal
  2447.                            retrace.
  2448.  
  2449.                               A value of 0 for NOTEST% will cause the
  2450.                               routine to check horizontal retrace status.
  2451.                               Any other value will bypass status checking.
  2452.  
  2453.                               Regardless of this value, monochrome cards
  2454.                               will always bypass status checking.
  2455.  
  2456.        SCRNARRY.SEGMENT% - The memory location of the  array that is to hold
  2457.                                                        -----
  2458.                            the screen data. The memory location must be able to
  2459.                            hold 4000 bytes ((25 rows x 80 columns) * 2).
  2460.                             The memory location is determined as follows:
  2461.                            (see NOTE below)
  2462.  
  2463.        SCRNARRY.OFFSET%  - The memory location of the element of the array
  2464.                                                       ---------------------
  2465.                            that is to hold the screen data. There must be at
  2466.                            least 4000 bytes from this element to the end of the
  2467.                            array.
  2468.                             The memory location is determined as follows:
  2469.                            (see NOTE below)
  2470.  
  2471.         NOTE: Example of how to generate the array SEGMENT and OFFSET addresses
  2472.  
  2473.                            SCRNARRY.SEGMENT%=VARSEG(ARRY%(0))
  2474.                            SCRNARRY.OFFSET%=VARPTR(ARRY%(0))
  2475.  
  2476.          Returns:
  2477.                            No parameters returned.
  2478.  
  2479.                            The screen as it was before the execution
  2480.                            of the SAVESCRN routine.
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.                                    Page 35
  2489.  
  2490.  
  2491.  
  2492.          Routine: SAVEWIND
  2493.                   --------
  2494.  
  2495.          Purpose: Copies a rectangular area of the screen memory buffer
  2496.                  to a memory location (in an array).
  2497.  
  2498.  
  2499.          SAVEWIND(ULR%,ULC%,LRR%,LRC%,WINDARRY.SEGMENT%,WINDARRY.OFFSET%,_
  2500.                   RETURN.CODE%)
  2501.  
  2502.          Passed:
  2503.  
  2504.                     ULR% - The upper left hand corner row value.
  2505.  
  2506.                     ULC% - The upper left hand corner column value.
  2507.  
  2508.                     LRR% - The lower right hand corner row value.
  2509.  
  2510.                     LRC% - The lower right hand corner column value.
  2511.  
  2512.  
  2513.        WINDARRY.SEGMENT% - The memory location of the  array that is to hold
  2514.                                                        -----
  2515.                            the screen data. The memory location must be able to
  2516.                            hold the number of ((rows x columns) * 2) bytes.
  2517.                             The memory location is determined as follows:
  2518.                            (see NOTE below)
  2519.  
  2520.        WINDARRY.OFFSET%  - The memory location of the element of the array
  2521.                                                       ---------------------
  2522.                            that is to hold the screen data. There must be at
  2523.                            at least ((rows x columns) * 2) bytes in the array.
  2524.                             The memory location is determined as follows:
  2525.                            (see NOTE below)
  2526.  
  2527.  
  2528.  
  2529.           Returns:
  2530.                            The data in the specified screen memory buffer
  2531.                            is stored at the specified memory location
  2532.                            (of an array).
  2533.  
  2534.  
  2535.         NOTE: Example of how to generate the array SEGMENT and OFFSET addresses
  2536.  
  2537.                            WINDARRY.SEGMENT%=VARSEG(ARRY%(0))
  2538.                            WINDARRY.OFFSET%=VARPTR(ARRY%(0))
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.                                    Page 36
  2551.  
  2552.  
  2553.  
  2554.           Routine: RESTWIND
  2555.                    --------
  2556.  
  2557.           Purpose: Copies to a rectangular area of the screen memory buffer
  2558.                    from a memory location (in an array).
  2559.  
  2560.  
  2561.           RESTWIND(ULR%,ULC%,LRR%,LRC%,WINDARRY.SEGMENT%,WINDARRY.OFFSET%,_
  2562.                    RETURN.CODE%)
  2563.  
  2564.           Passed:
  2565.  
  2566.                     ULR% - The upper left hand corner row value.
  2567.  
  2568.                     ULC% - The upper left hand corner column value.
  2569.  
  2570.                     LRR% - The lower right hand corner row value.
  2571.  
  2572.                     LRC% - The lower right hand corner column value.
  2573.  
  2574.        WINDARRY.SEGMENT% - The memory location of the  array that is to hold
  2575.                                                        -----
  2576.                            the screen data. The memory location must be able to
  2577.                            hold the number of ((rows x columns) * 2) bytes.
  2578.                             The memory location is determined as follows:
  2579.                            (see NOTE below)
  2580.  
  2581.        WINDARRY.OFFSET%  - The memory location of the element of the array
  2582.                                                       ---------------------
  2583.                            that is to hold the screen data. There must be at
  2584.                            at least ((rows x columns) * 2) bytes in the array.
  2585.                             The memory location is determined as follows:
  2586.                            (see NOTE below)
  2587.  
  2588.  
  2589.           Returns:
  2590.                            No parameters returned.
  2591.  
  2592.                            The data in the specified array is restored
  2593.                            to the screen at the given co-ordinates. Note
  2594.                            that these DO NOT have to be the same coordinates
  2595.                            that were given at the time of the SAVEWIND
  2596.                            operation; allowing you to 'pick up' a section
  2597.                            of the screen and 'drop' it somewhere else.
  2598.  
  2599.  
  2600.         NOTE: Example of how to generate the array SEGMENT and OFFSET addresses
  2601.  
  2602.                            WINDARRY.SEGMENT%=VARSEG(ARRY%(0))
  2603.                            WINDARRY.OFFSET%=VARPTR(ARRY%(0))
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.                                    Page 37
  2613.  
  2614.  
  2615.  
  2616.           Routine: SCROLL
  2617.                    ------
  2618.  
  2619.           Purpose: Allows an area of the screen to be scrolled or cleared,
  2620.                    independent of the rest of the screen.
  2621.  
  2622.  
  2623.           CALL  SCROLL(ULR%,ULC%,LRR%,LRC%,LINES%,DIR%,HEADER.TITLE$,_
  2624.                        RETURN.CODE%)
  2625.  
  2626.           Passed:
  2627.  
  2628.                     ULR% - The upper left hand corner row value.
  2629.  
  2630.                     ULC% - The upper left hand  corner column value.
  2631.  
  2632.                     LRR% - The lower right hand corner row value.
  2633.  
  2634.                     LRC% - The lower right hand corner column value.
  2635.  
  2636.                   LINES% - The number of lines  to be scrolled. Normally 1,
  2637.                            so that another line can be set into its place.
  2638.                            If number of lines is 0, THEN the area defined
  2639.                            is cleared, using the background attribute.
  2640.  
  2641.                     DIR% - The direction of the scroll.
  2642.  
  2643.                                      1 - scroll up
  2644.  
  2645.                                     -1 - scroll down
  2646.  
  2647.            HEADER.TITLE$ - A text message that will be placed into the
  2648.                            area left clear by the scroll procedure.
  2649.  
  2650.  
  2651.           Returns:
  2652.                           No returned parameters.
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.           NOTE:
  2668.                 The SCROLL function takes advantage of calls made
  2669.                directly to the BIOS. Therefore the PCs BIOS that
  2670.                the program is running on MUST be able to provide
  2671.                IBM  compatibility for SCROLL to work correctly.
  2672.  
  2673.  
  2674.                                    Page 38
  2675.  
  2676.  
  2677.  
  2678.           Routine: MMBUTTON
  2679.                    --------
  2680.  
  2681.           Purpose: Returns which mouse buttons are currently being held down.
  2682.  
  2683.           CALL MMBUTTON(LFT%,RGT%)
  2684.  
  2685.           Passed:
  2686.  
  2687.                     No parameters passed
  2688.  
  2689.           Returns:
  2690.  
  2691.                     LFT% - Will return a non-zero value if the left button is
  2692.                            currently held down.
  2693.  
  2694.                     RGT% - Will return a non-zero value if the right button is
  2695.                            currently held down.
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.                                    Page 39
  2737.  
  2738.  
  2739.  
  2740.           Routine: MMCHECK
  2741.                    -------
  2742.  
  2743.           Purpose: Check for an installed mouse, reset the mouse, initialize
  2744.                    all motion  counters and set mouse to center position.
  2745.                    This call MUST BE MADE BEFORE any other mouse calls will
  2746.                    function.
  2747.  
  2748.           CALL MMCHECK(MOUSE%)
  2749.  
  2750.           Passed:
  2751.  
  2752.                   No parameters passed.
  2753.  
  2754.           Returns:
  2755.  
  2756.  
  2757.                   MOUSE% - The number of mouse buttons installed.
  2758.                            Zero(0) if NO mouse installed.
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.                                    Page 40
  2799.  
  2800.  
  2801.  
  2802.           Routine: MMCLICK
  2803.                    -------
  2804.  
  2805.           Purpose: Returns which mouse buttons have been clicked since you last
  2806.                    used this function.
  2807.  
  2808.  
  2809.           CALL MMCLICK(LFT%,RGT%)
  2810.  
  2811.  
  2812.           Passed:
  2813.                  No parameters passed
  2814.  
  2815.           Returns:
  2816.  
  2817.                     LFT% - Will return the number of times that left button has
  2818.                            been pressed since the last call to this function.
  2819.  
  2820.                     RGT% - Will return the number of times that right button has
  2821.                            been pressed since the last call to this function.
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.                                    Page 41
  2861.  
  2862.  
  2863.  
  2864.           Routine: MMCURSORON
  2865.                    ----------
  2866.  
  2867.  
  2868.           Purpose: Makes the cursor associated with the mouse visible. This is
  2869.                    normally a blinking block, and shows where the mouse is
  2870.                    currently pointing.
  2871.  
  2872.           CALL MMCURSORON
  2873.  
  2874.  
  2875.           Passed:
  2876.  
  2877.                   No parameters
  2878.  
  2879.           Returned:
  2880.  
  2881.                   No parameters
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.                                    Page 42
  2923.  
  2924.  
  2925.  
  2926.           Routine: MMCURSOROFF
  2927.                    -----------
  2928.  
  2929.           Purpose:  Makes the cursor associated with the mouse invisible.
  2930.                     If the cursor is off, the cursor will still follow the
  2931.                     mouses movements, but the cursor will not be seen until
  2932.                     turned on.
  2933.  
  2934.  
  2935.           MMCURSORON.
  2936.  
  2937.           CALL MMCURSOROFF
  2938.  
  2939.           Passed:
  2940.  
  2941.                   No parameters
  2942.  
  2943.           Returned:
  2944.  
  2945.                   No parameters
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.                                    Page 43
  2985.  
  2986.  
  2987.  
  2988.           Routine: MMGETLOC
  2989.                    --------
  2990.  
  2991.           Purpose: Gets the current location of the mouse cursor.  This is
  2992.                    returned as a value from 0-639 for columns, and 0-199 for
  2993.                    rows. You need to adjust this for the current screen format.
  2994.                    If you're in text mode, divide the columns by eight and the
  2995.                    rows by eight. If you're in low-res graphics mode, divide
  2996.                    by two. If you're in high res graphics, the numbers are fine.
  2997.  
  2998.           CALL MMGETLOC(COL%,ROW%)
  2999.  
  3000.           Passed:
  3001.  
  3002.                  No parameters passed
  3003.  
  3004.           Returned:
  3005.  
  3006.                     COL% - 'x' co-ordinate (column) is a value from 0-639
  3007.  
  3008.                     ROW% - 'y' co-ordinate (row) is a value from 0-199.
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.          NOTE: To normalize the values returned by  MMGETLOC (for 80x25 text
  3035.                screen) , the basic formula is:
  3036.  
  3037.  
  3038.                Basics CSRLIN  value is: ((ROW%\8) + 1)
  3039.  
  3040.                Basics POS(0)  value is: ((COL%\8) + 1)
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.                                    Page 44
  3047.  
  3048.  
  3049.  
  3050.           Routine: MMSETLOC
  3051.                    --------
  3052.  
  3053.           Purpose: Sets the current location of the mouse cursor.  This is
  3054.                    passed  as a value from 0-639 for columns, and 0-199 for
  3055.                    rows. You need to adjust this for the current screen format.
  3056.  
  3057.  
  3058.           CALL MMSETLOC(COL%,ROW%)
  3059.  
  3060.  
  3061.           Passed:
  3062.  
  3063.                     COL% - 'x' co-ordinate (column) is a value from 0-639
  3064.  
  3065.                     ROW% - 'y' co-ordinate (row) is a value from 0-199.
  3066.  
  3067.           Returns
  3068.  
  3069.                     No parameters returned.
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.          NOTE: To translate Basic's CSRLIN and POS(0) values, (for 80x25 text
  3099.                screen) , the basic formula is:
  3100.  
  3101.  
  3102.                Mouses 'y' value is :    ((CSRLIN-1)*8))
  3103.  
  3104.                Mouses 'x' value is :    ((POS(0)-1)*8)
  3105.  
  3106.  
  3107.  
  3108.                                    Page 45
  3109.  
  3110.  
  3111.  
  3112.           Routine: MMSETRANGE
  3113.                    ----------
  3114.  
  3115.  
  3116.           Purpose: Sets the range of locations where the mouse cursor is allowed
  3117.                    to be. This is done by specifying the upper left corner and
  3118.                    lower right corner of the edges of the mouse input field.
  3119.  
  3120.  
  3121.           CALL MMSETRANGE(ULC%,ULR%,LRC%,LRR%)
  3122.  
  3123.  
  3124.           Passed:
  3125.  
  3126.                     ULC% - The upper left hand corner column value.
  3127.  
  3128.                     ULR% - The upper left hand corner row value.
  3129.  
  3130.                     LRC% - The lower right hand corner column value.
  3131.  
  3132.                     LRR% - The lower right hand corner row value.
  3133.  
  3134.  
  3135.           Returns:
  3136.  
  3137.                     No parameters returned.
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.          NOTE: To translate Basic's CSRLIN and POS(0) values, (for 80x25 text
  3161.                screen) , the basic formula is:
  3162.  
  3163.  
  3164.                Mouses ROW    value is :    ((CSRLIN-1)*8))
  3165.  
  3166.  
  3167.                Mouses COLUMN value is :    ((POS(0)-1)*8)
  3168.  
  3169.  
  3170.                                    Page 46
  3171.  
  3172.  
  3173.  
  3174.  
  3175.           QUADRANT$
  3176.           ---------
  3177.  
  3178.  
  3179.           A QUADRANT$ is defined as a string. This string can have a
  3180.           a value as noted below ("0"/"4" or "01:01"). The "row:column"
  3181.           format defines actual upper left screen co-ordinates of a window.
  3182.           The other format, "0", defines a quadrant of the screen in which
  3183.           a window is centered. With BASWIND, IF the window does NOT center
  3184.           in a quadrant (its to big for example), the center co-ordinates
  3185.           for the quadrant are adjusted so that the window will still be
  3186.           in that quadrant of the window.
  3187.  
  3188.  
  3189.  
  3190.                                    screen layout
  3191.                                  -----------------
  3192.  
  3193.  
  3194.  
  3195.                              ---------------------------
  3196.                             |             .             |
  3197.                             |      1      .      2      |
  3198.                             |             .             |
  3199.                             |.............0.............|
  3200.                             |             .             |
  3201.                             |             .             |
  3202.                             |      4      .      3      |
  3203.                             |             .             |
  3204.                              ---------------------------
  3205.  
  3206.                             "0" - In the exact center of the
  3207.                                   screen; centered according
  3208.                                   to menu size.
  3209.  
  3210.                             "1" - Upper Left Quadrant.
  3211.  
  3212.                             "2" - Upper Right Quadrant.
  3213.  
  3214.                             "3" - Lower Right Quadrant.
  3215.  
  3216.                             "4" - Lower Left Quadrant.
  3217.  
  3218.                         "rr:cc" - Specifies exact coordinates
  3219.                                   of upper left corner of window
  3220.                                   to be row rr and column cc
  3221.                                   (two digits each).
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.                                    Page 47
  3233.  
  3234.  
  3235.  
  3236.                              Comments, and Suggestions
  3237.  
  3238.                                        for
  3239.  
  3240.                                     BASWIND8
  3241.  
  3242.           In  order  to  make  the Window Tools routines the best that they
  3243.           can be, and to better serve your  needs;  This  form  is provided
  3244.           for  your  feedback. If you  have any comments or suggestions on
  3245.           these routines,  please use this to  communicate that information.
  3246.  
  3247.            If  you  have  any  suggestions  as  to additional  Window  Tool
  3248.           routines  that would be useful to you, please include that infor-
  3249.           mation as well.
  3250.  
  3251.            You  may also use this form if you would like to be kept informed
  3252.           of any future additions and releases of Window Tools or supporting
  3253.           assembler routines.
  3254.  
  3255.  
  3256.           Name:________________________      Mail to:   James P. Morgan
  3257.  
  3258.           Address: ____________________                 5226 Via Hacienda #115
  3259.  
  3260.                    ____________________                 Orlando FL  32809
  3261.  
  3262.           City: _______________________                 U. S. A.
  3263.  
  3264.           State: __________ Zip: ______
  3265.  
  3266.           Country: ____________________
  3267.  
  3268.           COMMENTS:
  3269.  
  3270.           ________________________________________________________________
  3271.  
  3272.           ________________________________________________________________
  3273.  
  3274.           ________________________________________________________________
  3275.  
  3276.           ________________________________________________________________
  3277.  
  3278.           ________________________________________________________________
  3279.  
  3280.           ________________________________________________________________
  3281.  
  3282.           ________________________________________________________________
  3283.  
  3284.           ________________________________________________________________
  3285.  
  3286.           ________________________________________________________________
  3287.  
  3288.           ________________________________________________________________
  3289.  
  3290.           ________________________________________________________________
  3291.  
  3292.           ________________________________________________________________
  3293.  
  3294.                                    Page 48
  3295.