home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / DATABASE / DBT123S.ZIP / DBTOOLS.DOC < prev    next >
Text File  |  1990-08-09  |  83KB  |  1,961 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.              ╔═══════════════════════════════════════════════════╗
  7.              ║                                                   ║
  8.              ║       ╓─ ╥────╖ ╓───╥───╖             ─╖          ║
  9.              ║       ║  ║    ║     ║                  ║          ║
  10.              ║       ║  ╟────╨╖    ║                  ║          ║
  11.              ║   ╓───╢  ║     ║    ║   ╓────╖ ╓────╖  ║  ╓───╖   ║
  12.              ║   ║   ║  ║     ║    ║   ║    ║ ║    ║  ║  ╙───╖   ║
  13.              ║   ╙───╨  ╨─────╜   ─╨─  ╙────╜ ╙────╜ ─╨─ ╙───╜   ║
  14.              ║                                                   ║
  15.              ╚═══════════════════════════════════════════════════╝
  16.  
  17.                            VERSION 1.23  July 1990
  18.  
  19.  
  20.                       Enhancements to the dBASE language
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.              (c) 1989,1990 BERNATH COMPUTER, all rights reserved
  33.  
  34.                            1821 Harding Court
  35.  
  36.                            Antioch, CA  94509
  37.  
  38.                              (415) 778-4423
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.     TABLE OF CONTENTS
  46.                                                         Page No.
  47.                                                         --------
  48.         Introduction ...................................   1
  49.         Shareware ......................................   2
  50.         Disclaimer (legalese) ..........................   2
  51.         System Requirements ............................   3
  52.         Package Contents ...............................   3
  53.         Features .......................................   3
  54.         Loading and Using dBTools ......................   4
  55.         Conventions ....................................   7
  56.  
  57.         dBTools Function Reference
  58.            Function  0, INITIALIZE DBTOOLS .............   8
  59.            Function  1, ATSAY ..........................   8
  60.            Function  2, BLAT ...........................   8
  61.            Function  3, BOX ............................   8
  62.            Function  4, CURSOR .........................   8
  63.            Function  5, ERASE ..........................   9
  64.            Function  6, DELAY ..........................   9
  65.            Function  7, DITHER .........................   9
  66.            Function  8, FADE ...........................   9
  67.            Function  9, HMENU ..........................  10
  68.            Function 10, PAUSE ..........................  11
  69.            Function 11, PRINTER ........................  12
  70.            Function 12, READSCR ........................  13
  71.            Function 13, RECOLOR ........................  13
  72.            Function 14, RESTORE ........................  13
  73.            Function 15, SAVESCR ........................  14
  74.            Function 16, SCROLL .........................  14
  75.            Function 17, SOUND ..........................  14
  76.            Function 18, TWIDDLE ........................  14
  77.            Function 19, UNPOP ..........................  15
  78.            Function 20, VMENU ..........................  15
  79.            Function 21, WINDOW .........................  16
  80.            Function 22, PAGE ...........................  17
  81.            Function 23, NOBLINK ........................  17
  82.            Function 24, PALETTE ........................  17
  83.            Function 25, GETKEY .........................  19
  84.  
  85.         About the dBTools Demo .........................  20
  86.         Technical Support ..............................  21
  87.         Revision History ...............................  22
  88.         Things to Come .................................  23
  89.  
  90.         Appendix A : Error messages
  91.         Appendix B : Printer definition files
  92.         Appendix C : Musical Note versus Frequency Equivalency Chart
  93.         Appendix D : Coding pulldown menu systems
  94.         Appendix E : Function Key Scancode Values
  95.         Appendix F : Registration Form and Questionaire
  96.  
  97.  
  98.  
  99.     dBTools - dBASE III+ Enhancement Tools                  Page  1
  100.               (c) 1990 BERNATH COMPUTER
  101.  
  102.  
  103.     INTRODUCTION
  104.  
  105.          The dBASE language has become an accepted standard for
  106.     custom database applications. A number of third party vendors
  107.     have imitated the original package offered by Ashton-Tate (they
  108.     say imitation is the highest form of flattery), offering improved
  109.     speed, and/or extensions to the dBASE language. Most notable
  110.     among these third party vendor products are Clipper, Foxbase/FoxPro,
  111.     and dBXL/Quicksilver. Even Ashton-Tate has come up with an improved
  112.     and enhanced version of the language in dBASE IV.
  113.  
  114.          However, studies show that there are still a lot of copies of
  115.     dBASE III+ being used out there - everybody hasn't rushed out to
  116.     purchase a dBASE compiler or even to upgrade to dBASE IV. So whereas
  117.     programmers love to bash dBASE III+, there are a lot of people out
  118.     there still using it.
  119.  
  120.          One of the areas where I believe dBASE III+ shows its most
  121.     dismal performance is in its screen handling capabilities. The
  122.     "look and feel" of a typical dBASE application is lackluster, as
  123.     a result of the barrenness of the language in this area. It is
  124.     one of the first areas where the third party vendors have added
  125.     extensions to the language (and Ashton-Tate in dBASE IV).
  126.  
  127.          Nowadays an attractive application should have popup windows
  128.     and menus, fast screen writes, and color, features which are missing
  129.     or severly limited in dBASE III+, and implemented to various degrees
  130.     in the other dBASE versions. The ability to take advantage of your
  131.     printer's features is also a desirable capability. These are the type
  132.     of enhancements that dBTools provides, from within your copy of dBASE.
  133.     dBTools also has some features not found in ANY of the dBASE dialects,
  134.     and can be used to enhance any one of them.
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.     dBASE III+ and dBASE IV are trademarks of Ashton-Tate
  150.     Foxbase and FoxPro are trademarks of Fox Software, Inc.
  151.     Clipper is a trademark of Nantucket Software Ltd.
  152.     dBXL and Quicksilver are trademarks of WordTech Inc.
  153.     MSDOS is a trademark of Microsoft, Inc.
  154.     IBM is a trademark of International Business Machines
  155.     Lotus 123 is a trademark of Lotus, Inc.
  156.  
  157.  
  158.     dBTools - dBASE III+ Enhancement Tools                  Page  2
  159.               (c) 1990 BERNATH COMPUTER
  160.  
  161.     SHAREWARE
  162.  
  163.          dBTools is classified as shareware: meaning that BERNATH
  164.     COMPUTER retains all copyrights on the software, but users are
  165.     allowed to freely distribute the package as long as they include
  166.     all files intact. No charge may be made for this distribution
  167.     except for a small handling charge not to exceed $5 (if you're
  168.     charging more than this you're soaking people!) such as shareware
  169.     libraries and distribution houses charge.
  170.  
  171.          You are allowed to use dBTools for an evaluation period free
  172.     of charge, afterwards which you are encouraged to register your
  173.     copy with BERNATH COMPUTER for a small registration fee of $25.
  174.  
  175.          What will registration get you?
  176.  
  177.          ■ A copy of the latest revision of dBTools without the opening
  178.     shareware message, and a copy of the lastest version with the share-
  179.     ware message so you can pass it on to others.
  180.  
  181.          ■ Notification of upgrades to dBTools and other products by
  182.     BERNATH COMPUTER (oh no, another mailing list!).
  183.  
  184.          ■ My prayers and blessings (if that sounds strange, just
  185.     realize that I am also an ordained minister and the pastor of a
  186.     church).
  187.  
  188.     SINGLE USER vs SITE LICENSE
  189.  
  190.     dBTools is essentially a programmer's development tool. As such, the
  191.     license is for one individual developing applications. If you have more
  192.     than one person developing applications using dBTools, you need a site
  193.     license. Or, if you are an individual developing an application using
  194.     dBTools that will be distributed commercially or to more than 50 end
  195.     users, you need a site license.
  196.  
  197.          See the registration form at the end of this documentation.
  198.  
  199.     I've had a number people tell me what a great product dBTools is, that
  200.     in fact I was undercharging for it. So, I've raised the registration from
  201.     $15 to $25 in this version, but there are some added features also.
  202.     I must say I haven't been encouraged by the number of registrations I've
  203.     been getting. C'mon, gang, 25 bucks is CHEAP for what dBTools gives
  204.     you!
  205.  
  206.     DISCLAIMER
  207.  
  208.          dBTools is supplied AS IS, with no guarantees or warranties
  209.     for its performance or suitableness for any application. BERNATH
  210.     COMPUTER will in no way be held liable for any losses or damages
  211.     incurred through the use of this product.
  212.  
  213.          The above statement is for protection from sue-happy lawyers.
  214.     In reality, I am very interested in providing a quality product
  215.     that IS suitable for your application. If there are bugs, I want to
  216.     know about them and will endeavor to correct them.
  217.  
  218.  
  219.     dBTools - dBASE III+ Enhancement Tools                  Page  3
  220.               (c) 1990 BERNATH COMPUTER
  221.  
  222.  
  223.     SYSTEM REQUIREMENTS
  224.  
  225.          An IBM compatible XT, AT, or 386 machine with MSDOS 2.x or
  226.     higher.
  227.          A color CGA, EGA, or VGA video card.
  228.          A maximum of 32k memory in addition to that required by
  229.     dBASE III+.
  230.          dBASE III+ or a compatible dBASE compiler or interpreter
  231.     (dBTools has been successfully used on Foxbase/FoxPro, dBXL,
  232.     Quicksilver, and dBASE IV). A version will be forthcoming which
  233.     will work with Clipper (see the THINGS TO COME section).
  234.  
  235.     dBTools CONTENTS
  236.  
  237.          You should have the following files included in your dBTools
  238.          package:
  239.  
  240.                 DBTOOLS.BIN - the dBTools module
  241.                 DBTOOLS.DOC - this documentation
  242.                 DBTQREF.DOC - dBTools Quick Reference Guide
  243.                 DBT*.PRG    - demo programs
  244.                 PRNDEF.DBF, and .NDX, ESCCODES.DBF, and .NDX
  245.                             - Printer definition data, an easy
  246.                               way to create and maintain the
  247.                               .PRT files.
  248.                 PRNDEF.FRM  - report form to list printer codes
  249.                 PRTTEST.PRG - standalone printer test program
  250.                 PROCFILE.PRG- a procedure file with some useful
  251.                               routines
  252.                 PROCDEMO.PRG- goes with the procedure file to demo
  253.                               the routines
  254.                 CLOSET.PRG  - skeleton code for pulldown menu system
  255.                 GODEMO.BAT  - batch file to execute the demo
  256.                 PAN1091.PRT - Printer dfn for Panasonic 1091i
  257.                 EPSONFX.PRT - Printer dfn for Epson FX series
  258.                 OKI192.PRT  - Printer dfn for Okidata 192
  259.                 HPLASER.PRT - Printer dfn for HP Laserjet
  260.                 IBMPRO.PRT  - Printer dfn for IBM Proprinter
  261.  
  262.                 *.IMG       - Screen image files
  263.                 PAINT.*     - files for PC Magazines screen painter
  264.     FEATURES
  265.  
  266.          ■ A single .BIN file contains all dBTools functions.
  267.  
  268.          ■ Written entirely in assembly language for the ultimate in
  269.     speed and compactness.
  270.  
  271.          ■ All functions accessible within a .PRG file or from the
  272.     dot prompt through the CALL command.
  273.  
  274.          ■ 25 functions provided:
  275.  
  276.          Popup windows with boxed and shadowed frames, or draw framed
  277.          and shadowed boxes without saving what's underneath.
  278.  
  279.          Vertical moving bar menus, with framed boxes and shadows that
  280.          can trap function keys. May be popup/pulldown.
  281.  
  282.  
  283.     dBTools - dBASE III+ Enhancement Tools                  Page  4
  284.               (c) 1990 BERNATH COMPUTER
  285.  
  286.          Horizontal moving bar menus, a la Lotus 1-2-3, with Fkey trap.
  287.  
  288.          Save and restore up to three entire screens in memory.
  289.  
  290.          Read a screen image from a file into memory.
  291.  
  292.          Eight slideshow-type "fades" of screen images in memory, for
  293.          dramatic effects.
  294.  
  295.          Turn off/on the cursor, or set its width from skinny to fat.
  296.  
  297.          Scroll, and/or erase a portion of the screen.
  298.  
  299.          Recolor (change the attribute bytes) of an area of the
  300.          screen without changing the text.
  301.  
  302.          A fast alternative to @ SAY that works independently of the
  303.          dBASE SET COLOR TO command, with an optional shadow.
  304.  
  305.          Sound commands that allow you to set frequency and duration
  306.          of a note, a three note "twiddle", and the computer equiv-
  307.          alent of a bronx cheer.
  308.  
  309.          Clear the screen to a "dithered" background using upper
  310.          graphics characters, which gives over a hundred background
  311.          colors.
  312.  
  313.          Delay an operation (a timed wait command) anywhere from
  314.          1/18th second to several seconds.
  315.  
  316.          A more elegant WAIT command (press any key to continue....),
  317.          with an optional user defined message and the ability to trap
  318.          Function and other control keys.
  319.  
  320.          A user definable printer driver which allows you to take advan-
  321.          tage of your printer's features (Bold, underline, pitch, font,
  322.          italic, etc.) from within dBASE.
  323.  
  324.          Write invisibly to a different video page, and then activate the
  325.          page "instantly".
  326.  
  327.          Ability to set the EGA color palette, and choose between blinking
  328.          or high intensity background attributes.
  329.  
  330.          Trap keystrokes and return unambiguous scancodes.
  331.  
  332.     LOADING AND USING dBTools
  333.  
  334.        To make the functions of dBTools available to dBASE you must
  335.     first load the dBTools module. This is the single file DBTOOLS.BIN.
  336.     This file must be where dBASE can locate it, such as in the current or
  337.     the SET PATH TO subdirectory. Then execute the commands:
  338.  
  339.                    LOAD DBTOOLS
  340.                    CALL DBTOOLS WITH "0"
  341.  
  342.  
  343.  
  344.     dBTools - dBASE III+ Enhancement Tools                  Page  5
  345.               (c) 1990 BERNATH COMPUTER
  346.  
  347.     from a .PRG file or from the dot prompt. A brief shareware message will
  348.     appear (not in registered copies). Press ENTER, and then the dBTools
  349.     functions will be available.
  350.  
  351.          Here is a programming tip that will allow you to avoid hard
  352.     coding subdirectory names in your applications:
  353.          I have my dBASE files in a subdirectory C:\DB3, my dbTools
  354.     files in C:\DBTOOLS, and my different dBASE applications files
  355.     (the .PRG's, .DBF's, etc.) in other subdirectories. I set three
  356.     MSDOS environment variables from a batch file GOAPP.BAT in my
  357.     application subdirectory:
  358.  
  359.                    set DBPATH=C:\appsubdir
  360.                    set DBTOOLS=C:\DBTOOLS
  361.                    set DBTPRT=PAN1091
  362.                    cd \db3
  363.                    dbase c:\appsubdir\APPSTART
  364.  
  365.     where appsubdir is the name of the subdirectory my applications
  366.     programs are in, and APPSTART.PRG is the name of the frontend
  367.     startup program of my application.
  368.  
  369.          APPSTART.PRG will look something like this:
  370.  
  371.     * APPSTART.PRG - application startup program
  372.  
  373.     public gPATH,gPRT,gPRTFILE     && declare a global var
  374.     do LOADDBT                     && load and initialize dBTools
  375.     do APPMAIN                     && execute your own application
  376.     *
  377.  
  378.     The file LOADDBT.PRG is included in the distribution package, and
  379.     contains the following code:
  380.  
  381.     *   LOADDBT.PRG - load and initialize dBTools
  382.     gPATH = GETENV("DBPATH")       && fetch pathname from environment
  383.     SET PATH TO &gPATH             && use it to set path
  384.     gDRV = SUBSTR(gPATH,1,2)       && get drive name
  385.     SET DEFAULT TO &gDRV           && set default drive
  386.     gPATH = TRIM(gPATH)+"\"
  387.     mTOOLS = GETENV("DBTOOLS")     && get dBTools location
  388.     mTOOLS = TRIM(mTOOLS)+"\"
  389.     mEXP = mTOOLS + "DBTOOLS"
  390.     LOAD &mEXP                     && use macro to load it
  391.     CALL DBTOOLS WITH "0"          && initialize dBTools
  392.     gPRT = GETENV("DBTPRT")        && get default printer
  393.     gPRTFILE = gPATH+gPRT+".PRT"   && turn it into fully qualified filename
  394.     mEXP = "11,0,0,"+gPRTFILE      && create a memvar to load the printer
  395.     CALL DBTOOLS WITH mEXP         && driver
  396.     RETURN
  397.  
  398.          The above scenario has the advantage that if you want to
  399.     change any of the subdirectories used by your application, all
  400.     you have to do is change the batch file GOAPP.BAT which sets the
  401.     environment variables.
  402.  
  403.  
  404.     dBTools - dBASE III+ Enhancement Tools                  Page  6
  405.               (c) 1990 BERNATH COMPUTER
  406.  
  407.     THE CALL COMMAND
  408.  
  409.          dBTool functions (or any .BIN module loaded into dBASE, for
  410.     that matter) are accessed with the CALL command:
  411.  
  412.               CALL DBTOOLS WITH <parameter string>
  413.  
  414.     where <parameter string> can either be a string memory variable
  415.     or text in quotes. The first value in the parameter string should
  416.     be the dBTools function number (1-25), then a comma, and then
  417.     whatever parameters the function requires, separated by commas.
  418.  
  419.          For example, the CURSOR function, function 4, has two
  420.     parameters, toggled with a "1" or a "0": the first specifies
  421.     whether the cursor is to be turned on or off, the second whether
  422.     it is to be a normal or fat cursor.
  423.  
  424.          To turn the cursor off, you could write
  425.  
  426.                    CALL DBTOOLS WITH "4,0,0".
  427.  
  428.          To turn the cursor on with a fat cursor, you would write
  429.  
  430.                    CALL CURSOR WITH "4,1,1".
  431.  
  432.          Alternatively you could use a memory variable for the
  433.     parameters, such as
  434.  
  435.                    STORE "4,1,0" TO mPARM
  436.                    CALL DBTOOLS WITH mPARM
  437.  
  438.          The parameter string can consist of any valid dBASE
  439.     expression as long as it evaluates to the proper parameters for
  440.     the function.
  441.  
  442.          If the parameter string is incorrect in some way, dBTools
  443.     will beep, blank the screen, display a diagnostic error message
  444.     and the offending parameter string, then pause for a keystroke.
  445.     After receiving the keystroke, operation will resume with the next
  446.     dBASE statement after the CALL command. A list of error messages
  447.     is in Appendix A.
  448.  
  449.  
  450.     dBTools - dBASE III+ Enhancement Tools                  Page  7
  451.               (c) 1990 BERNATH COMPUTER
  452.  
  453.     CONVENTIONS
  454.  
  455.          In the command reference that follows, the following
  456.     conventions will be used:
  457.  
  458.          FG = foreground color    BG = background color
  459.          Using the DOS color parameters 0 through 15:
  460.  
  461.               0 = black                    8 = dark grey
  462.               1 = blue                     9 = bright blue
  463.               2 = green                   10 = bright green
  464.               3 = cyan                    11 = bright cyan
  465.               4 = red                     12 = bright red
  466.               5 = magenta                 13 = bright magenta
  467.               6 = brown                   14 = yellow
  468.               7 = grey                    15 = white
  469.  
  470.          Note that using background colors > 7 will result in blinking
  471.     text, unless function 23 has been used to set blinking Off.
  472.  
  473.          All parameters should be separated by commas.
  474.          Parameters enclosed in <> are optional.
  475.  
  476.          Columns are numbered 0 through 79, rows are 0 through 24.
  477.  
  478.          Window and box coordinates:
  479.          ULC = upper left column     ULR = upper left row
  480.          LRC = lower right column    LRR = lower right row
  481.  
  482.  
  483.     dBTools - dBASE III+ Enhancement Tools                  Page  8
  484.               (c) 1990 BERNATH COMPUTER
  485.  
  486.     DBTOOLS FUNCTION REFERENCE
  487.  
  488.     ■ INITIALIZE DBTOOLS, function 0 : Execute this function once
  489.       right after loading dBTools. A shareware message will appear once
  490.       (not in registered versions). Press ENTER to continue.
  491.  
  492.     ----------------------------------------------------------------------
  493.  
  494.     ■ ATSAY, function 1 : an fast alternative to @ SAY commands.
  495.         CALL DBTOOLS WITH "1,<S>,row,col,FG,BG,page,text"
  496.  
  497.         The S parameter is optional. If included, a background
  498.         shadow will appear under the text.
  499.         page = video page. Normally should be 0.
  500.  
  501.     Example:
  502.         CALL DBTOOLS WITH "1,5,10,15,1,0,Enter Last Name:"
  503.  
  504.     ----------------------------------------------------------------------
  505.  
  506.     ■ BLAT, function 2 : a computerized bronx cheer.
  507.          CALL DBTOOLS WITH "2"
  508.  
  509.          This function is used to provide "negative" audio feedback, such
  510.     as when an incorrect entry is made by a user.
  511.  
  512.     ----------------------------------------------------------------------
  513.  
  514.     ■ BOX, function 3 : draw a framed box with optional shadow.
  515.          CALL DBTOOLS WITH "3, ULR, ULC, LRR, LRC, FG, BG, frame,
  516.                         page, shadow"
  517.  
  518.          ULR, ULC, LRR, LRC form the coordinates of the box.
  519.          Frame = 0 : no frame
  520.          Frame = 1 : single line
  521.          Frame = 2 : double line
  522.          Frame = 3 : single on horizontal, double on vertical
  523.          Frame = 4 : double on horizontal, single on vertical
  524.          Frame = 5 : thick line frame
  525.          Shadow = 0 for no shadow, = 1 for shadow
  526.          Page   = video page, 0 to 3
  527.  
  528.     Example:   CALL DBTOOLS WITH "3,10,25,15,60,15,1,2,0,1"
  529.  
  530.     ---------------------------------------------------------------
  531.  
  532.     ■ CURSOR, function 4 : turn cursor on/off and control its shape.
  533.          CALL DBTOOLS WITH "4, off/on, normal/fat"
  534.  
  535.          The On and Fat toggles are set by setting the parameters to "1",  
  536.    and reset by specifying "0".
  537.  
  538.     Example:
  539.          CALL DBTOOLS WITH "4,0,0"      && cursor off
  540.          CALL DBTOOLS WITH "4,1,1"      && cursor on and fat
  541.          CALL DBTOOLS WITH "4,1,0"      && cursor on and normal
  542.  
  543.  
  544.  
  545.     dBTools - dBASE III+ Enhancement Tools                  Page  9
  546.               (c) 1990 BERNATH COMPUTER
  547.  
  548.  
  549.     ■ ERASE, function 5 : erase text
  550.          CALL DBTOOLS WITH "5,ULR,ULC,LRR,LRC,<BG>"
  551.  
  552.          Erases an area of the screen, specified by its corner coordinates
  553.     ULR,ULC,LRR,LRC. The background color BG is optional. If used, text is
  554.     erased and set to the color specified by BG. If BG is not specified,
  555.     text will be blanked, but the underlying colors will remain unchanged.
  556.  
  557.     Examples:
  558.        CALL DBTOOLS WITH "5,5,10,5,22"        && erases 12 chars, retaining
  559.                                                  current colors
  560.        CALL DBTOOLS WITH "5,10,0,11,79,1"     && erases two lines in blue
  561.  
  562.     ----------------------------------------------------------------------
  563.  
  564.     ■ DELAY, function 6 : timed delay
  565.          CALL DBTOOLS WITH "6,delay"
  566.  
  567.          This function suspends execution of any command for the time
  568.     specified by Delay, which is in eighteenths of seconds (Delay = 18 =
  569.     one second). It is derived from the system clock and so is accurate
  570.     with any processor.
  571.  
  572.     ----------------------------------------------------------------------=
  573.  
  574.     ■ DITHER, function 7 : paint a background using graphics characters
  575.     and "dithering".
  576.          CALL DBTOOLS WITH "7,CharType,FG,BG,Page"
  577.  
  578.                   CharType = 0 : <solid BG color>
  579.                   CharType = 1 :        ░
  580.                   CharType = 2 :        ▒
  581.                   CharType = 3 :        ▓
  582.                   CharType = 4 : <solid FG color>
  583.  
  584.          Over a hundred color shades are possible by combining
  585.     different CharType's, FG's, and BG's. You can also use this to
  586.     clear alternate video pages.
  587.  
  588.     ■ FADE, function 8 : Use one of several slideshow type "fades" to
  589.     display a screen image on the screen.
  590.          CALL DBTOOLS WITH "8, fadetype, mode/color, delay, slot"
  591.  
  592.          Fadetype:      0 = instant snap to screen
  593.                         1 = vertical wipe, top to bottom
  594.                         2 = vertical wipe, bottom to top
  595.                         3 = horizontal wipe, left to right
  596.                         4 = horizontal wipe, right to left
  597.                         5 = horizontal alternate fingers wipe
  598.                         6 = vertical alternate fingers wipe
  599.                         7 = sparkle fade
  600.  
  601.  
  602.     dBTools - dBASE III+ Enhancement Tools                  Page 10
  603.               (c) 1990 BERNATH COMPUTER
  604.  
  605.          Mode/Color: If this parameter is 0, it is assumed the screen data
  606.     is stored in an memory screen image specified by Slot (ie, a screen    
  607.     image produced either by the SAVESCR function 15 command or the READSCR
  608.     function 12 command). If Mode/Color is nonzero, it is assumed you want
  609.     to clear the screen to a solid color specified by the Color parameter,
  610.     using the specified fade type.
  611.          The Delay parameter controls how fast the fade will occur. The
  612.     delay is not derived from the system clock, so there may be some varia-
  613.     tion between processors (although it does sense whether you're running
  614.     on an 8086, 286, or 386 machine and attempt to adjust for it).
  615.  
  616.     Example: Fade to a screen image stored in slot 3, using fade 2.
  617.          CALL DBTOOLS WITH "8,2,0,5,3"
  618.  
  619.     Example: Clearing the screen to green using the sparkle fade.
  620.          CALL DBTOOLS WITH "8,7,2,5,0"
  621.          When fading to a color, the Slot parameter is ignored.
  622.  
  623.     ----------------------------------------------------------------------
  624.  
  625.     ■ HMENU, function 9 : horizontal bar menu.
  626.          mMENUSTR="9, <Y>, choice, row, col, LowFG, LowBG,HighFG, HighBG,;
  627.                    item1, item2, ....., @"
  628.          CALL DBTOOLS WITH mMENUSTR
  629.  
  630.          This function allows you to create scrolling horizontal moving bar
  631.     menus a-la Lotus 1-2-3. The arrow keys, along with the End and Home    
  632.     keys, are used to position the highlight bar, and the <─┘ (Enter) key
  633.     used to select the item. Alternatively, you may press the first letter
  634.     of the menu item to select (pressing Enter is not necessary).
  635.          If you specified the optional Y parameter, HMENU will also trap
  636.     and return the value of Function and other control keys.
  637.          The colors specified by LowFG and LowBG control the color of the
  638.     nonhighlighted text, and HighFG and HighBG control the colors of the
  639.     highlighted text.
  640.          The parameter string MUST be set up with a memory string
  641.     variable, as the value of the selected item is returned in it.
  642.  
  643.          You may add leading and trailing spaces to the menu items to get
  644.     them to space out as desired.
  645.  
  646.          Specifying a 0 initial choice displays the menu, but no options
  647.     are highlighted and the program exits the function without waiting for a
  648.     keystroke.
  649.          Specifying a NEGATIVE initial conditions will highlight the
  650.     specified the specified option, but the function will exit without
  651.     pausing for a keystroke  (See Appendix D for application).
  652.  
  653.  
  654.     dBTools - dBASE III+ Enhancement Tools                  Page 11
  655.               (c) 1990 BERNATH COMPUTER
  656.  
  657.     Example:
  658.          mCHOICE = 1
  659.          mPARM = "9,"+STR(mCHOICE,2)+",24,25,11,1,1,3,"
  660.          mPARM = mPARM + "A)dd,C)hange,D)elete,Q)uit,@"
  661.          * don't forget the commas and terminating @ sign!
  662.          CALL DBTOOLS WITH mPARM
  663.          mCHOICE = VAL(mPARM)
  664.  
  665.          Note that the value of Choice (the string representation of the
  666.     memory variable mCHOICE imbedding in the parameter string) determines
  667.     which of the menu items is initially highlighted. The value of the
  668.     selected item is returned in the first two characters of the parameter
  669.     string, and can be converted to a numeric variable with the dBASE VAL(
  670.     function. Pressing the Escape key returns a value of 0.
  671.          The "@" character at the end of the parameter string is mandatory,
  672.     as it signals dBTools that there are no more menu items.
  673.          If the Y parameter is specified and a function key is pressed,
  674.     HMENU will return a value of 99 for mCHOICE, the 4th byte of the
  675.     parameter string will be set to the first scancode for the function key
  676.     (see Appendix E for scancode values), the 5th byte to the second
  677.     scancode, and the currently highlighted option will be in the 6th byte:
  678.  
  679.           mPARM = "9,Y,"+STR(mCHOICE,2)+",24,25,11,1,3,Add,Change,Delete,@"
  680.           CALL DBTOOLS WITH mPARM
  681.           mCHOICE = VAL(mPARM)
  682.           IF mCHOICE = 99                         && Fkey was pressed
  683.                *  See Note
  684.                mKEY  = ASC(SUBSTR(mPARM,4,1))-1   && Extract 1st scancode
  685.                mSCAN = ASC(SUBSTR(mPARM,5,1))-1   && Extract 2nd scancode
  686.                mCHOICE = ASC(SUBSTR(mPARM),6,1))  && Extract highlighted opt
  687.           ENDIF
  688.  
  689.     Note: Because dBASE cannot handle strings with CHR(0) in them, the
  690.     scancodes are incremented by one in the parm string, and so you must
  691.     subtract 1 when you extract them.
  692.     ----------------------------------------------------------------------
  693.  
  694.     ■ PAUSE, function 10 : an alternative to dBASE's WAIT command.
  695.          CALL DBTOOLS WITH "10, row, col, FG, BG"
  696.          CALL DBTOOLS WITH "10, row, col, FG, BG, <alternate message>"
  697.          mPARM = "10,<Y>, row, col, FG, BG, <alt msg>"
  698.              CALL DBTOOLS WITH mPARM
  699.              mKEY  = ASC(mPARM)-1
  700.              mSCAN = ASC(SUBSTR(mPARM,2,1))
  701.              
  702.          The PAUSE command has three options:
  703.  
  704.          In the first example it will print the message "Press any key to
  705.     continue..." in the color specified by FG and BG, at the position
  706.     specified in Row and Col, and wait for a keystroke.
  707.          In the second example, an alternate user defined message may be
  708.     specified in place of the default "Press any key..."
  709.          In the third example with the Y parameter specified, PAUSE will
  710.     trap and return the scancode values of function keys or cursor control
  711.     keys pressed (see Appendix E). ESC will be returned as 27,0. Note that
  712.     a memory variable string must be used for the parameters.
  713.  
  714.  
  715.     dBTools - dBASE III+ Enhancement Tools                  Page 12
  716.               (c) 1990 BERNATH COMPUTER
  717.  
  718.     ■ PRINTER, function 11 : Send escape codes to printer.
  719.          CALL DBTOOLS WITH "11,0,0,filespec"      && load printer dfn
  720.          mPARM="11,0,1,"+SPACE(31)
  721.          CALL DBTOOLS WITH mPARM                  && get printer info
  722.          CALL DBTOOLS WITH "11,seqcode"           && send escape sequence
  723.  
  724.          This function is a general purpose non-graphics printer driver
  725.     which allows you to define escape codes in a text file and call
  726.     them from within dBASE to control your printer's attributes. Calling
  727.     this function with a seqcode will send the escape sequence specific
  728.     to your printer to control pitch, bold, underline, and whatever
  729.     other features your printer offers. Changing to another printer is
  730.     just a matter of calling function 11 with a different filespec.
  731.  
  732.          The printer control codes must be loaded into memory before they
  733.     can be used. This is accomplished by calling dBTools function 11 with
  734.     seqcode = 0, and the filename that contains the codes:
  735.  
  736.          CALL DBTOOLS WITH "11,0,0,EPSON.PRT"
  737.  
  738.          Once the codes are loaded, up to 48 printer commands are available.
  739.     These are user definable. A suggested format is shown below:
  740.  
  741.             seqcode Action
  742.             ------- -----------------------------
  743.                1    Initialize printer
  744.                2    Set to 10 CPI
  745.                3    Set to 12 CPI
  746.                4    Compressed print ON
  747.                5    Compressed print OFF
  748.                6    Double wide ON
  749.                7    Double wide OFF
  750.                8    Bold ON
  751.                9    Bold OFF
  752.               10    Italic ON
  753.               11    Italic OFF
  754.               12    Underline ON
  755.               13    Underline OFF
  756.               14    Superscript ON
  757.               15    Superscript OFF
  758.               16    Subscript ON
  759.               17    Subscript OFF
  760.               18    NLQ ON
  761.               19    NLQ OFF
  762.               20    Set to 6 LPI
  763.               21    Set to 8 LPI
  764.               22    Set to 4 LPI
  765.               23    Set left margin
  766.  
  767.         A special program is included with the demo that maintains a data-
  768.     base of printers and their escape sequences, from which the printer
  769.     definition files can be automatically created (see Appendix B).
  770.  
  771.  
  772.  
  773.     dBTools - dBASE III+ Enhancement Tools                  Page 13
  774.               (c) 1990 BERNATH COMPUTER
  775.  
  776.         Calling printer function 11 with subfunctions 0,1 returns informa-
  777.     tion about the selected printer. A 38 byte parameter string is first
  778.     set up as shown below, dBTools is called, and information is returned
  779.     in the parameter string:
  780.  
  781.         mPARM = "11,0,1,"+SPACE(31)             && set up parameter string
  782.         CALL DBTOOLS WITH mPARM                 && get printer info
  783.  
  784.         mNUMESC = ASC(SUBSTR(mPARM,1,1))        && number of defined esc codes
  785.         mPRTYPE = ASC(SUBSTR(mPARM,2,1))-1      && Printer type:
  786.                                                 &&   0 = non-programmable
  787.                                                 &&   1 = 80 col dor matrix
  788.                                                 &&   2 = 132 col dot matrix
  789.                                                 &&   3 = laser/inkjet
  790.         mPRNAME = SUBSTR(mPARM,3,36)            && Name of printer
  791.  
  792.          The escape sequences are sent to the printer by calling dBTools
  793.     function 11 with the appropriate seqcode:
  794.  
  795.             CALL DBTOOLS WITH "11,seqcode"
  796.  
  797.     See Appendix B for instructions on how to create Printer Definition
  798.     files.
  799.  
  800.     ----------------------------------------------------------------------=
  801.  
  802.     ■ READSCR, function 12 : read a screen image from a file into memory.
  803.          CALL DBTOOLS WITH "12, slot, filespec"
  804.  
  805.          The Slot number may be 1-3. Once in memory, the image may be disp-
  806.     layed by either using RESTORE (function 14) or FADE (function 8).
  807.  
  808.     ----------------------------------------------------------------------=
  809.  
  810.     ■ RECOLOR, function 13 : recolor an area of the screen without
  811.     changing the text.
  812.          CALL DBTOOLS WITH "13,ULR,ULC,LRR,LRC,FG,BG"
  813.  
  814.     Example:    CALL DBTOOLS WITH "13,10,15,17,45,11,1"
  815.  
  816.     ----------------------------------------------------------------------=
  817.  
  818.     ■ RESTORE, function 14 : write a screen image stored in memory to the
  819.     screen.
  820.          CALL DBTOOLS WITH "14,slotnumber,page"
  821.  
  822.          The slotnumber is 1-3 and must have had something stored in
  823.     it previously.
  824.          Page is 0-3.
  825.  
  826.     Example:  CALL DBTOOLS WITH "14,3,0,1"
  827.  
  828.  
  829.  
  830.     dBTools - dBASE III+ Enhancement Tools                  Page 14
  831.               (c) 1990 BERNATH COMPUTER
  832.  
  833.     ■ SAVESCR, function 15 : save current screen image into a memory
  834.     slot.
  835.          CALL DBTOOLS WITH "15,slotnumber"
  836.  
  837.          You may save up to 3 memory images simultaneously, numbered
  838.       1-3.
  839.  
  840.     --------------------------------------------------------------------
  841.  
  842.     ■ SCROLL, function 16 : scroll a portion of the screen.
  843.          CALL DBTOOLS WITH "16,ULR,ULC,LRR,LRC,FG,BG,numlines,direction"
  844.  
  845.          Numlines = number of lines to scroll.
  846.          Direction = 1, up.  Direction = 2, down.
  847.  
  848.     Example:
  849.  
  850.           DO WHILE .NOT. EOF()
  851.              @ 15,30 SAY TRIM(LAST_NAME)+", "+FIRST_NAME+SPACE(6)+SSN
  852.              CALL DBTOOLS WITH "16,5,25,15,70,7,1,1,1"
  853.              SKIP
  854.           ENDDO
  855.  
  856.     ----------------------------------------------------------------------=
  857.  
  858.     ■ SOUND, function 17 : sound the speaker.
  859.          CALL DBTOOLS WITH "17, frequency, duration"
  860.  
  861.          This function allows you to play musical notes. Entire tunes can
  862.     be played, but they are time consuming to code.
  863.          The legal frequency range is 50 to 17000 cycles per second (although
  864.     you shouldn't expect much sound out of a PC speaker at the frequency
  865.     extremes).
  866.          Duration is in clock tics, which are one eighteenth seconds (ie,
  867.     one second = 18).
  868.  
  869.     Example:
  870.          A sound equivalent to the TWIDDLE function 18 is:
  871.          CALL DBTOOLS WITH "17,300,3"
  872.          CALL DBTOOLS WITH "17,800,3"
  873.          CALL DBTOOLS WITH "17,1200,3"
  874.  
  875.     See Appendix C for a musical note to frequency conversion chart.
  876.  
  877.     ----------------------------------------------------------------------
  878.  
  879.     ■ TWIDDLE, function 18 : three note "twiddle" sound.
  880.          CALL DBTOOLS WITH "18"
  881.  
  882.          This function produces a "positive" audio feedback, as opposed to
  883.     the BLAT function above which produces a negative feedback. It can be
  884.     used as an alternative to BEEP or ? CHR(7).
  885.  
  886.  
  887.  
  888.     dBTools - dBASE III+ Enhancement Tools                  Page 15
  889.               (c) 1990 BERNATH COMPUTER
  890.  
  891.  
  892.     ■ UNPOP, function 19 : close a popup window.
  893.          CALL DBTOOLS WITH "19,windownumber"
  894.  
  895.          This function closes a popup window and restores the screen
  896.     data underneath the window. If you attempt to restore a windownumber
  897.     that has not previously been saved with the WINDOW command, an error
  898.     will result. Legal range for Windownumber is 1-24.
  899.  
  900.     ----------------------------------------------------------------------
  901.  
  902.     ■ VMENU, function 20 : vertical moving bar menu. Optional popup.
  903.  
  904.          There are two forms of the VMENU function, one that produces a    
  905.     popup menu that can be UNPOP'd, and one that just draws the menu on
  906.     the screen and leaves it up after you exit.
  907.  
  908.     Non-popup form:
  909.  
  910.          CALL DBTOOLS WITH "20,<Y>,choice,0,ULR,ULC,LRR,LRC,LowFG,LowBG,
  911.                             frame,shadow,HighFG,HighBG,Jus,item1,item2,
  912.                             item3,....,@"
  913.  
  914.  
  915.     Popup form:
  916.          CALL DBTOOLS WITH "21,windownumber,ULR,ULC,LRR,LRC,FG,BG,
  917.                             frame, shadow"
  918.          CALL DBTOOLS WITH "20,<Y>,choice,windownumber,HighFG,HighBG,Jus,
  919.                             item1,item2,....,@"
  920.  
  921.          Note that a window box must be opened with the WINDOW function
  922.     first (function 21), then the VMENU function is called with fewer para-
  923.     meters.
  924.  
  925.          Specifying a Windownumber of 0 signals the function that it is a
  926.     nonpopup type, and it will look for the box parameters.
  927.  
  928.          The LowFG and LowBG parameters specify both the window frame    
  929.     colors and the unhighlighted text colors.
  930.  
  931.          The Jus (justification) parameter controls whether the menu text
  932.     will be left justified (for Jus = 1), or centered in the box (for
  933.     Jus = 2).
  934.  
  935.           The box parameters are the same as in the BOX function (3).
  936.  
  937.           The up/down arrows, Home and End will position the highlight bar,
  938.     and <─┘ (Enter) selects the item. Or, pressing the first letter of the
  939.     menu item text will also select an item. Pressing the Escape key    
  940.     returns a value of 0.
  941.  
  942.  
  943.  
  944.     dBTools - dBASE III+ Enhancement Tools                  Page 16
  945.               (c) 1990 BERNATH COMPUTER
  946.  
  947.     Example:   Non-popup menu
  948.          mCHOICE = 1
  949.          mPARM = "20,"+STR(mCHOICE,2)+",0,5,10,9,35,14,4,1,1,12,0,2,"
  950.          mPARM = mPARM + "Data Entry,Reports,Utilities,Quit,@"
  951.          CALL DBTOOLS WITH mPARM
  952.          mCHOICE = VAL(mPARM)
  953.  
  954.     Example:   Popup Menu
  955.          CALL DBTOOLS WITH "21,1,5,10,9,35,14,4,1,1"  && Window function
  956.          mCHOICE = 1
  957.          mPARM = "20,"+STR(mCHOICE,2)+",1,12,0,2,"
  958.          mPARM = mPARM + "Data Entry,Reports,Utilities,Quit,@"
  959.          CALL DBTOOLS WITH mPARM
  960.          mCHOICE = VAL(mPARM)
  961.          CALL DBTOOLS WITH "19,1"                    && Unpop window
  962.  
  963.          If the optional Y parameter is specified, VMENU will also trap
  964.     and return the scancodes of the control keys pressed (see Appendix E)
  965.     in the 4th and 5th bytes, and the currently highlighted option in the
  966.     6th byte:
  967.  
  968.          mPARM = "20,Y,"+STR(mCHOICE,2)+",0,5,10,9,35,14,4,1,1,12,0,2,"
  969.          mPARM = mPARM + "Data Entry,Reports,Utilities,Quit,@"
  970.          CALL DBTOOLS WITH mPARM
  971.          mCHOICE = VAL(mPARM)
  972.          IF mCHOICE = 99                       && Fkey was pressed
  973.              mKEY  = ASC(SUBSTR(mPARM,4,1))-1  && Extract 1st scancode
  974.              mSCAN = ASC(SUBSTR(mPARM,5,1))-1  && Extract 2nd scancode
  975.              mCHOICE = ASC(SUBSTR(mPARM,6,1))  && Extract highlighted option
  976.          ENDIF
  977.     ----------------------------------------------------------------------
  978.  
  979.     ■ WINDOW, function 21 : open a popup window.
  980.          CALL DBTOOLS WITH "21, windownumber, ULR, ULC, LRR, FG, BG,
  981.                             frame, shadow"
  982.  
  983.          The parameters for WINDOW are similar to those of BOX,
  984.          except that the screen underneath the box is first saved in
  985.          memory. There is enough memory available to hold a bit more
  986.          than two full screens, so make sure you close them with UNPOP
  987.          afterwards to make the memory available to the heap again.
  988.          Valid windownumbers are 1-24.
  989.  
  990.     Example:
  991.          CALL DBTOOLS WITH "21,1,13,45,18,76,14,1,1,1"
  992.  
  993.  
  994.     dBTools - dBASE III+ Enhancement Tools                  Page 17
  995.               (c) 1990 BERNATH COMPUTER
  996.  
  997.     ■ PAGE, function 22 : set active page.
  998.           CALL DBTOOLS WITH "22,pagenum"
  999.  
  1000.           Color adapters (CGA, EGA, VGA) have actually 16k of memory set
  1001.           aside for video mapping. When in text mode, which requires only
  1002.           4k for a full screen, the remaining 12k can be written to
  1003.           "invisibly", and then activated later. The four video pages are
  1004.           numbered 0-3. You can use the DITHER, ATSAY, BOX, READSCR and
  1005.           RECOLOR functions to write to a page other than page 0, and then
  1006.           display it instantly by activating the page with this function.
  1007.  
  1008.      ---------------------------------------------------------------------
  1009.  
  1010.      ■ NOBLINK, function 23 : enable/disable blinking.
  1011.           CALL DBTOOLS WITH "23,blinkattr"
  1012.  
  1013.           This function enables you to choose between blinking color
  1014.           attributes or high intensity background colors (but not
  1015.           simultaneously).
  1016.  
  1017.               blinkattr=0,  disables blinking, enables high intensity BG
  1018.               blinkattr=1,  enables blinking, disables high intensity BG
  1019.  
  1020.           Note: use the * in dBASE to denote a blinking color.
  1021.           Example:  CALL DBTOOLS WITH "23,0"       && disable blinking
  1022.                     SET COLOR TO N/*GR,+GR/N       && black on yellow BG
  1023.      ---------------------------------------------------------------------
  1024.  
  1025.      ■ PALETTE, function 24 : set EGA/VGA color palette
  1026.           CALL DBTOOLS WITH "24,1,RR/VV,RR/VV,RR/VV,...."
  1027.           CALL DBTOOLS WITH "24,0"
  1028.  
  1029.           The EGA card has 16 color registers, so it can only display 16
  1030.           colors, numbered 0-15, at a time. However, the current set of 16
  1031.           colors may be chosen from a "palette" of 64 possible colors,
  1032.           numbered 0-63. The default color set consists of the colors:
  1033.  
  1034.             0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63
  1035.  
  1036.           corresponding to black, blue, green, cyan, red, magenta, brown,
  1037.           dark grey, grey, bright blue, bright green, bright cyan, bright
  1038.           red, bright magenta, yellow, and white.
  1039.  
  1040.           In the first version of the command, you can use function 24 to
  1041.           set from one to all 16 colors with one command.
  1042.  
  1043.                CALL DBTOOLS WITH "24,1,RR/VV,RR/VV,RR/VV,....."
  1044.  
  1045.           where RR is the register number 0-15 to change, and VV is the color
  1046.           value 0-63 to set it to. For example, to change brown to a nice
  1047.           orange color,
  1048.  
  1049.                 CALL DBTOOLS WITH "24,1,6/38"
  1050.  
  1051.           Now in dBASE whenever you access the color GR (which gives
  1052.           brown), it will appear orange. The change occurs immediately, so
  1053.           any brown areas on the screen will turn orange. You can get some
  1054.           interesting "animation" effects with this (see the demo Color
  1055.           Palette).
  1056.  
  1057.  
  1058.     dBTools - dBASE III+ Enhancement Tools                  Page 18
  1059.               (c) 1990 BERNATH COMPUTER
  1060.  
  1061.           Watch what combinations you use, because it can get very confusing
  1062.           executing a command like CALL EGAPAL WITH "1,2/37" and then setting
  1063.           your colors SET COLOR TO +GR/G and having it come out yellow on
  1064.           hot pink (yuk)!
  1065.  
  1066.           The entire palette can be reset to the default colors by
  1067.           executing the command:
  1068.  
  1069.                 CALL DBTOOLS WITH "24,0"
  1070.  
  1071.           Note that function 24 only works for EGA and VGA adapters. If
  1072.           you have a CGA adapter, function 24 will just return without doing
  1073.           anything.
  1074.  
  1075.           Table 1 below gives the 64 colors and an approximate description
  1076.           of their appearance, with the default colors in CAPS:
  1077.  
  1078.        Table 1
  1079.  
  1080.         0  BLACK (0)                     16 green black
  1081.         1  BLUE (1)                      17 dark blue violet
  1082.         2  GREEN (2)                     18 bright yellow green
  1083.         3  CYAN (3)                      19 light green
  1084.         4  RED (4)                       20 BROWN (6)
  1085.         5  MAGENTA (5)                   21 magenta
  1086.         6  olive                         22 bright yellow green
  1087.         7  GREY (7)                      23 light green
  1088.         8  blue black                    24 almost black
  1089.         9  bright blue                   25 bright blue
  1090.         10 med green                     26 bright green
  1091.         11 med blue                      27 bright cyan
  1092.         12 med red                       28 reddish brown
  1093.         13 blue violet                   29 purple
  1094.         14 olive                         30 yellow green
  1095.         15 light blue violet             31 light cyan
  1096.         32 almost black                  48 almost black
  1097.         33 dark blue violet              49 dark blue violet
  1098.         34 med green                     50 bright yellow green
  1099.         35 med cyan                      51 light green
  1100.         36 bright red                    52 red orange
  1101.         37 hot pink                      53 red violet
  1102.         38 orange                        54 yellow
  1103.         39 light pink                    55 light yellow
  1104.         40 almost black                  56 DARK GREY (8)
  1105.         41 bright blue                   57 BRIGHT BLUE (9)
  1106.         42 med green                     58 BRIGHT GREEN (10)
  1107.         43 light blue                    59 BRIGHT CYAN (11)
  1108.         44 bright red                    60 BRIGHT RED (12)
  1109.         45 bright magenta                61 BRIGHT MAGENTA (13)
  1110.         46 light orange                  62 YELLOW (14)
  1111.         47 light magenta                 63 WHITE (15)
  1112.  
  1113.  
  1114.  
  1115.     dBTools - dBASE III+ Enhancement Tools                  Page 19
  1116.               (c) 1990 BERNATH COMPUTER
  1117.  
  1118.  
  1119.      ■ GETKEY, function 25 : trap keystrokes and return unambiguous codes
  1120.           mPARM = "25,0"     no character echo,       OR
  1121.           mPARM = "25,1"     with character echo
  1122.           CALL DBTOOLS WITH mPARM
  1123.           mKEY = ASC(mPARM)-1
  1124.           mSCAN = ASC(SUBSTR(mPARM,2,1))-1
  1125.  
  1126.           Letter and number keys will return a unique value in mKEY, and
  1127.           mSCAN will be 0. Function and control keys will return mKEY = 0
  1128.           and a unique value in mSCAN. Of special interest is the ENTER key
  1129.           which returns mKEY=13 and mSCAN=0, and the ESC key which returns
  1130.           mKEY=27 and mSCAN=0.
  1131.           See the chart in Appendix E for a list of scancodes.
  1132.  
  1133.  
  1134.  
  1135.     dBTools - dBASE III+ Enhancement Tools                  Page 20
  1136.               (c) 1990 BERNATH COMPUTER
  1137.  
  1138.  
  1139.     ABOUT THE DEMO
  1140.  
  1141.         Included in the dBTools package is a demonstration program that
  1142.     illustrates the many features of dBTools. The source code is included,
  1143.     so it also acts as a tutorial on how to use dBTools.
  1144.  
  1145.         To run the demo you will require dBASE III+ or a dBASE compatible
  1146.     interpreter (this includes dBXL and QuickSilver, Foxbase, FoxPro, and
  1147.     dBASE IV. This version will not work with Clipper, but I will shortly
  1148.     have a version that does). The files DBT*.PRG and the .PRT printer
  1149.     definition files should be in the same subdirectory.
  1150.  
  1151.         Set up three environment variables:
  1152.  
  1153.             SET DBPATH=<path where the .PRG and .PRT files can be found>
  1154.             SET DBTOOLS=<path where the file DBTOOLS.BIN can be found>
  1155.             SET DBPRT=<name of .PRT printer definition file to load>
  1156.  
  1157.         select the subdirectory where dBASE is found:
  1158.  
  1159.             CD /DB3    (or wherever)
  1160.             DBASE <path>\DBTDEMO    (path is where DBTDEMO.PRG is found)
  1161.  
  1162.         For example, let's say you have dBASE in a subdirectory C:\DB3,
  1163.     and you copy all the necessary dBTools files into a subdirectory
  1164.     called C:\DBTOOLS. You could execute the demo with the following
  1165.     batch file:
  1166.  
  1167.                  DBPATH=C:\DBTOOLS
  1168.                  DBTOOLS=C:\DBTOOLS
  1169.                  DBTPRT=EPSONFX                  && or whatever
  1170.                  CD\DB3
  1171.                  DBASE C:\DBTOOLS\DBTDEMO
  1172.  
  1173.         This batch file is included in the dBTools package as GODEMO.BAT.
  1174.     If you are using subdirectories other than those in the example, you
  1175.     may modify GODEMO.BAT with a text editor.
  1176.  
  1177.     THE PROCEDURE DEMO
  1178.  
  1179.         The PROCDEMO programs can be setup in a similar way with batch files
  1180.     and environment variables. A sample batch file called PD.BAT is included
  1181.     which will work if all your files are in a subdirectory C:\DBTOOLS.
  1182.  
  1183.     SCREEN PAINTER
  1184.  
  1185.         Inquiries have been made as to how to create the screen images to
  1186.     use with the FADE command. I have included as a convenience in this
  1187.     distribution package PC Magazine's PAINT.COM, authored by Jeff Prosise.
  1188.     Doc's are in PAINT.DOC. Another excellent screen painter you can find
  1189.     on most BBS's is THEDRAW by Ian Davis.
  1190.  
  1191.  
  1192.  
  1193.     dBTools - dBASE III+ Enhancement Tools                 Page 21
  1194.               (c) 1990 BERNATH COMPUTER
  1195.  
  1196.  
  1197.     TECHNICAL SUPPORT
  1198.  
  1199.  
  1200.         If you are having problems using dBTools, or encounter a bug
  1201.     (get out the Raid!), I want to hear about it. I would like to say you
  1202.     can call our 24 hour toll free technical support line and one of our
  1203.     trained technical advisors will assist you, but I would be lying. The
  1204.     fact is, "BERNATH COMPUTER" is just me, Scott Bernardi, and I don't do
  1205.     this full time. I pastor a church AND I work a full time job as a
  1206.     management analyst and programmer (I do a lot of FoxPro programming).
  1207.  
  1208.         Therefore I am not always the easiest person to get a hold of. You
  1209.     may call me at (415) 778-4423 on Tuesday and Friday eves or on
  1210.     Saturday. During the day, try (415) 356-3664 (I'd rather you called me
  1211.     at home on evenings since this is my regular work number).
  1212.     For registered users, if you encounter a bug in dBTools, I'll send a fix
  1213.     out to you. You'll find me very responsive. In fact, the dBASE IV and
  1214.     QuickSilver compatible versions came about from user requests.
  1215.  
  1216.     For non registered users, I'll try to maintain the lastest version on
  1217.     the following BBS's:
  1218.  
  1219.            INFOLINC                 (415) 778-5929
  1220.            The File Bank            (619) 728-4318
  1221.            Bertha Board             (209) 239-9833
  1222.            Charisma                 (415) 349-6576
  1223.  
  1224.                      You may write to me at:
  1225.  
  1226.  
  1227.                         BERNATH COMPUTER
  1228.                         1821 Harding Court
  1229.                         Antioch, CA  94509
  1230.  
  1231.  
  1232.  
  1233.     
  1234.     dBTools - dBASE III+ Enhancement Tools                 Page 22
  1235.               (c) 1990 BERNATH COMPUTER
  1236.  
  1237.  
  1238.  
  1239.     REVISION HISTORY
  1240.  
  1241.  
  1242.     10/31/89 - Initial Release
  1243.  
  1244.  
  1245.     02/26/90 - Version 1.1. No bugs reported as yet. Function key support
  1246.                added to HMENU, VMENU, and PAUSE. Alternate message capability
  1247.                added for PAUSE.
  1248.                Demonstration procedure file added.
  1249.  
  1250.     03/15/90 - Version 1.11. If one of the sound commands were called right
  1251.                after loading dBTools, it would lock the computer. Fixed by
  1252.                adding the initialization function 0 to be called right after
  1253.                loading dBTools.
  1254.  
  1255.     05/10/90 - Version 1.2. Added the NOBLINK and PALETTE commands.
  1256.  
  1257.     06/29/90 - Version 1.21. Made some changes to make it run under dBASE IV
  1258.                and QuickSilver.
  1259.  
  1260.     07/09/90 - Version 1.22. Made some corrections to the documentation.
  1261.                PAINT.COM screen painter included.
  1262.                I decided to put a sharware message in the initialization
  1263.                routines, and raise the price to $25 (hey, people, I'm just
  1264.                being honest!). The only ones to receive version 1.21 were
  1265.                registered users.
  1266.  
  1267.     07/20/90 - Version 1.23.
  1268.                Added the GETKEY function.
  1269.                Added expanded function key trapping capability to HMENU,
  1270.                VMENU, and PAUSE.
  1271.                HMENU accepts a 0 or negative initial choices to bypass the
  1272.                wait for keystroke.
  1273.                Added the Pulldown Menu System code to the demo.
  1274.                Fixed a bug in the printer driver.
  1275.                Cleaned up some of the error messages.
  1276.  
  1277.  
  1278.  
  1279.     
  1280.     dBTools - dBASE III+ Enhancement Tools                 Page 23
  1281.               (c) 1990 BERNATH COMPUTER
  1282.  
  1283.  
  1284.     THINGS TO COME
  1285.  
  1286.     I'm currently working on Version 2.0 'PRO' of dBTools, which will add
  1287.     increased storage capacity for screens and windows, some more sound
  1288.     effects, MOUSE SUPPORT!!, "dialog buttons", enhanced menu capabilities,
  1289.     color schemes like FoxPro, online syntax help, the ability to use dBASE
  1290.     type color specifications (W/N, etc) or color numbers interchangably,
  1291.     string, encryption, and whatever else I might think of.
  1292.  
  1293.     Version 2.0 will not be distributed as shareware, so version 1.2x will
  1294.     be the last shareware versions available. The price of version 2.0 will
  1295.     probably be $45, but registered users of the shareware version will be
  1296.     given full credit for their registration towards Version 2.0.
  1297.  
  1298.     This is not an official announcement yet since I'm still working on it.
  1299.     When I'm finished, I'll probably put some kind of demo on the BBS's,
  1300.     and I'll notify registered users by mail.
  1301.  
  1302.     I'm also toying with the idea of a Clipper library version. I can get
  1303.     dBTools to work with Clipper right now, but it still uses the kludgey
  1304.     CALL interface which is necessary with all the other dBASE compilers
  1305.     and interpreters (if you're interested, contact me).
  1306.  
  1307.     Please use the questionaire/survey form to express your own ideas for
  1308.     what you'd like to see in dBTools.
  1309.  
  1310.     
  1311.     dBTools - dBASE III+ Enhancement Tools
  1312.               (c) 1990 BERNATH COMPUTER                      A-1
  1313.  
  1314.     APPENDIX A - ERROR MESSAGES
  1315.  
  1316.         The most common source of errors are incorrect parameter strings,
  1317.     or dBTools can't find a specified file. Upon encountering an error,
  1318.     dBTools will beep, blank the screen, print a diagnostic message about
  1319.     the error, print the offending parameter string, and pause for a key
  1320.     stroke. Upon receiving a keystroke, your dBASE program will continue
  1321.     with the next statement.
  1322.  
  1323.  
  1324.          1 : Invalid function.
  1325.              A function code outside the 1-25 range was specified.
  1326.  
  1327.          2 : Error in parameters.
  1328.              A missing or invalid parameter was specified in the parameter
  1329.              string.
  1330.  
  1331.          3 : Parameter out of range.
  1332.              A numeric parameter was specified outside its legal range.
  1333.              May also occur when the function is expecting numeric data
  1334.              but encounters alpha data.
  1335.  
  1336.          4 : Color monitor required.
  1337.              The Page function 22 requires a color monitor.
  1338.  
  1339.          5 : Invalid color attributes.
  1340.              A FG or BG color was specified outside the legal 0-15 range.
  1341.  
  1342.          6 : Invalid screen file.
  1343.              A file was specified in the READSCR function 12 that was not
  1344.              recognizable as a 4000 byte screen image.
  1345.  
  1346.          7 : Cannot restore a screen that hasn't been saved.
  1347.              Results from trying to call RESTORE function 14 before
  1348.              READSCR function 12 or SAVESCR function 15 has saved an
  1349.              image in the specified slot.
  1350.  
  1351.          8 : Invalid coordinates.
  1352.              Screen coordinates outside the row range of 0-24 or outside
  1353.              the column range of 0-79 have been specified.
  1354.  
  1355.          9 : Window hasn't been saved.
  1356.              An attempt to UNPOP a window with function 19 before it has
  1357.              been opened with function 21 will cause this error.
  1358.  
  1359.         10: Invalid window number.
  1360.             Legal range is 1-24.
  1361.  
  1362.  
  1363.     dBTools - dBASE III+ Enhancement Tools
  1364.               (c) 1990 BERNATH COMPUTER                      A-2
  1365.  
  1366.     APPENDIX A - ERROR MESSAGES
  1367.  
  1368.         11 : Not enough memory to save window.
  1369.              A limited amount of memory space is available (a bit more than
  1370.              two full screens) to store areas underneath windows, which can
  1371.              be exceeded by trying to maintain too many open windows at a
  1372.              time. If you make sure you UNPOP a window when you are done with
  1373.              it, you shouldn't encounter this error.
  1374.  
  1375.         12 : Error allocating HEAP space.
  1376.              Rarely will occur. Has to do with the allocating of memory space
  1377.              for popup windows or temporary buffers for files.
  1378.  
  1379.         13 : Invalid printer code file.
  1380.              The '@PRNDEF' in the first line of a .PRT file acts as a
  1381.              "signature" to determine whether the specified file is a valid
  1382.              printer definition file.
  1383.  
  1384.         14 : Invalid printer code.
  1385.              An attempt has been made to access an escape sequence outside
  1386.              the range defined for the currently loaded printer dfn file.
  1387.              The maximum value is stored in line 3 of the definition file.
  1388.              Maximum value is 48.
  1389.  
  1390.         15 : Invalid video page specified.
  1391.              Legal range is 0-3.
  1392.  
  1393.         16 : Error reading file.
  1394.              If a specified file is not found, or cannot be opened for some
  1395.              reason, this error will occur.
  1396.  
  1397.  
  1398.  
  1399.     dBTools - dBASE III+ Enhancement Tools
  1400.               (c) 1990 BERNATH COMPUTER                      B-1
  1401.  
  1402.     APPENDIX B - PRINTER DEFINITION FILES
  1403.  
  1404.         A printer definition file contains the escape codes that control
  1405.     the features of your printer. It can be created or modified with any
  1406.     text editor or word processor (in non document mode) that will produce
  1407.     a pure ASCII file. Or alternatively, a dBASE program and associated
  1408.     datafiles are included in the demo which maintain a database of printers,
  1409.     their available features, and the escape sequences to activate those
  1410.     features. Registration includes the right to incorporate the printer
  1411.     maintenance files into your application. Printer definition files can
  1412.     then be automatically created from this database (by far the easiest
  1413.     way to go!).
  1414.  
  1415.         Included in the dBTools package are definition files for five pop-
  1416.     ular printers (ones where I could get my hands on the manuals).
  1417.  
  1418.         A printer definition file can have any filename, but should have a
  1419.     .PRT extension. The first line of the file should have the word "@PRNDEF"
  1420.     (don't include the quotes) by itself, with no leading spaces.
  1421.  
  1422.         The second line of the file specifies the name/type of the printer,
  1423.     eg, EPSON FX-286e or whatever. This printer description can be up to 36
  1424.     characters long.
  1425.  
  1426.         The third line should be a number 0-3 which defines the printer type
  1427.     as follows:
  1428.                         0 = nonprogrammable
  1429.                         1 = 80 col dot matrix
  1430.                         2 = 132 col dor matrix
  1431.                         3 = laser/inkjet
  1432.  
  1433.         The following lines will be the actual escape sequences. Any number
  1434.     of escape sequences may be defined, up to 48. Each line should start with
  1435.     the sequence code (1-48), immediately followed by a colon (:), at least
  1436.     one space, and then the decimal equivalents of each escape sequence byte
  1437.     separated by commas. Up to 16 bytes may be included in a sequence.
  1438.  
  1439.         A sequence is terminated by an ending comma followed by the @ char-
  1440.     acter. This is mandatory. End the line with a carriage return.
  1441.  
  1442.         The last line of the file MUST be two '@' signs by themselves:
  1443.         @@
  1444.  
  1445.         The escape sequences can be anything you like, but you should main-
  1446.     tain consistency between files. This will enable you to program applica-
  1447.     tions with generic calls to dBTools to perform particular functions, no
  1448.     matter what printer is loaded at the time.
  1449.  
  1450.         Examine the included .PRT files for examples.
  1451.  
  1452.         To test your printer codes, run the demo and select the Printer
  1453.     Driver demonstration, or run PRTTEST within dBASE. Specify your new .PRT
  1454.     file as the one to load, and a test sheet will be printed.
  1455.  
  1456.  
  1457.     dBTools - dBASE III+ Enhancement Tools
  1458.               (c) 1990 BERNATH COMPUTER                      C-1
  1459.  
  1460.     APPENDIX C - Musical note versus Frequency Equivalency Chart
  1461.  
  1462.  
  1463.  
  1464.     Octave 0
  1465.     ---------------
  1466.     A           110
  1467.     Bb          117
  1468.     B           124
  1469.  
  1470.     Octave 1                  Octave 4                Octave 7
  1471.     ---------------           ---------------         ---------------
  1472.     C           131           C          1047         C          8372
  1473.     C# Db       139           C# Db      1109         C# Db      8870
  1474.     D           147           D          1175         D          9397
  1475.     D# Eb       156           D# Eb      1245         D# Eb      9956
  1476.     E           165           E          1319         E         10548
  1477.     F           175           F          1397         F         11175
  1478.     F# Gb       185           F# Gb      1480         F# Gb     11840
  1479.     G           196           G          1568         G         12544
  1480.     G# Ab       208           G# Ab      1661         G# Ab     13290
  1481.     A           220           A          1760         A         14080
  1482.     Bb          233           Bb         1865         Bb        14917
  1483.     B           247           B          1976         B         15804
  1484.  
  1485.     Octave 2                  Octave 5                Octave 8
  1486.     ---------------           ---------------         ---------------
  1487.     C           262           C          2093         C         16744
  1488.     C# Db       277           C# Db      2217
  1489.     D           294           D          2349
  1490.     D# Eb       311           D# Eb      2489
  1491.     E           330           E          2637
  1492.     F           349           F          2794
  1493.     F# Gb       370           F# Gb      2960
  1494.     G           392           G          3136
  1495.     G# Ab       415           G# Ab      3322
  1496.     A           440           A          3520
  1497.     Bb          466           Bb         3729
  1498.     B           494           B          3951
  1499.  
  1500.     Octave 3                  Octave 6
  1501.     ---------------           ---------------
  1502.     C           523           C          4186
  1503.     C# Db       554           C# Db      4435
  1504.     D           587           D          4698
  1505.     D# Eb       622           D# Eb      4978
  1506.     E           659           E          5274
  1507.     F           698           F          5587
  1508.     F# Gb       740           F# Gb      5919
  1509.     G           784           G          6271
  1510.     G# Ab       831           G# Ab      6644
  1511.     A           880           A          7040
  1512.     Bb          932           Bb         7459
  1513.     B           987           B          7902
  1514.  
  1515.  
  1516.  
  1517.     dBTools - dBASE III+ Enhancement Tools
  1518.               (c) 1990 BERNATH COMPUTER                      D-1
  1519.  
  1520.     APPENDIX D - Coding Pulldown Menu Systems
  1521.  
  1522.     With this version of dBTools, you can program pulldown menu systems
  1523.     with a selecting horizontal bar menu across the top for the main
  1524.     categories, and pulldown vertical bar menus when the horizontal pad is
  1525.     selected. When a vertical pulldown menu is visible, you can select the
  1526.     adjacent vertical menu by pressing the right or left arrow key
  1527.     (previous to this version, pressing the right or left arrow in a
  1528.     vertical menu would just beep).
  1529.  
  1530.     Alternatively you could use a "hotkey" to jump right into another
  1531.     vertical menu without having to cycle through intervening options. The
  1532.     ability to trap a hotkey also permits you to provide context sensitive
  1533.     popup help windows while in the menu system (eg, upon pressing Alt-h or
  1534.     something similar).
  1535.  
  1536.     It's much easier to give a demonstration than to try to explain it in
  1537.     English. The main demo menu is now coded in such a fashion, and the
  1538.     the "Pulldown menu system" selection off the Menus option also illustrates
  1539.     the new features. Also provided is a "skeleton" code module in the file
  1540.     CLOSET.PRG.
  1541.  
  1542.     Coding a pulldown menu system relies on two new dBTools features; the
  1543.     ability for HMENU to act upon an initial bar choice without waiting for
  1544.     a keystroke, and the ability for VMENU to trap and return FKey and
  1545.     control key combinations (Note: "control key" refers to non-ASCII keys
  1546.     such as the direction keys, function keys, Ins, Del, Home, End, PgUp,
  1547.     PgDn, plus standard ASCII keys in combination with Cntrl or Alt; eg,
  1548.     Alt-b or Cntrl-w). The scancodes that are returned by key combinations
  1549.     are listed in Appendix E.
  1550.  
  1551.     Coding HMENU with an initial choice of 0 will display the horizontal
  1552.     bar menus, but with no options highlighted. The function will
  1553.     immediately exit without pausing for a keystroke, and will return a
  1554.     value of -1 in the parameter string:
  1555.  
  1556.     HCHOICE = 0
  1557.     mMENUSTR="9,"+STR(HCHOICE,2)+",0,0,7,1,1,7,   Data Entry   ;
  1558.     ,   Reports   ,   Utilities   ,   Quit   ,@"
  1559.     CALL DBTOOLS WITH mMENUSTR
  1560.     HCHOICE = VAL(mMENUSTR)                && will return HCHOICE=-1
  1561.  
  1562.     Use of blanks in the menu items can space the menu out more.
  1563.  
  1564.     Coding HMENU with a NEGATIVE initial choice will draw the menu, high-
  1565.     light the initial choice, exit the menu without pausing for a key-
  1566.     stroke, and return a number which will be the absolute value of the
  1567.     initial choice. For example, if the first line in the code segment
  1568.     above was HCHOICE = -2, the menu would be drawn, 'Reports' would be
  1569.     highlighted, the menu would be exited immediately without waiting for a
  1570.     keystroke, and the last code line would return HCHOICE = 2.
  1571.  
  1572.  
  1573.  
  1574.     dBTools - dBASE III+ Enhancement Tools
  1575.               (c) 1990 BERNATH COMPUTER                      D-2
  1576.  
  1577.     The second scenario above permits you to act upon control keys "lower
  1578.     down" in your code to go through HMENU without having to manually
  1579.     select options.
  1580.  
  1581.     Secondly, VMENU, when defined with the Y option, will trap non-ASCII
  1582.     control keys:
  1583.          mKEY =ASC(SUBSTR(mMENUSTR,4,1))-1      && extract 1st scancode
  1584.          mSCAN=ASC(SUBSTR(mMENUSTR,5,1))-1      && extract 2nd scancode
  1585.          mCUROPT=ASC(SUBSTR(mMENUSTR,6,1))      && currently highlighted
  1586.                                                 && option
  1587.  
  1588.     Code segment:
  1589.  
  1590.     VCHOICE = 1
  1591.     DO WHILE VCHOICE<>0                               && vmenu loop
  1592.       CALL DBTOOLS WITH "21,3,1,5,6,20,14,1,1,1"      && define window
  1593.       mPARM="20,Y,"+STR(VCHOICE,2)+",3,14,0,2,Employees,Accounts,;
  1594.       Transactions,Report Titles,@"
  1595.       CALL DBTOOLS WITH mPARM
  1596.       VCHOICE = VAL(mPARM)
  1597.       DO CASE
  1598.         CASE VCHOICE = 0                        && ESC pressed
  1599.  
  1600.         CASE VCHOICE = 1                        && Employees selected
  1601.           DO EMPDE
  1602.         CASE VCHOICE = 2                        && Accounts selected
  1603.           DO ACCTDE
  1604.         CASE VCHOICE = 3                        && Transactions selected
  1605.           DO TRANDE
  1606.         CASE VCHOICE = 4                        && Report Titles selected
  1607.           DO RPTTTLDE
  1608.         CASE VCHOICE = 99                       && non-ASCII key pressed
  1609.           * A special procedure to processing control keys pressed. The 3rd
  1610.           * parm is the number of menu items, the last is the NAME of the
  1611.           * hotkey processor.
  1612.           DO TRAPIT WITH mPARM,HCHOICE,4,"HKPROC"
  1613.           EXIT
  1614.       ENDCASE
  1615.       CALL DBTOOLS WITH "19,3"                  && unpop window
  1616.     ENDDO                                       && terminate VCHOICE loop
  1617.  
  1618.     You'll have to experiment with VMENU's coordinate parameters to get it
  1619.     to line up with the HMENU options.
  1620.  
  1621.  
  1622.  
  1623.     dBTools - dBASE III+ Enhancement Tools
  1624.               (c) 1990 BERNATH COMPUTER                      D-3
  1625.  
  1626.     The above code module will handle the processing of the vertical pull-
  1627.     down menus. There would be a similar block of code for each of the
  1628.     HMENU options (ie, also one for Reports, Utilities, and Quit), nested
  1629.     inside another DO CASE coming off of HMENU:
  1630.  
  1631.     HCHOICE = 1
  1632.     DO WHILE HCHOICE<>0
  1633.       mMENUSTR="9,"+STR(HCHOICE,2)+",0,0,7,1,1,7,   Data Entry   ;
  1634.       ,   Reports   ,   Utilities   ,   Quit   ,@"
  1635.       CALL DBTOOLS WITH mMENUSTR
  1636.       HCHOICE = VAL(mMENUSTR)
  1637.       DO CASE
  1638.         CASE HCHOICE = 1
  1639.             * VMENU code block as above
  1640.         CASE HCHOICE = 2
  1641.             * VMENU code block for Reports
  1642.         CASE HCHOICE = 3
  1643.             * VMENU code block for utilities
  1644.         CASE HCHOICE = 4 .OR. HCHOICE = 0
  1645.             * VMENU code block to choose Exit to Dos or to Dot Prompt
  1646.       ENDCASE
  1647.     ENDDO
  1648.  
  1649.       What remains is the code for the TRAPIT procedure:
  1650.  
  1651.     *|----------------------------------------------
  1652.     PROCEDURE TRAPIT
  1653.     PARAMETERS mPARMSTR,HCHOICE,mMAXVAL,mHOTKEY
  1654.       mKEY=ASC(SUBSTR(mPARMSTR,4,1))-1
  1655.       mSCAN=ASC(SUBSTR(mPARMSTR,5,1))-1
  1656.       mCURVAL=ASC(SUBSTR(nPARMSTR,6,1))
  1657.  
  1658.       DO CASE
  1659.         CASE mSCAN = 75                         && west
  1660.           IF mCURVAL  = 1
  1661.              mRETVAL = mMAXVAL
  1662.           ELSE
  1663.              mRETVAL = HCHOICE - 1
  1664.           ENDIF
  1665.         CASE mSCAN = 77                         && east
  1666.           IF HCHOICE = mMAXVAL
  1667.             mRETVAL = 1
  1668.           ELSE
  1669.             mRETVAL = HCHOICE + 1
  1670.           ENDIF
  1671.         * Trap for hot keys
  1672.         CASE mSCAN = 35                         && Alt-h
  1673.           * you could write a routine for context sensitive help.
  1674.           DO DISPHELP WITH HCHOICE,mCUROPT
  1675.           mRETVAL = -HCHOICE
  1676.  
  1677.  
  1678.  
  1679.                  _______________________________
  1680.                         continued next page
  1681.  
  1682.  
  1683.  
  1684.     dBTools - dBASE III+ Enhancement Tools
  1685.               (c) 1990 BERNATH COMPUTER                      D-4
  1686.  
  1687.  
  1688.         ......continued.....
  1689.  
  1690.         OTHERWISE
  1691.           * call another procedure to do hotkey processing. This enables
  1692.           * you to use the same TRAPIT routine with different menus that
  1693.           * use hotkeys.
  1694.           IF mHOTKEY<>""
  1695.              DO &mHOTKEY
  1696.           ELSE
  1697.              ?? CHR(7)
  1698.              mRETVAL = -HCHOICE
  1699.           ENDIF
  1700.       ENDCASE
  1701.       HCHOICE = -mRETVAL
  1702.     RETURN
  1703.  
  1704.  
  1705.     *|-------------------------------------------------------------
  1706.     PROCEDURE HKPROC                            && hotkey processor
  1707.     PARAMETERS mKEY,mSCAN,HCHOICE
  1708.       DO CASE
  1709.         CASE mKEY=4 .AND. mSCAN=0               && Cntrl-d
  1710.           mRETVAL=1
  1711.         CASE mKEY=18 .AND. mSCAN=0              && Cntrl-r
  1712.           mRETVAL = 2
  1713.         CASE mKEY=21 .AND. mSCAN=0              && Cntrl-u
  1714.           mRETVAL = 3
  1715.         CASE mKEY=17 .AND. mSCAN=0              && Cntrl-q
  1716.           mRETVAL = 4
  1717.         OTHERWISE
  1718.           mRETVAL = -HCHOICE
  1719.           ?? CHR(7)
  1720.       ENDCASE
  1721.       HCHOICE = -mRETVAL
  1722.     RETURN
  1723.  
  1724.  
  1725.     A full implementation of this type of menu structure is found in the
  1726.     program files DBTMAIN.PRG and DBTPULDN.PRG, with some calls to procedures
  1727.     in DBTPROC.PRG. Also, a "skeleton" code module which you can modify is
  1728.     found in the file CLOSET.PRG.
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.     dBTools - dBASE III+ Enhancement Tools
  1735.               (c) 1990 BERNATH COMPUTER
  1736.  
  1737.     APPENDIX E - Scancode Values   displayed as KEY,SCANCODE. Combinations
  1738.                  which do not work are marked xxxxx.
  1739.  
  1740.         KEY     Normal     Shift     Cntrl     Alt
  1741.         -----   ------     -----     -----     -----
  1742.         F1       0,59       0,84      0,94     0,104
  1743.         F2       0,60       0,85      0,95     0,105
  1744.         F3       0,61       0,86      0,96     0,106
  1745.         F4       0,62       0,87      0,97     0,107
  1746.         F5       0,63       0,88      0,98     0,108
  1747.         F6       0,64       0,89      0,99     0,109
  1748.         F7       0,65       0,90      0,100    0,110
  1749.         F8       0,66       0,91      0,101    0,111
  1750.         F9       0,67       0,92      0,102    0,112
  1751.         F10      0,68       0,93      0,103    0,113
  1752.  
  1753.         West     0,75       0,75      0,115    xxxxx
  1754.         East     0,77       0,77      0,116    xxxxx
  1755.         North    0,72       0,72      xxxxx    xxxxx
  1756.         South    0,80       0,80      xxxxx    xxxxx
  1757.         Home     0,71       0,71      0,119    xxxxx
  1758.         End      0,79       0,79      0,117    xxxxx
  1759.         PgUp     0,73       0,73      xxxxx    xxxxx
  1760.         PgDn     0,81       0,81      xxxxx    xxxxx
  1761.         Ins      0,82       0,82      xxxxx    xxxxx
  1762.         Del      0,83       0,83      xxxxx    xxxxx
  1763.  
  1764.         Note: letters without Alt or Cntrl are searched for a first
  1765.               letter match in menus, beep if not found.
  1766.         a       xxxxx      xxxxx        1,0    0,30
  1767.         b       xxxxx      xxxxx        2,0    0,48
  1768.         c       xxxxx      xxxxx        ^C     0,46
  1769.         d       xxxxx      xxxxx        4,0    0,32
  1770.         e       xxxxx      xxxxx        5,0    0,18
  1771.         f       xxxxx      xxxxx        6,0    0,33
  1772.         g       xxxxx      xxxxx        beep   0,34
  1773.         h       xxxxx      xxxxx        8,0    0,35
  1774.         i       xxxxx      xxxxx        9,0    0,23
  1775.         j       xxxxx      xxxxx       10,0    0,36
  1776.         k       xxxxx      xxxxx       11,0    0,37
  1777.         l       xxxxx      xxxxx       12,0    0,38
  1778.         m       xxxxx      xxxxx       13,0    0,50
  1779.         n       xxxxx      xxxxx       14,0    0,49
  1780.         o       xxxxx      xxxxx       15,0    0,24
  1781.         p       xxxxx      xxxxx       xxxxx   0,25
  1782.         q       xxxxx      xxxxx       17,0    xxxxx
  1783.         r       xxxxx      xxxxx       18,0    xxxxx
  1784.         s       xxxxx      xxxxx       xxxxx   0,31
  1785.         t       xxxxx      xxxxx       20,0    0,20
  1786.         u       xxxxx      xxxxx       21,0    0,22
  1787.         v       xxxxx      xxxxx       22,0    0,47
  1788.         w       xxxxx      xxxxx       23,0    0,17
  1789.         x       xxxxx      xxxxx       24,0    0,45
  1790.         y       xxxxx      xxxxx       25,0    0,21
  1791.         z       xxxxx      xxxxx       26,0    0,44
  1792.  
  1793.  
  1794.     dBTools - dBASE III+ Enhancement Tools
  1795.               (c) 1990 BERNATH COMPUTER
  1796.  
  1797.     APPENDIX E - Scancode Values   displayed as KEY,SCANCODE
  1798.  
  1799.         KEY     Normal     Shift     Cntrl     Alt
  1800.         -----   ------     -----     -----     -----
  1801.         1        49,0    !  33,0     xxxxx     0,120
  1802.         2        50,0    @  64,0      ^C       0,121
  1803.         3        51,0    #  35,0     xxxxx     0,122
  1804.         4        52,0    $  36,0     xxxxx     0,123
  1805.         5        53,0    %  37,0     xxxxx     0,124
  1806.         6        54,0    ^  94,0     30,0      0,125
  1807.         7        55,0    &  38,0     xxxxx     0,126
  1808.         8        56,0    *  42,0     xxxxx     0,127
  1809.         9        57,0    (  40,0     xxxxx     0,128
  1810.         0        48,0    )  41,0     xxxxx     0,129
  1811.         `        96,0    ~ 126,0     xxxxx     xxxxx
  1812.         -        45,0    _  95,0     31,0      0,130
  1813.         =        61,0    +  43,0     xxxxx     0,131
  1814.         [        91,0    { 123,0     27,0      xxxxx
  1815.         ]        93,0    } 125,0     29,0      xxxxx
  1816.         \        92,0    | 124,0     28,0      xxxxx
  1817.         ,        44,0    <  60,0     xxxxx     xxxxx
  1818.         .        46,0    >  62,0     xxxxx     xxxxx
  1819.         /        47,0    ?  63,0     xxxxx     xxxxx
  1820.  
  1821.         ENTER    13,0       13,0     10,0      xxxxx
  1822.         ESC      27,0       xxxx     xxxxx     xxxxx
  1823.  
  1824.  
  1825.  
  1826.         VMENU and HMENU return the parameter string as
  1827.         "99 "+CHR(scancode)+CHR(highlighted)+CHR(0), which can be extracted
  1828.         as follows:
  1829.  
  1830.         choice = VAL(mMENUSTR)         && will return 99 if an Fkey was
  1831.                                        && pressed, 0 if ESC, or selected
  1832.                                        && option number
  1833.         IF choice = 99
  1834.             mKEY  = ASC(SUBSTR(mMENUSTR,4,1))-1
  1835.             mSCAN = ASC(SUBSTR(mMENUSTR,5,1))-1
  1836.             choice = ASC(SUBSTR(mMENUSTR,6,1))
  1837.         ENDIF
  1838.  
  1839.         The scancodes for an FKey/control key pressed during PAUSE and
  1840.         GETKEY are returned in the first and second byte of the paramter
  1841.         string:
  1842.              mKEY=ASC(mPARM)-1
  1843.              mSCAN=ASC(SUBSTR(mPARM,2,1))-1
  1844.  
  1845.  
  1846.  
  1847.  
  1848.     APPENDIX F - dBTools REGISTRATION FORM
  1849.  
  1850.  
  1851.                         dBTools version 1.23
  1852.                         (c) 1990 BERNATH COMPUTER
  1853.  
  1854.                                                 Date ____/____/____
  1855.  
  1856.         Name                ___________________________________________
  1857.  
  1858.         Address             ___________________________________________
  1859.  
  1860.         City, State, Zip    ___________________________________________
  1861.  
  1862.         Phone               (____)________________   Ext  _____
  1863.  
  1864.         Company Name        ___________________________________________
  1865.  
  1866.  
  1867.         Where you obtained dBTools (BBS number, if applicable):
  1868.  
  1869.         _______________________________________________________________
  1870.  
  1871.  
  1872.  
  1873.         ________  copies of dBTools with latest upgrade
  1874.                   disk at $25 each . . . . . . . . . . . . ____________
  1875.                   Each will receive its own serial number.
  1876.  
  1877.  
  1878.         ________  site license(s) at $40 (includes disk)   ____________
  1879.  
  1880.  
  1881.                   Shipping and handling  . . . . . . . . . ____________
  1882.                   Shipping is $1.50 for up to 3 disks.
  1883.                   We can send it COD for an additional
  1884.                   $5.00 COD charge.
  1885.                                                            ============
  1886.                                              TOTAL         $
  1887.  
  1888.  
  1889.                   Make checks payable to BERNATH COMPUTER
  1890.   
  1891.                   and send to:
  1892.  
  1893.  
  1894.                   BERNATH COMPUTER
  1895.                   1821 Harding Court
  1896.                   Antioch, CA 94509
  1897.  
  1898.  
  1899.                   Thank you, and God Bless!
  1900.  
  1901.  
  1902.                 BERNATH COMPUTER / 1821 Harding Court / Antioch, CA 94509
  1903.                 dBTools 1.23 QUESTIONAIRE / SURVEY
  1904.  
  1905.     I would like to get some feedback on the direction of dBTools, how you
  1906.     came across it, etc. Please fill out this form and send it in. Thanks.
  1907.  
  1908.  
  1909.        Name           ___________________________________________
  1910.        Address        ___________________________________________
  1911.        City/State/Zip ___________________________________________
  1912.        Phone          _______________________
  1913.        Date           _______________________
  1914.  
  1915.  
  1916.     1. Where/how did you obtain your copy of dBTools (if from a BBS, please
  1917.        give the BBS name and number. Include area code)?
  1918.  
  1919.        __________________________________________________________________
  1920.        __________________________________________________________________
  1921.        __________________________________________________________________
  1922.  
  1923.     2. Do you write dBASE programs for your own personal use, for work, or
  1924.        custom applications for others?
  1925.  
  1926.        __________________________________________________________________
  1927.        __________________________________________________________________
  1928.  
  1929.  
  1930.     3. What are some of the dBASE applications you have written, or are
  1931.        planning to write?
  1932.  
  1933.        __________________________________________________________________
  1934.        __________________________________________________________________
  1935.        __________________________________________________________________
  1936.        __________________________________________________________________
  1937.  
  1938.  
  1939.     4. What are some new features, changes, etc. you'd like to see incor-
  1940.        porated into dBTools?
  1941.  
  1942.        __________________________________________________________________
  1943.        __________________________________________________________________
  1944.        __________________________________________________________________
  1945.        __________________________________________________________________
  1946.        __________________________________________________________________
  1947.        __________________________________________________________________
  1948.        __________________________________________________________________
  1949.        __________________________________________________________________
  1950.  
  1951.  
  1952.     5. Other general comments about dBTools:
  1953.  
  1954.        __________________________________________________________________
  1955.        __________________________________________________________________
  1956.        __________________________________________________________________
  1957.        __________________________________________________________________
  1958.        __________________________________________________________________
  1959.        __________________________________________________________________
  1960.  
  1961.