home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progbas / pbclon18.arj / PBCLONE.DOC < prev    next >
Text File  |  1992-04-22  |  48KB  |  1,027 lines

  1.                      The PBClone Library
  2.                    =---------------------=
  3.                          Version 1.8
  4.  
  5.     PBCLONE  Copyright (c) 1990-1992  Thomas G. Hanlin III
  6.  
  7.  
  8.  
  9. This library is too large for the QB/QBX compilers to handle
  10. conveniently as a unit. The Library Wizard utility (available
  11. separately as LIBWIZxx.ZIP) allows you to create custom
  12. libraries containing just the routines you need.
  13.  
  14. This is PBClone, a library of assembly language and BASIC
  15. routines for use with QuickBASIC version 4.5.  Full support for
  16. other recent compilers is provided with registration (QB
  17. 4.0-4.5, BC 6.0-7.1).  The PBClone collection is copyrighted
  18. and may be distributed only according to the following rule:
  19.  
  20.    All PBClone files must be distributed together as a unit in
  21.    unmodified form.  No files may be left out or added.
  22.  
  23. You use this library at your own risk.  It has been tested by
  24. me on my own computer, but I will not assume any responsibility
  25. for any problems which PBClone may cause you.  If you do
  26. encounter a problem, please let me know about it, and I will do
  27. my best to verify and repair the error.
  28.  
  29. It is expected that if you find PBClone useful, you will
  30. register your copy. You may not use PBClone routines in
  31. programs intended for sale unless you have registered.
  32. Registration entitles you to receive the latest version of
  33. PBClone, complete with full source code in assembly language
  34. and BASIC.  The assembly code is designed for the MASM 6.0
  35. assembler and may require minor modifications if you wish to
  36. use it with OPTASM, TASM, or earlier versions of MASM.  You
  37. will be able to compile the BASIC code with whatever version of
  38. the compiler you have, allowing you to use PBClone with
  39. QuickBASIC versions 4.0 - 4.5 and BASCOM versions 6.0 - 7.1.
  40. Note that Microsoft's "far strings" are only supported if you
  41. recompile the BASIC sources, so if you need 'em... register!
  42.  
  43. Special thanks to the beta testers who have helped keep the
  44. bugs away from PBClone:
  45.  
  46.    Michael Boling, John Krytus, Ken Prevo, Jeff Sabatini,
  47.    and Larry Winslow.
  48.  
  49.                      Creating .QLB files
  50.  
  51.  
  52.  
  53. If you like to use the QB or QBX editor/environment, you will
  54. need to create a .QLB version of the library to complement the
  55. .LIB version.  This is done using the LINK.EXE utility that
  56. came with your compiler.  The exact parameters differ slightly
  57. depending on which version of the compiler you have.  For
  58. QuickBASIC, it looks something like this:
  59.  
  60.    LINK libname.LIB/Q/SE:1024,libname.QLB,NUL,BQLB45;
  61.  
  62. The BQLB45 file is for QuickBASIC 4.5.  This should be replaced
  63. by BQLB40 or BQLB41 for QuickBASIC 4.0 (check your files to see
  64. which you have).  For BASCOM 6.0-7.1, also called Professional
  65. Development System or PDS, use QBXQLB instead of BQLB45.
  66.  
  67. Since you'll probably want to do this again in the future when
  68. you get a new version of BasWiz or PBClone, I'd suggest you
  69. create a batch file or alias to do the work for you.  If you
  70. have 4DOS, an alias such as the following will do it:
  71.  
  72.    ALIAS QLB LINK %%1.LIB/Q/SE:512,%%1.QLB,NUL,BQLB45;
  73.  
  74. In this case, you can do the conversion simply by typing:
  75.  
  76.    QLB libname
  77.  
  78.                      The TSR File Viewer
  79.  
  80.  
  81.  
  82. Since there are hundreds of routines in PBClone, it isn't
  83. always exactly easy to remember which routine you want or how
  84. to use it.  This is a particular problem when you're in the
  85. middle of writing a program.  So, I've written a TSR file
  86. viewer... it's crude, but it gets the job done.
  87.  
  88. Just type "FV" to install the TSR.  Alt-V activates it.  "FV
  89. /D" removes it from memory.
  90.  
  91.      !!! ----== NOTE ==---- !!!
  92. Please check FV with a nonessential application first!  It
  93. appears to work fine in the QuickBASIC environment, but it
  94. locks up my favorite editor, so I can't guarantee that it will
  95. behave properly in all circumstances.
  96.  
  97. First, FV will ask you for the file to view.  This may contain
  98. drive and subdirectory information as well as the file name.
  99. Second, you will be asked for a search string.  If you enter a
  100. search string, viewing will start at the part of the file that
  101. contains that search string.  If you just press enter, viewing
  102. will start at the beginning of the file.  The file will be
  103. presented to you one page at a time.  I suggest viewing
  104. PBCLONE.INF or PBCLONE.MAN.
  105.  
  106. FV was written in BASIC using Crescent's PDQ library, with the
  107. "simplified" TSR handler (which doesn't seem to have been
  108. entirely debugged).  Then again, TSRs are a tricky matter,
  109. especially with BASIC...
  110.  
  111.                         General Notes
  112.  
  113.  
  114.  
  115. The initial version of PBClone had only one manual.  However,
  116. since there are so many routines, I've split the manual into a
  117. general documentation file and two reference manuals.  You
  118. won't want to print PBCLONE1.MAN and PBCLONE2.MAN unless you
  119. have a lot of time and printer paper!  In contrast, this file
  120. (PBCLONE.DOC) has been kept small to allow ready printing.  It
  121. contains general notes, cross-reference listings of the
  122. routines, and assorted charts.
  123.  
  124. Many of the routines in PBClone are similar to routines of the
  125. same name in ADVBAS and/or ProBas.  The key here is "similar"--
  126. they don't necessarily work the same way and may not produce
  127. the same results.  If you intend to convert from ADVBAS or
  128. ProBas to PBClone, read the documentation carefully.
  129.  
  130. When a PBClone returns a Boolean (on or off) value, it will
  131. always be 0 if off, -1 if on; this is unlike ProBas, which
  132. would often return any non-zero value for an "on" state.
  133. Booleans passed to PBClone may still use any non-zero value to
  134. indicate a "true" or "on" condition, however.
  135.  
  136. Critical error handling has been incorporated into all disk and
  137. device routines.  You will never have to worry about "R>etry,
  138. A>bort, I>gnore" again, so long as you use PBClone for your
  139. disk and device management.
  140.  
  141. PBClone file handling is very flexible but may be confusing to
  142. people used to BASIC's strongly-moded files.  PBClone file
  143. handling is most similar to BASIC files opened in BINARY mode.
  144. You may read or write any amount of information at a time.
  145. After each read or write takes place, the file pointer is
  146. updated appropriately, so you can use sequential access
  147. techniques without further effort.  Random access is also
  148. possible, using FSetLoc/FSetOfs/FSetRec to set the file pointer
  149. position.  Those of you who are familiar with C or Pascal file
  150. handling will notice strong similarities in this approach,
  151. which is based on techniques that have long been standard in
  152. the industry.
  153.  
  154. Many routines are available both as SUBprograms and as
  155. FUNCTIONs.  The former is for compatibility with older programs
  156. which were designed before BASIC was capable of using
  157. FUNCTIONs.  You may use either, of course, although the
  158. FUNCTION version of a routine is often more convenient.
  159.  
  160.                         General Notes
  161.  
  162.  
  163.  
  164. The PBClone library can be used in conjunction with other
  165. libraries.  If there is a conflict in routine names between the
  166. two libraries, the OBJTOOL utility can be used to rename one or
  167. the other routine.  Due to the large size of PBClone, you will
  168. probably need to select just the routines you need, rather than
  169. combining the entire libraries, in order to avoid overflowing
  170. LINK limitations.  OBJTOOL can help you find out which routines
  171. are in what modules.  The LIB utility can be used to alter
  172. existing libraries, or you can build your own custom libraries
  173. from the ground up, using LIBWIZ.  See the LIBRARY.TXT file if
  174. you are not familiar with libraries.
  175.  
  176. OBJTOOL is included on the sampler disk that comes with the
  177. registered version of PBClone.  It may also be available at
  178. your local BBS.
  179.  
  180. If you have not used ADVBAS, ProBas, or PBClone before, you may
  181. be unfamiliar with the array handling conventions used here.
  182. In almost all array routines, you will see a pair of parameters
  183. (e.g. DSeg% and DOfs%) used to represent an array.  These
  184. values are obtained by the BASIC functions VARSEG and VARPTR:
  185.  
  186.    DSeg% = VARSEG(Array(1))    ' or whatever the first...
  187.    DOfs% = VARPTR(Array(1))    ' ...desired element may be
  188.  
  189. This is the way that current versions of QuickBASIC and BASCOM
  190. pass arrays, TYPEd values, and fixed-length STRING values to
  191. assembly-language routines. It tells the routine where in
  192. memory to find the value(s).  Since these values may move
  193. around in memory, it is important to get the VARSEG and VARPTR
  194. just before you call the routine.  Any routine that accepts a
  195. segment and an offset can be used with arrays, TYPEd values,
  196. and fixed-length strings interchangeably.  This allows for
  197. considerable flexibility.
  198.  
  199. Virtually all of the variables used in PBClone are integers.
  200. In this manual, integers are indicated specifically by use of
  201. the "%" integer postfix.  The use of DEFINT A-Z in your program
  202. will cause your variables to be integers by default, which I
  203. would recommend unless you use floating point heavily.
  204.  
  205.                         General Notes
  206.  
  207.  
  208.  
  209. Most of the routines in ProBas (and all of the routines in
  210. ADVBAS) did not require a DECLARE if the CALL syntax was used.
  211. This is not true of PBClone, which requires DECLAREs.  There
  212. are numerous advantages to this:
  213.  
  214.    1) BASIC can more easily detect syntax errors.
  215.    2) You may use CALL or the new simplified syntax.
  216.    3) Many of the routines are smaller and faster due to
  217.       options that are only available when DECLARE is used.
  218.  
  219. The DECLAREs are generated in a .BI file by LIBWIZ.  Assuming
  220. you named the library PBC, you can include the DECLAREs in your
  221. program with this statement:
  222.  
  223.    REM $INCLUDE: 'PBC.BI'
  224.  
  225. The PBC.BI file must be in the same directory as your program,
  226. or you can put it into a specific directory by setting an
  227. environment variable.  I keep my include files in a directory
  228. called C:\INCLUDE, so I have the following line in my
  229. AUTOEXEC.BAT:
  230.  
  231.    SET INCLUDE=C:\INCLUDE
  232.  
  233. As mentioned, there are now two ways of calling any
  234. subprogram.  You can use the CALL keyword or an implicit call.
  235. In the case of the CopyFile routine, for instance, you could
  236. use either of these calls interchangeably:
  237.  
  238.    CALL CopyFile (FromFile$, ToFile$, ErrCode%)
  239.  
  240.    CopyFile FromFile$, ToFile$, ErrCode%
  241.  
  242. How you capitalize the names of the variables and routines is
  243. up to you.  I like mixed uppercase and lowercase, but it really
  244. doesn't matter.  You can also change the names of the variables
  245. or even replace them with constants, as long as you maintain
  246. the correct type:
  247.  
  248.    COPYfile "C:\AUTOEXEC.BAT", "A:AUTOEXEC.BAT", errornumber%
  249.  
  250. One oddity in QuickBASIC is that it can get confused if you
  251. have a variable that has the same name as a subprogram or
  252. function.  The routine in PBClone which is most likely to be
  253. affected by this is called Month.  Instead of calling a month
  254. variable Month$ or Month%, use names like MonthName$ and
  255. MonthNr% instead.
  256.  
  257.                         General Notes
  258.  
  259.  
  260.  
  261. If you have registered PBClone and wish to recompile all of the
  262. routines written in BASIC, first place these routines in their
  263. own directory.  Then:
  264.  
  265.    FOR %x IN (*.BAS) DO BC %x /o;
  266.  
  267. Of course, you can use whatever switches you like.  I find "/o"
  268. sufficient for my own purposes.  Note that you will need to use
  269. "%%x" instead of "%x" if you place this statement in a batch
  270. file.
  271.  
  272. The same approach works for reassembling with MASM.  Note that
  273. if you wish to create a far string version of PBClone (for QBX
  274. or BASCOM 7.x "PDS"), you should use the switch "/Fs" with BC,
  275. or "/DFarString" with MASM.
  276.  
  277. The DEMO program, as of PBClone v1.5 at least, was linked with
  278. both PBClone and Crescent's PDQ library.  Of course, DEMO does
  279. not require PDQ, but using PDQ makes the resulting .EXE file
  280. much smaller.  If you do not have PDQ, you can create a new
  281. DEMO.EXE by running CREATE.BAT.  If you are a PDQ owner, you
  282. may prefer this:
  283.  
  284.    LINK DEMO/NOD/NOE/EX,,NUL,PBC+PDQ;
  285.  
  286. If you find any bugs or problems with PBClone, or have any
  287. suggestions to make, please let me know.  You can reach me
  288. through any of the BBSes listed in WHERE.BBS, or write to me by
  289. conventional mail.  Please DO NOT call me directly!  I loathe a
  290. ringing phone.  Phones were meant for modem use only!
  291.  
  292.                       Routine Reference
  293.  
  294.  
  295.  
  296. Array Management:
  297.    AddMatI       add to each element of an integer array
  298.    AddMatL       add to each element of a long integer array
  299.    BinSeekD      search a sorted array of double-precision nos.
  300.    BinSeekI      search a sorted array of integers
  301.    BinSeekL      search a sorted array of long integers
  302.    BinSeekS      search a sorted array of single-precision nos.
  303.    BinSeekSt     search a sorted array of strings
  304.    DRecDel       delete a record or element from an array
  305.    DRecIns       insert a record or element into an array
  306.    InitPtr       initialize an array of pointers
  307.    MeanAverageD  calculate the average of a double-prec. array
  308.    MeanAverageI  calculate the average of an integer array
  309.    MeanAverageL  calculate the average of a long integer array
  310.    MeanAverageS  calculate the average of a single-prec. array
  311.    MulMatI       multiply each element of an integer array
  312.    PSortD        pointer-sort a double-prec. array
  313.    PSortI        pointer-sort an integer array
  314.    PSortL        pointer-sort a long integer array
  315.    PSortS        pointer-sort a single-prec. array
  316.    PSortSt       pointer-sort a string array
  317.    ReverseD      reverse the elements in a double-prec. array
  318.    ReverseI      reverse the elements in an integer array
  319.    ReverseL      reverse the elements in a long integer array
  320.    ReverseS      reverse the elements in a single-prec. array
  321.    ReverseSt     reverse the elements in a string array
  322.    SetMatI       set each element of an integer array
  323.    SetMatL       set each element of a long integer array
  324.    SortD         sort an array of double-precision numbers
  325.    SortI         sort an array of integers
  326.    SortL         sort an array of long integers
  327.    SortS         sort an array of single-precision numbers
  328.    SortSt        sort an array of strings
  329.  
  330.                       Routine Reference
  331.  
  332.  
  333.  
  334. Disk:
  335.    BootDrive     determine the drive used to boot the computer
  336.    BootDrive2$   determine the drive used to boot the computer
  337.    CDROM         see if a CD-ROM is installed and get info
  338.    CDROM2%       see if a CD-ROM is installed and get info
  339.    CheckDisk     see if a disk is ready to be accessed
  340.    CheckDsk%     see if a disk is ready to be accessed
  341.    CheckShare    determine whether SHARE is installed
  342.    CheckShare2%  determine whether SHARE is installed
  343.    CloseA        close an archive opened by FindFirstA
  344.    CopyFile      copy a single file
  345.    DelFile       delete a file
  346.    DelSub        delete a subdirectory
  347.    DFRead        read from a file into an array or other mem.
  348.    DFWrite       write to a file from an array or other memory
  349.    DiskStat      get information on disk memory
  350.    DrvSpaceL     see how much space is free on a disk
  351.    DriveSpace&   see how much space is free on a disk
  352.    DrvType       see if a drive is removeable and/or networked
  353.    Exist         see if a file exists
  354.    Exist2%       see if a file exists
  355.    ExplainFAttr$ return a text explanation of a file attribute
  356.    ExtendFSpec   check, complete, and format a filespec
  357.    FClose        close a file
  358.    FCreate       create a file and open it for access
  359.    FGetLoc       get the position of a file pointer
  360.    FGetLoc2%     get the position of a file pointer
  361.    FileCopy      copy one or more files
  362.    FileCount     count the number of matching files
  363.    FileCRC       calculate a 32-bit CRC for a file
  364.    FindFirstA    find the first file in an archive
  365.    FindFirstF    find the first file to match specs (obs)
  366.    FindFirstFx   find the first file to match specs
  367.    FindNextA     find any other files in an archive
  368.    FindNextF     find any other files which match specs (obs)
  369.    FindNextFx    find any other files which match specs
  370.    FindPatch     find where to patch an .EXE
  371.    Floppies      see how many floppy drives are attached
  372.    Floppies2%    see how many floppy drives are attached
  373.    FloppyType    see what types of floppy drives are installed
  374.    FlushToDisk   flush a file to disk (force it to be updated)
  375.    FOpen         open a file
  376.    ForceMatch$   force a file to match a wildcard pattern
  377.    FSetEnd       move to the end of a file
  378.    FSetLoc       move to a specific location in a file
  379.    FSetOfs       move backwards or forwards within a file
  380.    FSetRec       move to a specific record location in a file
  381.    FSetSize      set the size of a file
  382.    FSize         get the size of a file
  383.    FSize2&       get the size of a file
  384.  
  385.                       Routine Reference
  386.  
  387.  
  388.  
  389. Disk:
  390.    GetAttrF      get attribute of a file matched by FindFirstF
  391.    GetAttrFx%    get attribute of a file matched by FindFirstFx
  392.    GetCRCA       get CRC-16 of a file matched by FindFirstA
  393.    GetCRCAL      get CRC-32 of a file matched by FindFirstA
  394.    GetDateA      get date of a file matched by FindFirstA
  395.    GetDateF      get date of a file matched by FindFirstF
  396.    GetDateFx$    get date of a file matched by FindFirstFx
  397.    GetDrive$     get the default drive
  398.    GetDrv        get the default drive
  399.    GetExecPath   get drive, subdir, name of current program
  400.    GetFAttr      get attribute of a file
  401.    GetFDate      get the date of a file
  402.    GetFSize&     get the size of a file
  403.    GetFTime      get the time of a file
  404.    GetLabel      get a disk volume label
  405.    GetLabel2$    get a disk volume label
  406.    GetNameA      get the name of a file matched by FindFirstA
  407.    GetNameF      get the name of a file matched by FindFirstF
  408.    GetNameFx$    get the name of a file matched by FindFirstFx
  409.    GetSerial     get a disk serial number
  410.    GetSizeAL     get the size of a file matched by FindFirstA
  411.    GetSizeFL     get the size of a file matched by FindFirstF
  412.    GetSizeFx&    get the size of a file matched by FindFirstFx
  413.    GetStoreA     get storage type of file matched by FindFirstA
  414.    GetSub        get the default subdirectory (obsolete)
  415.    GetSub1       get the default subdirectory on a given drive
  416.    GetSub2$      get the default subdirectory on a given drive
  417.    GetTimeA      get the time of a file matched by FindFirstA
  418.    GetTimeF      get the time of a file matched by FindFirstF
  419.    GetTimeFx$    get the time of a file matched by FindFirstFx
  420.    GetVerify     determine status of the DOS "verify" setting
  421.    GLoad         load a binary image from a file (like BLOAD)
  422.    IdentifyFile  try to identify a file
  423.    LoadDir       load names of matching files into an array
  424.    LoadDirAll    load all info about matching files into array
  425.    LogicalDrives% see how many logical drives are available
  426.    MakeSub       create a subdirectory
  427.    MatchFile     see if a filename matches a wildcard filespec
  428.    ObjScan       scan an .OBJ file, return publics & externals
  429.    ParseFSpec    split filespec into drive, subdir, filename
  430.    PatchDone     terminates patching of an .EXE file
  431.    Rename        rename a file
  432.    RenSub        rename a subdirectory
  433.    Retries       set the retries used for file networking
  434.    SetDrv        set the default drive
  435.    SetFAttr      set the attribute of a file
  436.    SetFTD        set the time and date of a file
  437.    SetLabel      set a disk volume label
  438.    SetPatch      installs a patch into an .EXE file
  439.    SetSub        set the default subdirectory
  440.    SetVerify     set the state of the DOS "verify" switch
  441.    SFRead        read from a file into a string
  442.    SFWrite       write from a string into a file
  443.    SubExist      determine whether a subdirectory exists
  444.    SubExist2%    determine whether a subdirectory exists
  445.  
  446.                       Routine Reference
  447.  
  448.  
  449.  
  450. Display:
  451.    BigPrint      display text in huge letters
  452.    BkSpace       backspace destructively with wrap
  453.    BkScroll      scroll an area of the screen down
  454.    Blink         switch blinking vs. intense background colors
  455.    CalcAttr      calc color/attribute from fore & background
  456.    CalcAttr2%    calc color/attribute from fore & background
  457.    CalcSize      calc array size needed to save a screen area
  458.    CalcVGAColor  calculate a VGA palette color setting
  459.    ClearArea     clear an area of the screen w/ special effects
  460.    Clock         display a clock on the screen constantly
  461.    ClockSet      set various parameters for the clock
  462.    ClrCols       clear between specified columns on a row
  463.    ClrEOL        clear to the end of the row
  464.    ClrEOP        clear to the end of the screen
  465.    ClrSOL        clear to the start of the row
  466.    ClrSOP        clear to the start of the screen
  467.    CPrintScreen1 send a SCREEN 1 display to the printer
  468.    CPrintScreen2 send a SCREEN 2 display to the printer
  469.    CursorInfo    return cursor visibility, current & max sizes
  470.    CWindowManager display pop-up window in CGA graphics mode
  471.    DClear        clear a display being kept in an array
  472.    DClearSS      clear a display of unusual size in an array
  473.    DelChr        delete a character from the screen
  474.    DelLine       delete a row from the screen
  475.    DGClear       clear a CGA virtual screen
  476.    DGetScreen    get an area of the screen into an array
  477.    DGQPrint      write to a CGA virtual screen (SCREEN 1 type)
  478.    DGXQPrint     write to a CGA virtual screen (SCREEN 2 type)
  479.    DGXQPrint1    write to a CGA virtual screen (SCREEN 2 type)
  480.    Dissolve      clear the screen with special effects
  481.    DMPrint       display text directly through DOS services
  482.    DOSClrEol     clear from the cursor to end of line via DOS
  483.    DOSCls        clears the screen using DOS output
  484.    DOSColor      sets the screen color using DOS output
  485.    DOSLocate     sets the cursor position using DOS output
  486.    DPutScreen    put an array onto an area of the screen
  487.    DRecolor      recolor text of a specified color in an array
  488.    DRecolorArea  recolor a block of text in an array
  489.    DScrRest      restore a saved screen from an array
  490.    DScrSave      save a screen to an array or other memory
  491.    DWindowManager make a pop-up window in an array
  492.    DWindowMan2   pop-up window in an array (definable frames)
  493.    DWindowMan3   pop-up window in an array (array-based parms)
  494.    DWindowMan4   pop-up window in an array (Spartan version)
  495.    DXQPrint      write text into an array
  496.    EGARest7      restore a saved screen to EGA SCREEN 7 display
  497.    EGARest8      restore a saved screen to EGA SCREEN 8 display
  498.    EGARest9      restore a saved screen to EGA SCREEN 9 display
  499.    EGASave7      save an EGA SCREEN 7 display to an array
  500.    EGASave8      save an EGA SCREEN 8 display to an array
  501.    EGASave9      save an EGA SCREEN 9 display to an array
  502.  
  503.                       Routine Reference
  504.  
  505.  
  506.  
  507. Display:
  508.    EWindowManagerC display pop-up window on EGA/VGA graphics
  509.    EXQPrintC     display text at high speed on EGA/VGA graphics
  510.    FadeOut       clear the screen with special effects
  511.    GetColor      get the current colors being used by BASIC
  512.    GetCRT        determine whether the display is color or mono
  513.    GetCRT2%      determine whether the display is color or mono
  514.    GetEGA        see if an EGA is in use and get info about it
  515.    GetEGA2%      see if an EGA is in use
  516.    GetHGA%       see if a Hercules mono adapter is in use
  517.    GetLine       get a row of text from virtual or saved screen
  518.    GetRows       see how many rows are on the screen
  519.    GetRows2%     see how many rows are on the screen
  520.    GetScreen     get an area of the screen into an array
  521.    GetTVScreen   get video buffer address for TopView/compat.
  522.    GetVGA        see if a VGA is in use
  523.    GetVGA2%      see if a VGA is in use
  524.    GetVGAPalette get the specified VGA palette settings
  525.    GetVidMode    get display mode and other screen info
  526.    GQPrint       display text quickly in CGA SCREEN 2 mode
  527.    GrafPrint     display sized text at graphics coordinates
  528.    GrafRest      restore a saved CGA graphics screen
  529.    GrafSave      save a CGA graphics screen to an array
  530.    GXQPrint      display text quickly in CGA SCREEN 1
  531.    GXQPrint1     display text quickly in CGA SCREEN 1
  532.    HCls          clear screen in Hercules graphics mode
  533.    HLine         draw a line in Hercules graphics mode
  534.    HMode         switch between text and Herc graphics modes
  535.    HPrint        display text in Hercules graphics mode
  536.    HSetPixel     plot a point in Hercules graphics mode
  537.    HTestPixel    get the color of a point in Herc graphics mode
  538.    InsChr        insert a space onto the screen
  539.    InsLine       insert a blank row onto the screen
  540.    LScroll       scroll an area of the screen left
  541.    MPrint        display text through DOS, obeying MWindow
  542.    MWindow       sets a display region for MPrint
  543.    PrintScreen   print the screen on a printer
  544.    PutScreen     put an array onto an area of the screen
  545.    QPrint        display text very quickly
  546.    ReColor       change text of a selected color to a new color
  547.    ReColorArea   change text in a selected area to a new color
  548.    RScroll       scroll an area of the screen right
  549.    Scroll        scroll an area of the screen up
  550.    ScrRest       restore a saved screen from an array
  551.    ScrSave       save a screen to an array
  552.    Scrunch       compress a screen in an array
  553.    SetCGAColor   set various aspects of CGA colors
  554.    SetVGAPalette set the specified VGA palette info
  555.    Split         clear the screen by scrolling different ways
  556.  
  557.                       Routine Reference
  558.  
  559.  
  560.  
  561. Display:
  562.    TypePrint     display text as if it is being typed
  563.    UnCalcAttr    convert color/attribute to fore & background
  564.    UnScrunch     uncompress a "scrunched" screen
  565.    UnSplit       restore saved screen by scroll. different ways
  566.    UpdTVScreen   update screen from buffer w/ TopView/compat.
  567.    VGARest13     restore a saved screen in VGA SCREEN 13 mode
  568.    VGASave13     save a VGA SCREEN 13 display to an array
  569.    WindowManager display a pop-up window
  570.    WindowMan2    display a pop-up window (user-defined frames)
  571.    WindowMan3    display a pop-up window (array-based parms)
  572.    WindowMan4    display a pop-up window (spartan version)
  573.    XMPrint       display text through DOS after translation
  574.    XQPrint       display text very quickly
  575.    XQPrintOver   quick text display, overlaying existing text
  576.  
  577. Equipment:
  578.    AllExtMem&    see how much extended memory was found at boot
  579.    CDROM         see if a CD-ROM is installed and get info
  580.    CDROM2%       see if a CD-ROM is installed and get info
  581.    Equipment     find out about basic equipment (ports, memory)
  582.    ExtMem        see how much extended memory is available
  583.    Floppies      see how many floppy drives are available
  584.    Floppies2%    see how many floppy drives are available
  585.    FloppyType    see what types of floppy drives are installed
  586.    Get4DOSv      get installed version of 4DOS, if any
  587.    GetCRT        determine whether the display is color or mono
  588.    GetCRT2%      determine whether the display is color or mono
  589.    GetDOSv       get the DOS version
  590.    GetEGA        see if an EGA is in use and get info about it
  591.    GetEGA2%      see if an EGA is in use
  592.    GetExtM       see how much extended memory is available
  593.    GetHGA%       see if a Hercules mono adapter is in use
  594.    GetLIMm       see how much expanded memory is available
  595.    GetLIMv       get the EMS driver version
  596.    GetVGA        see if a VGA is in use
  597.    GetVGA2%      see if a VGA is in use
  598.    GetXMSm       see how much XMS memory is available
  599.    GetXMSv       get the XMS driver version
  600.    KbdType       see if the keyboard is enhanced (101-key)
  601.    KbdType2%     see if the keyboard is enhanced (101-key)
  602.    LogicalDrives% see how many logical drives are available
  603.    MMCheck       see if a mouse is available and # of buttons
  604.    NumProc       see what kind of numeric coprocessor is in use
  605.    NumProc2%     see what kind of numeric coprocessor is in use
  606.    PCDate        get the date of the ROM BIOS
  607.    PCDat$        get the date of the ROM BIOS
  608.    PCType        get the machine I.D. from the ROM BIOS
  609.    PCType2%      get the machine I.D. from the ROM BIOS
  610.    Processor     see what kind of CPU is in use
  611.    Processor2%   see what kind of CPU is in use
  612.    WinCheck      see what version of Windows is running, if any
  613.  
  614.                       Routine Reference
  615.  
  616.  
  617.  
  618. Input:
  619.    AltKey        returns letter from ASCII & scan codes of key
  620.    BarMenu       bar menu (single row) for keyboard only
  621.    BarMenuM      bar menu (single row) for keyboard or mouse
  622.    BIOSInkey     get a key from BIOS if any is waiting
  623.    BreakCheck    see if Break has been pressed
  624.    BreakOff      make sure Break doesn't interrupt the program
  625.    BreakOffDone  remove Break handler
  626.    CheckKey      get a key if any is waiting, or a mouse button
  627.    CheckKey3     get a key if any is waiting, or a mouse button
  628.    ClrKbd        clear the keyboard buffer
  629.    CtrlKey       returns letter, given ASCII code of Ctrl key
  630.    DInput        formatted dollar input routine
  631.    DOSInkey      get a key from DOS if any is waiting
  632.    DOSInky$      get a key from DOS if any is waiting
  633.    EnhKbd        enable/disable enhanced keyboard handling
  634.    GetKbd        get state of keyboard toggles (CapsLock, etc)
  635.    GetKbd1       get state of shift keys (Control, Alt, etc)
  636.    GetKbd2       get state of shift keys (Left/Right Alt, etc)
  637.    GetKey        get a key or mouse click (wait; 2-button)
  638.    GetKey3       get a key or mouse click (wait; 3-button)
  639.    GetValidKey   get one of a list of valid keys
  640.    KbdType       see if the keyboard is enhanced (101-key)
  641.    KbdType2      see if the keyboard is enhanced (101-key)
  642.    KeyPress      see if a key is waiting to be retrieved
  643.    PrtSc         disable the PrtSc/PrintScreen key
  644.    ScanKey       get a key, if any, w/o taking it from buffer
  645.    SetKbd        set state of keyboard toggles (CapsLock, etc)
  646.    SetMouseLoc   set the mouse cursor position (text mode)
  647.    SInput        flexible replacement for LINE INPUT
  648.    SInputSet     set SInput parms (fill, exitmode, beeps, fast)
  649.    SInputSet1    set SInput parms (cursor position, full exit)
  650.    SInputSet2    set SInput parms (capitalize, tab exit)
  651.    SpeedKey      change the keyboard repeat rate
  652.    TypeIn        stuff keys into buffer as if they were typed
  653.  
  654.                       Routine Reference
  655.  
  656.  
  657.  
  658. Memory:
  659.    BlockMove     copy data from one area of memory to another
  660.    DataSeg       determine the default data segment (dgroup)
  661.    EMSBuffer     get the bytes needed to save EMS array state
  662.    EMSClose      close an EMS array
  663.    EMSGet        get an element from an EMS array
  664.    EMSOpen       create an EMS array
  665.    EMSPut        put an element into an EMS array
  666.    EMSRest       restore the EMS array state
  667.    EMSSave       save the EMS array state
  668.    ExtGet        get data from extended memory
  669.    ExtMem        see how much extended memory is available
  670.    ExtPut        put data into extended memory
  671.    FarPeek%      get byte from memory (like PEEK w/o DEF SEG)
  672.    FarPeekI%     get word from memory (like two PEEKs w/o DEF SEG)
  673.    FarPeekL&     get dword from memory (like four PEEKs w/o DEF SEG)
  674.    FarPoke       put byte into memory (like POKE w/o DEF SEG)
  675.    FarPokeI      put word into memory (like two POKEs w/o DEF SEG)
  676.    FarPokeL      put dword into memory (like four POKEs w/o DEF SEG)
  677.    GetExtM       see how much extended memory is available
  678.    GetLIMHandles get the number of EMS handles being used
  679.    GetLIMm       see how much expanded memory is available
  680.    GetLIMv       get the EMS driver version
  681.    GetXMSm       see how much XMS memory is available
  682.    GetXMSv       get the EMS driver version
  683.    LClose        close a block of expanded memory
  684.    LGet          get a block of data from expanded memory
  685.    LOpen         open a block of expanded memory
  686.    LPut          put a block of data into expanded memory
  687.    MemSwap       swap contents of one area of memory w/ another
  688.  
  689. Miscellaneous:
  690.    DOSErrM$      convert a DOS error code into a text message
  691.    DOSInt%       execute a DOS function (like CALL INTERRUPT)
  692.    CatchError    set up to grab exit code from SHELLed program
  693.    GetDView      see if DESQview is loaded
  694.    GetError      get the exit code from a SHELLed program
  695.    GetError2%    get the exit code from a SHELLed program
  696.    GetSwitch     get the DOS switch character
  697.    GetSwitch2$   get the DOS switch character
  698.    GetTView      see if TopView or compatible is loaded
  699.    GetTVScreen   get video buffer address for TopView/compat.
  700.    HandleInfo    see if a handle refers to a file or a device
  701.    IntVector     get the address of an interrupt handler
  702.    Reboot        boot the computer (like Control-Alt-Del)
  703.    RedirectIn    see whether input has been redirected
  704.    RedirectOut   see whether output has been redirected
  705.    SetError      set exit code to return when program ends
  706.  
  707.                       Routine Reference
  708.  
  709.  
  710.  
  711. Mouse:
  712.    BarMenuM      bar menu (single row) for keyboard or mouse
  713.    CheckKey      get a key if any is waiting, or a mouse button
  714.    CheckKey3     get a key if any is waiting, or a mouse button
  715.    GetKey        get key or mouse click (wait for it; 2-button)
  716.    GetKey3       get key or mouse click (wait for it; 3-button)
  717.    GetMouseLoc   get the mouse cursor position (text mode)
  718.    MMButton      see which mouse buttons are pressed (2-button)
  719.    MMButton3     see which mouse buttons are pressed (3-button)
  720.    MMCheck       see if a mouse is installed & no. of buttons
  721.    MMClick       see which buttons have been pressed (2-button)
  722.    MMClick3      see which buttons have been pressed (3-button)
  723.    MMCursorOff   make the mouse cursor invisible
  724.    MMCursorOn    make the mouse cursor visible
  725.    MMGetLoc      get the mouse cursor position
  726.    MMSetLoc      set the mouse cursor position
  727.    MMSetRange    set the allowable range of the mouse cursor
  728.    MouseBuffer   get no. of bytes needed to save mouse state
  729.    MouseCursor   set the mouse graphics cursor type
  730.    MousePen      turn light pen emulation by the mouse on/off
  731.    MouseRest     restore a saved mouse state
  732.    MouseSave     save the current state of the mouse
  733.  
  734.                       Routine Reference
  735.  
  736.  
  737.  
  738. Numeric:
  739.    Any2Dec       convert a number from any base into an integer
  740.    CeilD#        return the smallest integer >= number
  741.    CeilS!        return the smallest integer >= number
  742.    Dec2Any       convert an integer to any base
  743.    FloorD#       return the largest integer <= number
  744.    FloorS#       return the largest integer <= number
  745.    IVal%         convert a string to an integer
  746.    KVal%         convert a string to a long integer / 1024
  747.    LVal%         convert a string to a long integer
  748.    Max%          return the greater of two integers
  749.    MaxD#         return the greater of two double-prec. numbers
  750.    MaxL&         return the greater of two long integers
  751.    MaxS!         return the greater of two single-prec. numbers
  752.    Min%          return the smaller of two integers
  753.    MinD#         return the smaller of two double-prec. numbers
  754.    MinL&         return the smaller of two long integers
  755.    MinS!         return the smaller of two single-prec. numbers
  756.    Num2Phone$    convert a compressed phone number to a string
  757.    NumFormat     format a number as a string, like PRINT USING
  758.    Odd%          return whether an integer is odd
  759.    OddL%         return whether a long integer is odd
  760.    Phone2Num&    compress a phone number into a long integer
  761.    Rand%         return pseudo-random number in specified range
  762.    ReadBitF      read value of given bit length from an array
  763.    SetBit        set a specified bit in an integer
  764.    ShiftL        shift the bits in an integer left
  765.    ShiftLL       shift the bits in a long integer left
  766.    ShiftR        shift the bits in an integer right
  767.    ShiftRL       shift the bits in a long integer right
  768.    WriteBitF     write value of given bit length into an array
  769.  
  770. Printer:
  771.    CPrintScreen1 send a SCREEN 1 display to the printer
  772.    CPrintScreen2 send a SCREEN 2 display to the printer
  773.    GetPrtAddr    get the address of a printer port
  774.    PrinterReady% see if a printer is ready
  775.    PrinterInit   initialize a printer
  776.    PrintFile     send a file to the printer
  777.    PrintScreen   print the screen on the printer
  778.    PrtSc         disable the PrtSc/PrintScreen key
  779.    PrtSwap       swap any two printer ports
  780.    SetPrtAddr    set the address of a printer port
  781.    Spooler       see if DOS print spooler (PRINT.COM) is loaded
  782.  
  783. Serial:
  784.    Carrier       determine if a carrier is present
  785.    Checksum      calculate a checksum on a string
  786.    CRC           calculate a CRC for a string (obsolete)
  787.    CRC1          calculate a CRC for a string
  788.    DTR           set the state of the DTR line
  789.    GetCommAddr   get the address of a comm port
  790.    SetComm       set communications parameters
  791.    SetCommAddr   set the address of a comm port
  792.  
  793.                       Routine Reference
  794.  
  795.  
  796.  
  797. String:
  798.    AndSt         AND the bytes in two strings together
  799.    AscI%         get the ASCII value of a character (like ASC)
  800.    Bickel        compare two strings using Bickel's algorithm
  801.    BSq           compress the blanks out of a text string
  802.    BUsq          restore a string that was compressed by BSq
  803.    BUsqLen       determine expanded length of a BSq'ed string
  804.    Checksum      calculate a checksum
  805.    Cipher        perform simple string encryption/decryption
  806.    CipherP       like Cipher, only the results are printable
  807.    CRC           calculate a CRC (obsolete)
  808.    CRC1          calculate a CRC
  809.    Crunch        remove repeated values from a string
  810.    DGetRec       get a string from memory in a record format
  811.    DGetSt        get string from numeric array or other memory
  812.    DPutRec       put a string into memory in a record format
  813.    DPutSt        put string into numeric array or other memory
  814.    Extract       extract a delimited substring from a string
  815.    IsAlNum%      test whether a char. is alphabetic or numeric
  816.    IsAlpha%      test whether a character is alphabetic
  817.    IsASCII%      test whether a character is ASCII
  818.    IsCntrl%      test whether a character is a control code
  819.    IsDigit%      test whether a character is a digit
  820.    IsLower%      test whether a char. is lowercase alphabetic
  821.    IsPrint%      test whether a character is printable
  822.    IsPunct%      test whether a character is punctuation
  823.    IsSpace%      test whether a character is white space
  824.    IStr$         convert an integer to a string
  825.    IsUpper%      test whether a char. is uppercase alphabetic
  826.    IsXDigit%     test whether a char. is a hexadecimal digit
  827.    Locase        convert a string to lowercase
  828.    Locase1       convert a string to lowercase (international)
  829.    LRotate       rotate the characters in a string left once
  830.    MatchFile     see if filename matches a wildcard filespec
  831.    Month         return the name of the month, given month no.
  832.    MultiAND      perform an arithmetic AND operation on string
  833.    MultiOR       perform an arithmetic OR operation on a string
  834.    MultiXOR      perform an arithmetic XOR operation on string
  835.    NameCase      capitalize a string correctly for a name
  836.    NameCase2$    capitalize a string correctly for a name
  837.    Num2Phone$    convert a compressed phone number to a string
  838.    OrSt          OR bytes in one string with those in another
  839.    Phone2Num&    compress a phone number into a long integer
  840.    Replace       replace one character with another
  841.    ReplaceString replace one substring with another
  842.    Reverse       reverse a string
  843.    RInstr        find last occurrence of substring w/in string
  844.    RolSt         rotate the bits in a string left
  845.    RorSt         rotate the bits in a string right
  846.    RRotate       rotate the characters in a string right once
  847.    SFRead        read a string from a file
  848.    SFWrite       write a string to a file
  849.  
  850.                       Routine Reference
  851.  
  852.  
  853.  
  854. String:
  855.    ShlSt         shift the bits in a string left
  856.    ShrSt         shift the bits in a string right
  857.    Soundex       determine what a string "sounds" like
  858.    SSrch         see if one string is within another
  859.    StrDel        delete a character from a string
  860.    StrIns        insert a space into a string
  861.    Strip         strip the blanks from both sides of a string
  862.    StripBlanks   strip the blanks from side(s) of a string
  863.    StripChar     strip a specified list of chars from a string
  864.    StripRange    strip a specified range of chars from a string
  865.    StripSpaces   strip the spaces from side(s) of a string
  866.    Strip2$       strip the blanks from both sides of a string
  867.    StrSqu2       compress text string using 2-gram compression
  868.    StrSquLen2    determine 2-gram compressed length of string
  869.    StrUnsqu2     uncompress a 2-gram compressed string
  870.    StrUnsquLen2  calc full length of 2-gram compressed string
  871.    TInstr        search for a specific kind of char in a string
  872.    Upcase        convert a string to uppercase
  873.    Upcase1       convert a string to uppercase (international)
  874.    Xlate         run each char of a string through translation
  875.    XorSt         XOR bytes in one string with those in another
  876.  
  877.                       Routine Reference
  878.  
  879.  
  880.  
  881. Time:
  882.    CalcDate      get date a number of days from a starting date
  883.    CheckDate     check a date to determine whether it is valid
  884.    Clock         display a clock on the screen, constantly
  885.    ClockSet      set the parameters for the clock
  886.    Date2Int      squash a date into a single integer
  887.    DateA2R       convert a date to a number you can calc with
  888.    DateN2S       convert a date from numbers into a string
  889.    DateR2A       convert a number to a date
  890.    DateS2N       convert a date from string form into numbers
  891.    DCal          draw a calendar into an array for ScrRest
  892.    DCalendar     draw a calendar & let user to select date
  893.    Delay         delay for a given number of seconds
  894.    Delay18th     delay for a given number of 18ths of seconds
  895.    DelayV        delay for a very small amount of time
  896.    Elapsed       determine the elapsed time between two times
  897.    ElapsedTime$  determine the elapsed time between two times
  898.    EuropeDate    convert a date to European format
  899.    FormatDate    convert a date to any desired format
  900.    GetDateA      get the date of a file matched by FindFirstA
  901.    GetDateAT     get the date from the AT hardware clock
  902.    GetDateF      get date of a file matched with FindFirstF
  903.    GetDateFx$    get date of a file matched with FindFirstFx
  904.    GetFDate      get the date of a file
  905.    GetFTime      get the time of a file
  906.    GetTime       get time from DOS, including 100th seconds
  907.    GetTimeA      get the time of a file matched by FindFirstA
  908.    GetTimeAT     get the time from the AT hardware clock
  909.    GetTimeF      get time of a file matched with FindFirstF
  910.    GetTimeFx$    get time of a file matched with FindFirstFx
  911.    Int2Date      unsquash date from single integer to numbers
  912.    Int2DateSt$   unsquash date from single integer to string
  913.    Int2Time      unsquash time from single integer to numbers
  914.    Int2TimeSt$   unsquash time from single integer to string
  915.    Month         return name of month, given the month number
  916.    Sec2Time$     convert seconds past midnight to time string
  917.    SetDateAT     set the date of the AT hardware clock
  918.    SetTimeAT     set the time of the AT hardware clock
  919.    Time2Int      squash a time into a single integer
  920.    Time2Sec&     convert time string to seconds past midnight
  921.    TimeN2S       convert a time from numbers into a string
  922.    TimeS2N       convert a time from a string into numbers
  923.    WeekDay       get the day of the week
  924.    WeekDay1      returns the day of the week for a given date
  925.  
  926.                       Enhanced Key Codes
  927.  
  928.  
  929.  
  930. This is a list of the new key codes available when you use
  931. EnhKbd to enable enhanced keyboard support.  Note that the
  932. codes are direct from the BIOS, and may not always match what
  933. INKEY$ returns.  QuickBASIC 4.5 provides only minimal support
  934. for the enhanced keys; QBX does much better.  As long as you
  935. use PBClone for input, of course, you don't have to worry about
  936. it.
  937.  
  938. The format used is ScanCode, ASCIIcode.
  939.  
  940.  
  941. Middle keypad key (num lock off):   0,76
  942. Middle key, with Control:           0,143
  943.  
  944.              plain     shift     control     alt
  945.              -----     -----     -------    -----
  946.    F11       0,133     0,135      0,137     0,139
  947.    F12       0,134     0,136      0,138     0,140
  948.  
  949. The middle cursor pad returns the same scan codes as the
  950. cursor/numeric pad when NumLock is off, but with an ASCII code
  951. of 224 instead of 0.  If you want the middle cursor pad and
  952. cursor/numeric pad to return the same values, you should have
  953. your code do this:
  954.  
  955.    ' ...get key code...
  956.    IF ASCIIcode = 224 AND ScanCode <> 0 THEN ASCIIcode = 0
  957.  
  958. Why test both ASCII and scan codes?  Because it is possible for
  959. the user to enter a plain 224 by holding ALT and using the
  960. numeric keypad, which could cause confusion.
  961.  
  962. The arrows in the middle cursor pad will return special codes
  963. if pressed in combination with an ALT key:
  964.  
  965.    up    arrow     0,152
  966.    down  arrow     0,160
  967.    left  arrow     0,155
  968.    right arrow     0,157
  969.  
  970. Finally, the arrow keys on either cursor pad will return
  971. special codes if pressed in combination with a CONTROL key:
  972.  
  973.                    middle pad     cursor/num pad
  974.                    ----------     --------------
  975.    up    arrow       224,141          0,141
  976.    down  arrow       224,145          0,145
  977.    left  arrow       224,115          0,115
  978.    right arrow       224,116          0,116
  979.  
  980.                         DOS Error Codes
  981.  
  982.  
  983.  
  984. Note that the number of error codes available depends on the
  985. version of DOS in use.  Older versions return fewer error
  986. codes, meaning that the nature of the error may not be
  987. specified as precisely as you might like.  This is not a
  988. complete list of all possible codes, but it covers the most
  989. common ones.
  990.  
  991. The DOSErrM$ function can be used to generate a complete error
  992. list if needed, current at least through DOS 3.31.  If later
  993. versions of DOS have new error codes, I'm not aware of 'em.
  994.  
  995.  
  996.   -1    Unable to read or write all of the data requested
  997.    0    No error
  998.    1    Invalid function number (possible PBClone error)
  999.    2    File not found
  1000.    3    Path not found
  1001.    4    No handle available (too many files open)
  1002.    5    Access denied (file already in use or "read only")
  1003.    6    Invalid handle
  1004.   15    Invalid disk drive
  1005.   16    Attempt to remove current directory
  1006.   18    No more matching files
  1007.   19    Disk is write-protected
  1008.   20    Unknown unit
  1009.   21    Drive not ready
  1010.   22    Invalid command
  1011.   23    Data CRC error
  1012.   25    Seek error
  1013.   26    Disk is not in DOS format
  1014.   27    Sector not found
  1015.   28    Printer is out of paper
  1016.   29    Write fault
  1017.   30    Read fault
  1018.   31    General failure
  1019.   32    Sharing violation
  1020.   33    Lock violation
  1021.   34    Invalid disk change
  1022.   35    No FCB available
  1023.   36    No room in file sharing buffer
  1024.   80    File already exists
  1025.   82    Unable to create subdirectory
  1026.  
  1027.