home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / BASIC / PBCLON17.ZIP / PBCLONE.DOC < prev    next >
Encoding:
Text File  |  1991-12-29  |  48.5 KB  |  962 lines

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