home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / bptb11.zip / BPTB.DOC next >
Text File  |  1992-09-07  |  35KB  |  841 lines

  1.  
  2.  
  3.                            Basic Programmer's Toolbox
  4.                                (BPTB Version 1.0)
  5.                                Copyright (c) 1992
  6.  
  7.  
  8.  
  9.          The Basic Programmer's Toolbox is a collection of over 70 routines
  10.      and functions to help the Basic programmer bring their projects to
  11.      completion quickly and easily.  The files included on this disk should
  12.      include:
  13.  
  14.  
  15.      BPTB.DOC      Operations manual   (This file)
  16.  
  17.      QBXTLS.QLB    Quick Library for use with PDS 7.1
  18.      QBXTLS.LIB    LIB version for use with PDS 7.1
  19.      QBXTLS.INC    Include file for PDS 7.1
  20.  
  21.      QBTLS.QLB     Quick Library for QB 4.5
  22.      QBTLS.LIB     LIB version for use with QB 4.5
  23.      QBTLS.INC     Include file for QB 4.5
  24.  
  25.  
  26.          None of these files or this documentation may be copied or
  27.      distributed without the written permission from the author.  You are
  28.      free to use and distribute any program written using these routines
  29.      without any fee due only after completing the registration form, found
  30.      on the last page of this manual, and mailing it and the $25.00
  31.      registration fee to the author.  You will get a copy of the source
  32.      code for my program EZDOS with your registration.
  33.  
  34.          BPTB is written in both Basic and assembly.  I have elected to
  35.      write all of the routines in the Quick Library in Basic due to the
  36.      methods MS uses with certain internal functions and variables.  The
  37.      assembly version is only included in the linkable LIB library.  You
  38.      will note vast differences in performance using these routines within
  39.      the environment compared to use in the compiled version of your
  40.      program.
  41.  
  42.          The .LIB and .QLB files selected must be copied into the directory
  43.      listed under libraries in the "PATH" selection from the Quick Basic or
  44.      PDS menus.  The .INC file should be copied into the directory listed
  45.      for include files under the same menu selection.  Starting Quick Basic
  46.      or PDS with the "/L" switch will load the Basic Programmer's Toolbox
  47.      into your programming environment. ("QBX /L QBXTLS" or "QB /L QBTLS")
  48.  
  49.          The first line of your program should use the DEFINT command to
  50.      set the default variable type to INTEGER and then use the $INCLUDE
  51.      metacommand to properly declare all of the routines in the library.
  52.      See your QB 4.5 or PDS 7.1 documentation for more on these commands.
  53.      ( DEFINT A-Z )
  54.      ( REM $INCLUDE: 'QBXTLS.INC' )
  55.  
  56.      Note:   All variables that are not explicitly declared are assumed to
  57.              be of the type INTEGER (%).
  58.  
  59.      Basic Programmer's Toolbox 1.0                     Page 1 of 14
  60.  
  61.  
  62.  
  63.                                Table Of Contents
  64.  
  65.  
  66.      Date / Time Routines
  67.                 CLOCK............ 3           DAYOFWEEK........ 5
  68.                 DATE2NUMBER...... 5           NUMBER2DATE...... 10
  69.  
  70.      Display Routines
  71.                 CENTER........... 3           LEFTSCROLL....... 8
  72.                 CLEARSAVEDSCREENS 3           PAGEUP........... 10
  73.                 COMMAS........... 4           PAGEDOWN......... 10
  74.                 CURRENTCHAR...... 5           RESTORESCREEN.... 11
  75.                 CURRENTCOLOR..... 5           RIGHTSCROLL...... 12
  76.                 FADED............ 6           SAVEDSCREENS..... 12
  77.                 FADEIN........... 6           SAVESCREEN....... 12
  78.                 FADEOUT.......... 6           SETSAVED......... 12
  79.                 FIRSTCAP......... 7           SHADOW........... 12
  80.                 GETCOLOR......... 8
  81.  
  82.      Disk Drive Routines
  83.                 CHECKDRIVE....... 3           FILEEXISTS....... 6
  84.                 COPYFILE......... 4           FILEINFO......... 7
  85.                 CURDIR........... 4           FILESEARCH....... 7
  86.                 CURDRIVE......... 5           FINDFIRSTFILE.... 7
  87.                 DISKCAPACITY..... 5           FINDNEXTFILE..... 7
  88.                 DISKSPACE........ 5           TREE............. 13
  89.                 DRIVEOKAY........ 6
  90.  
  91.      Keyboard Routines
  92.                 ALTPRESSED....... 3           FLUSHKEYBOARDBUFF 7
  93.                 CAPLOCKON ....... 3           KEYPRESSED....... 8
  94.                 CARLOCKOFF....... 3           NUMLOCKOFF....... 10
  95.                 CTRLPRESSED...... 4           NUMLOCKON........ 10
  96.  
  97.      Mouse Routines
  98.                 MOUSEBUTTON...... 9           MOUSEON.......... 9
  99.                 MOUSEHORZ........ 9           MOUSESHOW........ 10
  100.                 MOUSEINSTALLED... 9           MOUSEVERT........ 10
  101.                 MOUSEOFF......... 9
  102.  
  103.      System Routines
  104.                 CHECKREBOOT...... 3           RUNPROGRAM....... 12
  105.                 COPYMEM.......... 4           VIDEOMODE........ 13
  106.                 DOSVERSION....... 6           VIDEOPAGE........ 13
  107.                 NOREBOOT......... 10          VIDEOSEGMENT..... 14
  108.                 REBOOT........... 11
  109.  
  110.      User Interface Routines
  111.                 CLOSEWINDOW...... 4           PASSWORD......... 11
  112.                 GETINPUT......... 8           PICKWINDOW....... 11
  113.                 INPUTBOX......... 8           PULLDOWN......... 11
  114.                 MENUBAR.......... 9           USERCHOICE....... 13
  115.                 MSGWINDOW........ 10          WINDOWCOLOR...... 14
  116.  
  117.  
  118.  
  119.      Basic Programmer's Toolbox 1.0                     Page 2 of 14
  120.  
  121.  
  122.  
  123.      ALTPRESSED             DECLARE FUNCTION altpressed% ()
  124.  
  125.           Parameters:  None.
  126.           Returns:     -1 if alt key is pressed.
  127.                         0 if alt key is not pressed.
  128.           Description: Returns the status of the keyboard's alt key at the
  129.                        time the function is called.
  130.  
  131.      CAPLOCKOFF             DECLARE SUB caplockoff ()
  132.      CAPLOCKON              DECLARE SUB caplockon ()
  133.  
  134.           Parameters:  None.
  135.           Returns:     None.
  136.           Description: These routines force the Caps Lock on or off.
  137.  
  138.      CENTER                 DECLARE SUB center (word$)
  139.  
  140.           Parameters:  word$ = string to be printed.
  141.           Returns:     None.
  142.           Description: This routine will print the string passed in word$
  143.                        centered equally right and left of the current
  144.                        cursor location.
  145.  
  146.      CHECKDRIVE             DECLARE FUNCTION checkdrive% (drive$)
  147.  
  148.           Parameters:  drive$ = letter of drive to check. ("" for default)
  149.           Returns:     0 if drive is ready for I/O.
  150.                        DOS error code if drive is not ready for I/O.
  151.           Description: Allows the programmer to check if a drive is ready
  152.                        for I/O to avoid an unwanted DOS error.
  153.  
  154.      CHECKREBOOT            DECLARE FUNCTION checkreboot% ()
  155.  
  156.           Parameters:  None.
  157.           Returns:     -1 if ALT-CTRL-DEL is disabled using noreboot.
  158.                         0 if ALT-CTRL-DEL is not disabled.
  159.           Description: Will allow the programmer to know if the noreboot
  160.                        routine has been called to disable the reboot
  161.                        interrupt. (See noreboot routine)
  162.  
  163.      CLEARSAVEDSCREENS      DECLARE SUB clearsavedscreens ()
  164.  
  165.           Parameters:  None.
  166.           Returns:     None.
  167.           Description: Resets the internal counter on the number of screens
  168.                        saved using the savescreen routine.
  169.  
  170.      CLOCK                  DECLARE FUNCTION clock$ ()
  171.  
  172.           Parameters:  None.
  173.           Returns:     The current system time
  174.           Description: Will return the current system time in standard time
  175.                        display format (11:37 AM).
  176.  
  177.  
  178.  
  179.      Basic Programmer's Toolbox 1.0                     Page 3 of 14
  180.  
  181.  
  182.  
  183.      CLOSEWINDOW            DECLARE SUB closewindow ()
  184.  
  185.           Parameters:  None.
  186.           Returns:     None.
  187.           Description: closes a message window created with the msgwindow
  188.                        routine.
  189.  
  190.      COMMAS                 DECLARE FUNCTION commas$ (number#, places%)
  191.  
  192.           Parameters:  Number# = number to format.
  193.                        places% = number of decimal places to display.
  194.           Returns:     Formatted display of number passed in number#.
  195.           Description: Can be used to pass a formatted number (with commas)
  196.                        to other print routines that require a string
  197.                        parameter.
  198.  
  199.      COPYFILE               DECLARE SUB copyfile (from$, to$)
  200.  
  201.           Parameters:  From$ = Name of file to copy from.
  202.                        To$   = Name of file to copy to.
  203.           Returns:     None.
  204.           Description: Allows the programmer to copy a file without the
  205.                        need to shell to DOS.  This will avoid unwanted DOS
  206.                        messages.
  207.  
  208.      COPYMEM                DECLARE SUB copymem (seg%, from%, to%, words%)
  209.  
  210.           Parameters:  Seg%  = segment of memory to use.
  211.                        From% = offset address to copy from.
  212.                        To%   = offset address to copy to.
  213.                        Words%= number of "words" (2 bytes) to copy.
  214.           Returns:     None.
  215.           Description: This will routine will copy the contents of one
  216.                        memory location to another.  Both locations must be
  217.                        within the same memory segment.  This routine copies
  218.                        word length (2 bytes) sections only.
  219.  
  220.      CTRLPRESSED            DECLARE FUNCTION ctrlpressed% ()
  221.  
  222.           Parameters:  None.
  223.           Returns:     -1 if ctrl key is pressed.
  224.                         0 if ctrl key is not pressed.
  225.           Description: Returns the status of the keyboards ctrl key at the
  226.                        time the function is called.
  227.  
  228.      CURDIR                 DECLARE FUNCTION curdir$ ()
  229.  
  230.           Parameters:  None.
  231.           Returns:     The name of the current default directory.
  232.           Description: Allows the programmer to find the current DOS
  233.                        directory.  This routine is included in the Quick
  234.                        Basic library only.
  235.  
  236.  
  237.  
  238.  
  239.      Basic Programmer's Toolbox 1.0                     Page 4 of 14
  240.  
  241.  
  242.  
  243.      CURDRIVE$              DECLARE FUNCTION curdrive$ ()
  244.  
  245.           Parameters:  None.
  246.           Returns:     Current DOS default drive letter.
  247.           Description: This routine allows the programmer to know what
  248.                        drive is currently active.
  249.  
  250.      CURRENTCHAR            DECLARE FUNCTION currentchar$ ()
  251.  
  252.           Parameters:  None.
  253.           Returns:     The character at the present cursor location.
  254.           Description: This routine allows the programmer to read the video
  255.                        memory at the current cursor location.
  256.  
  257.      CURRENTCOLOR           DECLARE SUB currentcolor (fg%, bg%)
  258.  
  259.           Parameters:  None.
  260.           Returns:     Fg% = current foreground color.
  261.                        Bg% = current background color.
  262.           Description: This routine allows the programmer to know what the
  263.                        current screen colors that the Basic program is
  264.                        using are.
  265.  
  266.      DATE2NUMBER            DECLARE FUNCTION date2number& (day$)
  267.  
  268.           Parameters:  Day$ = Valid date (mm/dd/yy) to convert.
  269.           Returns:     The Julian number for the date passed in day$.
  270.           Description: This routine will convert a valid date into the
  271.                        corresponding Julian date.  These numbers can then
  272.                        be used to calculate the number of days between two
  273.                        different dates.
  274.  
  275.      DAYOFWEEK              DECLARE FUNCTION dayofweek$ (day$)
  276.  
  277.           Parameters:  Day$ = Valid date (mm/dd/yy) to check.
  278.           Returns:     The day of the week that the date in day$ falls
  279.                        on ("Wednesday").
  280.           Description: This routine allows the programmer to determine what
  281.                        day of the week a date falls on.
  282.  
  283.      DISKCAPCITY            DECLARE FUNCTION diskcapacity& (drive$)
  284.  
  285.           Parameters:  Drive$ = letter of drive to check.
  286.           Returns:     Total capacity of the specified disk.
  287.           Description: This routine will inform the programmer of the
  288.                        capacity of any drive on the system.
  289.  
  290.      DISKSPACE              DECLARE FUNCTION diskspace& (drive$)
  291.  
  292.           Parameters:  Drive$ = letter of drive to check.
  293.           Returns:     Total free space of the specified disk.
  294.           Description: This routine will inform the programmer of the
  295.                        current free space of any drive on the system.
  296.  
  297.  
  298.  
  299.      Basic Programmer's Toolbox 1.0                     Page 5 of 14
  300.  
  301.  
  302.  
  303.      DOSVERSION             DECLARE FUNCTION dosversion! ()
  304.  
  305.           Parameters:  None.
  306.           Returns:     DOS version number
  307.           Description: This will allow the programmer to know what version
  308.                        of DOS the program is running under.
  309.  
  310.      DRIVEOKAY              DECLARE FUNCTION driveokay% (drive$)
  311.  
  312.           Parameters:  drive$ = drive letter to check.
  313.           Returns:     -1 if drive is ready for I/O.
  314.                         0 if drive is not ready for I/O.
  315.           Description: This routine will allow the programmer to check a
  316.                        given drive to avoid a DOS error.
  317.  
  318.      FADED                  DECLARE FUNCTION faded% ()
  319.  
  320.           Parameters:  None.
  321.           Returns:     -1 screen has been faded with the fadeout routine.
  322.                         0 screen has not been faded.
  323.           Description:  Allows the programmer to test if screen has been
  324.                         faded using the fadeout routine.
  325.  
  326.      FADEIN                 DECLARE SUB fadein ()
  327.  
  328.           Parameters:  None.
  329.           Returns:     None.
  330.           Description: restores a screen that has been faded with the
  331.                        fadeout routine. NOTE: SEE FADEOUT ROUTINE.
  332.  
  333.      FADEOUT                DECLARE SUB fadeout ()
  334.  
  335.           Parameters:  None.
  336.           Returns:     None.
  337.           Description: Fades a display screen to total black and saves the
  338.                        original screen.  It is okay to draw new screens
  339.                        while faded and then restore the new screen with the
  340.                        fadein routine.  NOTE: This routine has been tested
  341.                        with EGA and VGA only.  CGA cards might have
  342.                        problems with the fadein and fadeout routines.
  343.  
  344.      FILEEXISTS             DECLARE FUNCTION fileexists% (name$)
  345.  
  346.           Parameters:  name$ = File name (and path) to check.
  347.           Returns:     -1 if file exists.
  348.                         0 if file does not exists.
  349.           Description: This routine allows the programmer to determine if a
  350.                        given file exists.
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.      Basic Programmer's Toolbox 1.0                     Page 6 of 14
  360.  
  361.  
  362.  
  363.      FILEINFO               DECLARE SUB fileinfo (dta$,name$,size&,day$)
  364.  
  365.           Parameters:  dta$ = Disk Transfer Data returned by findfirstfile
  366.                               or findnextfile routines.
  367.           Returns:     name$ = Name of file returned.
  368.                        size& = Size of file returned.
  369.                        day$  = date of file returned.
  370.           Description: This routine allows the programmer to "de-code"
  371.                        information returned from the find file routines.
  372.  
  373.      FILESEARCH             DECLARE SUB filesearch (path$, name$(),
  374.                                                   size&(), when$(), count%)
  375.  
  376.           Parameters:  Path$ =  Path and/or name of the file to search for.
  377.                                 DOS wild-cards (* , ?) may be used.
  378.           Returns:     Name$()= array of file names found.
  379.                        size&()= array of file sizes found.
  380.                        when$()= array of file dates found.
  381.                        count% = Number of matching files found.
  382.           Description: With this routine the programmer can extract file
  383.                        information on a group of files.
  384.  
  385.      FINDFIRSTFILE          DECLARE SUB findfirstfile (path$,dta$,result%)
  386.  
  387.           Parameters:  Path$ = file specification to search for. DOS
  388.                                wild-cards (*,?) are permitted.
  389.           Returns:     Dta$  = DOS disk transfer area information.
  390.                        Result= 0 if a match was found or > 0 if no match is
  391.                                found.
  392.           Description: This routine (along with findnextfile routine)
  393.                        allows the programmer to search for and retrieve
  394.                        information on a group of files.
  395.  
  396.      FINDNEXTFILE           DECLARE SUB findnextfile (path$,dta$,result%)
  397.  
  398.           Parameters:  Same as Findfirstfile
  399.           Returns:     Sane as Findfirstfile
  400.           Description: See Findfirstfile.  This routine is used to search
  401.                        for the second and higher matching files.
  402.  
  403.      FIRSTCAP               DECLARE FUNCTION firstcap$ (word$)
  404.  
  405.           Parameters:  word$ = string to convert.
  406.           Returns:     A copy of word$ with the first letter upper case and
  407.                        the rest lower case.
  408.           Description: This routine can be used to assure all user input is
  409.                        formatted the same for displays.
  410.  
  411.      FLUSHKEYBOARDBUFF      DECLARE SUB flushkeyboardbuff ()
  412.  
  413.           Parameters:  None.
  414.           Returns:     None.
  415.           Description: This routine removes anything remaining in the
  416.                        keyboard buffer.
  417.  
  418.  
  419.      Basic Programmer's Toolbox 1.0                     Page 7 of 14
  420.  
  421.  
  422.  
  423.      GETCOLOR               DECLARE SUB getcolor (fg%, bg%)
  424.  
  425.           Parameters:  None.
  426.           Returns:     Fg% = foreground color.
  427.                        Bg% = background color.
  428.           Description: This routine returns color information about the
  429.                        display area at the current cursor location.
  430.  
  431.      GETINPUT               DECLARE SUB getinput (word$, length%, scode%)
  432.  
  433.           Parameters:  word$  = string to edit (optional).
  434.                        length = max number of characters to input.
  435.           Returns:     word$  = copy of the user input.
  436.                        scode  = scan code of extended keys if one was
  437.                                 pressed.
  438.           Description: This routine allows the programmer to restrict the
  439.                        number of characters the user may enter.  Pressing a
  440.                        "F" key will exit this return and return the scan
  441.                        code for the key pressed in scode.
  442.  
  443.      INPUTBOX               DECLARE SUB inputbox (word$,length%,scode%,
  444.                                                                 fg%,bg%)
  445.  
  446.           Parameters:  word$  = string to edit (optional).
  447.                        length = max number of characters to input.
  448.                        fg     = foreground color of input box.
  449.                        bg     = background color of input box.
  450.           Returns:     word$  = copy of user input.
  451.                        scode  = scan code of extended keys if one is
  452.                        pressed.
  453.           Description: This routine is the same as getinput, but allows
  454.                        the programmer to draw a input box in their choice
  455.                        of color.
  456.  
  457.      KEYPRESSED             DECLARE FUNCTION keypressed$ ()
  458.  
  459.           Parameters:  None.
  460.           Returns:     The key that was pressed.
  461.           Description: This routine will wait for the user to press a key
  462.                        and will return the key that was pressed.
  463.  
  464.      LEFTSCROLL             DECLARE SUB leftscroll (a$)
  465.  
  466.           Parameters:  a$ = The string to display.
  467.           Returns:     None.
  468.           Description: The string passed in a$ will be displayed at the
  469.                        current cursor location one letter at a time.
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.      Basic Programmer's Toolbox 1.0                     Page 8 of 14
  480.  
  481.  
  482.  
  483.      MENUBAR                DECLARE SUB menubar (menu$())
  484.  
  485.           Parameters:  menu$() = See "pulldown" routine.
  486.           Returns:     None
  487.           Description: This routine will draw the main menu bar that will
  488.                        be used by the pulldown routine.  This routine will
  489.                        only need to be called if the programmer wants to
  490.                        display this menu bar before a call to pulldown is
  491.                        made.
  492.  
  493.      MOUSEBUTTON            DECLARE FUNCTION mousebutton% ()
  494.  
  495.           Parameters:  None.
  496.           Returns:     The status of the mouse buttons at the time a call
  497.                        to this routine is made.
  498.           Description: This routine is used to test the status of the mouse
  499.                        buttons. Possible returns are:
  500.                             0 = No button pressed.
  501.                             1 = Left button pressed.
  502.                             2 = Right button pressed.
  503.                             3 = Left and right button pressed.
  504.                             4 = Center button pressed
  505.                             5 = Left and center button pressed.
  506.                             6 = Right and center button pressed.
  507.                             7 = All three buttons pressed.
  508.  
  509.      MOUSEHORZ              DECLARE FUNCTION mousehorz% ()
  510.  
  511.           Parameters:  None.
  512.           Returns:     Current horizontal location of mouse cursor.
  513.           Description: Used to get location of mouse cursor.
  514.  
  515.      MOUSEINSTALLED         DECLARE FUNCTION mouseinstalled% ()
  516.  
  517.           Parameters:  None.
  518.           Returns:     -1 if mouse driver has be initialized properly.
  519.                         0 if mouse driver has not been initialized.
  520.           Description: This routine allows the programmer to test if the
  521.                        mouse driver is present and ready to operate.
  522.  
  523.      MOUSEOFF               DECLARE SUB mouseoff ()
  524.  
  525.           Parameters:  None.
  526.           Returns:     None.
  527.           Description: This routine will turn the mouse cursor off.
  528.  
  529.      MOUSEON                DECLARE SUB mouseon ()
  530.  
  531.           Parameters:  None.
  532.           Returns:     None.
  533.           Description: This routine will install the mouse driver and
  534.                        activate the mouse cursor.  This routine must be
  535.                        called before any other mouse function will work.
  536.  
  537.  
  538.  
  539.      Basic Programmer's Toolbox 1.0                     Page 9 of 14
  540.  
  541.  
  542.  
  543.      MOUSESHOW              DECLARE SUB mouseshow ()
  544.  
  545.           Parameters:  None.
  546.           Returns:     None.
  547.           Description: This routine will turn the mouse cursor on after a
  548.                        call to mouseoff.
  549.  
  550.      MOUSEVERT              DECLARE FUNCTION mousevert% ()
  551.  
  552.           Parameters:  None.
  553.           Returns:     Current vertical location of mouse cursor.
  554.           Description: Used to get location of mouse cursor.
  555.  
  556.      MSGWINDOW              DECLARE SUB msgwindow (msg$())
  557.  
  558.           Parameters:  msg$() = message lines to display.
  559.           Returns:     None.
  560.           Description: Opens a window and displays the message lines passed
  561.                        in msg$().  This routine will automatically size the
  562.                          window and will locate it in the center of the
  563.                          screen.  Use the closewindow routine to remove the
  564.                          message window when complete.
  565.  
  566.      NOREBOOT               DECLARE SUB noreboot ()
  567.  
  568.           Parameters:  None.
  569.           Returns:     None.
  570.           Description: The first call to this routine will disable the
  571.                        Ctrl-Alt-Delete reboot process.  A second call to
  572.                        this routine will enable the reboot process.
  573.                        This routine will only work in your compiled version
  574.                        of the program.
  575.  
  576.      NUMBER2DATE            DECLARE FUNCTION number2date$ (number&)
  577.  
  578.           Parameters:  Number& = Julian number to decode.
  579.           Returns:     A string containing the date represented by number&.
  580.           Description: Decodes the Julian date number.
  581.  
  582.      NUMLOCKOFF             DECLARE SUB numlockoff ()
  583.      NUMLOCKON              DECLARE SUB numlockon ()
  584.  
  585.           Parameters:  None.
  586.           Returns:     None.
  587.           Description: These routine force the number lock key on or off.
  588.  
  589.      PAGEUP                 DECLARE SUB pageup (page%)
  590.      PAGEDOWN               DECLARE SUB pagedown (page%)
  591.  
  592.           Parameters:  page% = video page to copy.
  593.           Returns:     None.
  594.           Description: This routine will copy the contents of the video
  595.                        page% to the current display memory by scrolling the
  596.                        new page either up, or down.
  597.  
  598.  
  599.      Basic Programmer's Toolbox 1.0                     Page 10 of 14
  600.  
  601.  
  602.  
  603.      PASSWORD               DECLARE FUNCTION password% (word$)
  604.  
  605.           Parameters:  word$ = An Authorized password set by user.
  606.           Returns:     -1 if password matches.
  607.                         0 if password does not match.
  608.           Description: This routine opens a window and asks the user to
  609.                        enter a password.  It compares the user input to the
  610.                        password in word$ and returns the result.  If the
  611.                        password does not match, a warming message is
  612.                        displayed before the routine returns.
  613.  
  614.      PICKWINDOW             DECLARE FUNCTION pickwindow% (title$, msg$())
  615.  
  616.           Parameters:  title$ = title line to display in window.
  617.                        msg$() = array of possible selection text.
  618.           Returns:     the number of the item selected by the user.
  619.           Description: Allows the programmer to open a selection window for
  620.                        the user to enter a choice.  The user can use the
  621.                        cursor keys, the mouse, or the items number to make
  622.                        a selection.
  623.  
  624.      PULLDOWN               DECLARE SUB pulldown (menu$(), main%, sub%)
  625.  
  626.           Parameters:  Menu$() = This must be "DIM" as an array 10 x 10
  627.                              (DIM menu$(10,10)). Element 1,0 will hold
  628.                              the first "Main Menu" name, 2,0 the
  629.                              second, etc.  Element 1,1 would hold the
  630.                              first choice for Main Menu 1,0's selection
  631.                              list.  The first letter of each Main Menu
  632.                              selection list must be a different letter
  633.                              to allow the user to make a selection by
  634.                              pressing a letter key.
  635.           Returns:     main%  =  Number of the main menu selected.
  636.                        sub%   =  Number of the selected option.
  637.           Description: This complete pulldown menu system will allow your
  638.                        user to make selections by using the cursor keys,
  639.                        by using a mouse, or by typing the first letter of
  640.                        the selection wanted.
  641.  
  642.      REBOOT                 DECLARE SUB reboot ()
  643.  
  644.           Parameters:  None.
  645.           Returns:     None.
  646.           Description: This routine will perform a cold reboot of the
  647.                        user's system.
  648.  
  649.      RESTORESCREEN          DECLARE SUB restorescreen ()
  650.  
  651.           Parameters:  None.
  652.           Returns:     None.
  653.           Description: This routine will restore the last video display
  654.                        saved using the savescreen routine.
  655.  
  656.  
  657.  
  658.  
  659.      Basic Programmer's Toolbox 1.0                     Page 11 of 14
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.      RIGHTSCROLL            DECLARE SUB rightscroll (a$)
  667.  
  668.           Parameters:  a$ = string to display.
  669.           Returns:     None.
  670.           Description: See leftscroll
  671.  
  672.      RUNPROGRAM             DECLARE SUB runprogram (a$)
  673.  
  674.           Parameters:  a$ = program name to run.
  675.           Returns:     None.
  676.           Description: This routine will allow you to end your program and
  677.                        run any other type of program including batch files
  678.                        and .com programs.  It must be noted that this
  679.                        routine will work in your compiled program, but will
  680.                        not work from within QB or PDS.
  681.  
  682.      SAVEDSCREENS           DECLARE FUNCTION savedscreens% ()
  683.  
  684.           Parameters:  None.
  685.           Returns:     Number of screens in the savescreen routine buffer.
  686.           Description: Allows the programmer to check status of the
  687.                        savescreen routine buffer.
  688.  
  689.      SAVESCREEN             DECLARE SUB savescreen ()
  690.  
  691.           Parameters:  None.
  692.           Returns:     None.
  693.           Description: Saves the current video display to a savescreen
  694.                        buffer in video memory.  Note: You are only allowed
  695.                        to save 7 screens without a restorescreen command.
  696.  
  697.      SETSAVED               DECLARE SUB setsaved (number%)
  698.  
  699.           Parameters:  number% = number of highest saved screen to keep.
  700.           Returns:     None.
  701.           Description: Allows the programmer to reset the savedscreen
  702.                        routines buffer are.  all screens higher than
  703.                        number% will be lost.
  704.  
  705.      SHADOW                 DECLARE SUB shadow (number%)
  706.  
  707.           Parameters:  number% = number of columns to shadow.
  708.           Returns:     None.
  709.           Description: This routine is used to display the shadows around
  710.                        different windows in the library.
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.      Basic Programmer's Toolbox 1.0                     Page 12 of 14
  720.  
  721.  
  722.  
  723.      TREE                   DECLARE SUB tree (drive$, display$(),
  724.                                               dirname$(), count%)
  725.  
  726.           Parameters:  drive$     = drive letter to use.
  727.                        display$() = array to hold graphical display of
  728.                                     tree.  I suggest that this array be DIM
  729.                                     to 250.
  730.                        dirname$() = array to hold proper name of each
  731.                                     directory found.
  732.           Returns:     display$() = a graphical display of the complete
  733.                                     directory tree.  Each element in the
  734.                                     array will carry the next directory in
  735.                                     the tree.
  736.                        dirname$() = a parallel array to display$() that
  737.                                     will contain the proper directory name
  738.                                     for each directory found.
  739.                        count%     = the total number of directories found.
  740.           Description: Allows the programmer to both read and display
  741.                        directory information for the user's system.
  742.  
  743.      USERCHOICE             DECLARE FUNCTION userchoice$ (str$, f%, m%)
  744.  
  745.           Parameters:  str$ = string of ever allowable user selection.
  746.                        f%   = 0 if you do not want to return if a "F" key
  747.                               is pressed or 1 if you do.
  748.                        m%   = 0 if you do not want to return if a
  749.                               mousebutton is pressed or 1 if you do.
  750.           Returns:     The users selection.
  751.                        f% = if f%=1 at the call it will return the "F" key
  752.                             number if one was pressed (1-10).  If m%=1 at
  753.                             the call it will return the vertical position
  754.                             of the mouse cursor at the time a mousebutton
  755.                             was pressed.
  756.                        m% = if m%=1 at the call it will return the
  757.                             horizontal position of the mouse at the time a
  758.                             mousebutton was pressed.
  759.           Description: Allows the programmer to ask for the user's
  760.                        selection and restrict the possible keys that
  761.                        can be used.
  762.  
  763.      VIDEOMODE              DECLARE FUNCTION videomode% ()
  764.  
  765.           Parameters:  None.
  766.           Returns:     The current video mode setting.
  767.           Description: Allows the programmer to test for the current video
  768.                        mode setting.
  769.  
  770.      VIDEOPAGE              DECLARE FUNCTION videopage% ()
  771.  
  772.           Parameters:  None.
  773.           Returns:     The current video display page.
  774.           Description: Allows the programmer to test for the active video
  775.                        display page.
  776.  
  777.  
  778.  
  779.      Basic Programmer's Toolbox 1.0                     Page 13 of 14
  780.  
  781.  
  782.  
  783.      VIDEOSEGMENT           DECLARE FUNCTION videosegment% ()
  784.  
  785.           Parameters:  None.
  786.           Returns:     The video segment of the user's system.
  787.           Description: Allows the programmer to know where the user's video
  788.                        display memory is located.
  789.  
  790.      WINDOWCOLOR            DECLARE SUB windowcolor (fg%,bg%)
  791.  
  792.           Parameters:  fg% = foreground color to use.
  793.                        bg% = background color to use.
  794.           Returns:     None.
  795.           Description: Allows the programmer to select what color the
  796.                         various window and menu routines will use.
  797.  
  798.  
  799.      *********************************************************************
  800.                                Registration Form
  801.  
  802.  
  803.         Name: ________________________________________________________
  804.  
  805.      Address: ________________________________________________________
  806.  
  807.         City: __________________________  ST: _____  ZIP: ____________
  808.  
  809.  
  810.  
  811.      Where did you find your copy of BPTB? ___________________________
  812.  
  813.      What size disk do you want your copy on? 5 1/4" ____  3 1/2" ____
  814.  
  815.      Comments Are Always Welcome:
  816.  
  817.      _____________________________________________________________________
  818.  
  819.      _____________________________________________________________________
  820.  
  821.      _____________________________________________________________________
  822.  
  823.  
  824.      Please mail this form and the $25.00 registration fee to:
  825.  
  826.                                    Bill Smith
  827.                                104 Brentwood Way
  828.                             Simpsonville, SC  29681
  829.  
  830.  
  831.  
  832.  
  833.      Note:  I now maintain a file area on "The Programmer's Forum" at
  834.            (803) 862-4616 that will always have the current version of
  835.            this and all my software.  Downloads are permitted on the first
  836.            call.
  837.  
  838.  
  839.      Basic Programmer's Toolbox 1.0                     Page 14 of 14
  840.  
  841.