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

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