home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / BASIC / PBCLON17.ZIP / PBCLONE1.MAN < prev    next >
Encoding:
Text File  |  1991-12-10  |  133.2 KB  |  3,659 lines

  1. Name  : AddMatI              (Add Matrix Integer)
  2. Class : Array management
  3. Level : Any
  4.  
  5. This routine adds an integer to as many elements of an integer array as you
  6. like, starting at a specified place in the array.  It can also be used to
  7. subtract (just specify a negative value).  If there was a numeric overflow at
  8. any point in the operation, an error code will be returned.
  9.  
  10.    AddMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  11.  
  12. DSeg%      segment of the first array element to add, obtained by VARSEG
  13. DOfs%      offset of the first array element to add, obtained by VARPTR
  14. Elements%  number of array elements to which to add
  15. Value%     value to add to each array element
  16. -------
  17. ErrCode%   error code: 0 if no error, else there was an overflow
  18.  
  19. Name  : AddMatL              (Add Matrix Long integer)
  20. Class : Array management
  21. Level : Any
  22.  
  23. This routine adds a long integer to as many elements of an long integer array
  24. as you like, starting at a specified place in the array.  It can also be used
  25. to subtract (just specify a negative value).  If there was a numeric overflow
  26. at any point in the operation, an error code will be returned.
  27.  
  28.    AddMatL DSeg%, DOfs%, Elements%, Value&, ErrCode%
  29.  
  30. DSeg%      segment of the first array element to add, obtained by VARSEG
  31. DOfs%      offset of the first array element to add, obtained by VARPTR
  32. Elements%  number of array elements to which to add
  33. Value&     value to add to each array element
  34. -------
  35. ErrCode%   error code: 0 if no error, else there was an overflow
  36.  
  37. Name  : AllExtMem&           (All Extended Memory)
  38. Class : Equipment
  39. Level : Clone (AT)
  40.  
  41. This routine returns the amount of extended memory installed in the system,
  42. as reported by the power-on self-test (POST) routine at boot time.  This does
  43. not tell you how much extended memory is actually available, since extended
  44. memory may be carved up by users of BIOS-level extended memory or XMS memory,
  45. converted to expanded memory, etc.  It only tells you the amount of physical
  46. extended memory that is installed.
  47.  
  48. Do not use this routine on PC/XT machines. It is only for AT-class computers.
  49.  
  50.    ExtMemKb& = AllExtMem&
  51.  
  52. -------
  53. ExtMemKb&     kilobytes of extended memory installed
  54.  
  55. Name  : AltKey               (Alt Key)
  56. Class : Input
  57. Level : Any
  58.  
  59. This routine works in conjunction with a key input routine, such as INKEY$ or
  60. the CheckKey and GetKey routines.  Given the ASCII code and scan code of a
  61. key, AltKey returns the associated key letter, if any.  For instance, it
  62. returns "A" if you pass it ASCII code 0 and scan code 30, because those codes
  63. represent Alt-A.
  64.  
  65.    AltKey ASCIICode%, ScanCode%, Ky$
  66.  
  67. ASCIICode%   ASCII code of the key
  68. ScanCode%    scan code of the key
  69. -------
  70. Ky$          associated key letter ("" if none)
  71.  
  72. Name  : AndSt                (AND String)
  73. Class : String
  74. Level : Any
  75.  
  76. This routine ANDs each byte in one string with the corresponding byte in a
  77. second string.  The strings must be the same length.
  78.  
  79.    AndSt St1$, St2$
  80.  
  81. St1$      string to AND
  82. St2$      string to AND with
  83. -------
  84. St1$      result
  85.  
  86. Name  : Any2Dec              (Any to Decimal)
  87. Class : Numeric
  88. Level : Any
  89.  
  90. This routine converts a number in any base to a normal (base 10) integer.  It
  91. works like the &H and &O prefixes in BASIC, but rather than working only in
  92. hexadecimal (base 16) and octal (base 8), it can be used for binary, octal,
  93. or almost anything else.
  94.  
  95. If you specify base 10, you can use this routine to convert a signed integer
  96. (0-65,535) to a normal integer.
  97.  
  98.    Any2Dec Number$, NrBase%, DecNr%, ErrCode%
  99.  
  100. Number$   any-base number to convert to an integer
  101. NrBase%   number base to convert from
  102. -------
  103. DecNr%    resulting integer
  104. ErrCode%  error code: 0 if no error, else overflow, bad base, or invalid nr
  105.  
  106. Name  : AscI%                (ASC Integer)
  107. Class : String
  108. Level : Any
  109.  
  110. This is a replacement for the ASC function provided by BASIC.  It is smaller
  111. than ASC, however, and also somewhat faster.
  112.  
  113. Unlike BASIC or ProBas, the PBClone AscI function returns -1 as an error
  114. condition if you try to use it on a null string.  This convention owes its
  115. origin to the similar routine in Crescent's libraries.
  116.  
  117.    Value% = AscI%(St$)
  118.  
  119. St$        string for which to return ASCII code
  120. -------
  121. Value%     code of the first string character or -1 if null string
  122.  
  123. Name  : BarMenu              (Bar Menu)
  124. Class : Input
  125. Level : Clone
  126.  
  127. This is a bar menu routine.  It allows the user to select one of a list of
  128. items given on a single menu row or "bar".  The current item is highlighted
  129. in your choice of colors; user selection can be done either by moving this
  130. highlight and pressing return or by entering the letter associated with the
  131. desired item.  Only text mode is supported.
  132.  
  133. The highlight may be moved with the left and right arrow keys, tab and
  134. backtab, or space and backspace.  Selection is done with <CR>, the enter key.
  135.  
  136. The letter used to select an item is the first character of the item that is
  137. not lowercase or a space.  If the item is all lowercase, the first character
  138. of the item will be used.  For example, suppose you want the user to select
  139. one of "list" or "log".  By passing the options to BarMenu as "List" and
  140. "lOg", you allow the user to press "L" for "List" and "O" for "lOg".
  141.  
  142. The user's choice will be returned to you as a number, with the first choice
  143. being numbered 1.  If <ESC> was pressed, 0 will be returned.
  144.  
  145.    BarMenu PickList$(), Row%, LeftCol%, RightCol%, Attr%, HiAttr%, Prompt$
  146.  
  147. PickList$()   list of items to choose from
  148. Row%          row on which to display the bar
  149. LeftCol%      leftmost column of the bar
  150. RightCol%     rightmost column of the bar (use -1 for auto-sizing)
  151. Attr%         bar color/attribute (see CalcAttr)
  152. HiAttr%       bar highlight color/attribute (see CalcAttr)
  153. Prompt$       prompt text (displayed at the left side of the bar)
  154. -------
  155. Row%          number of the chosen item (1-items, or 0 if <ESC>)
  156.  
  157. Name  : BarMenuM             (Bar Menu with Mouse)
  158. Class : Input, Mouse
  159. Level : Clone
  160.  
  161. This is a bar menu routine.  It functions just like BarMenu, but supports the
  162. use of a mouse as well as the keyboard.
  163.  
  164.    BarMenuM PickList$(), Row%, LeftCol%, RightCol%, Attr%, HiAttr%, Prompt$,
  165.       Mouse%, ShowCursor%
  166.  
  167. PickList$()   list of items to choose from
  168. Row%          row on which to display the bar
  169. LeftCol%      leftmost column of the bar
  170. RightCol%     rightmost column of the bar (use -1 for auto-sizing)
  171. Attr%         bar color/attribute (see CalcAttr)
  172. HiAttr%       bar highlight color/attribute (see CalcAttr)
  173. Prompt$       prompt text (displayed at the left side of the bar)
  174. Mouse%        whether a mouse is available (0 no)
  175. ShowCursor%   not used
  176. -------
  177. Row%          number of the chosen item (1-items, or 0 if <ESC>)
  178.  
  179. Name  : Bickel               (Bickel comparison)
  180. Class : String
  181. Level : Any
  182.  
  183. A string comparison routine, Bickel allows you to see how closely two strings
  184. match.  The better the match, the larger the returned value will be.  Since
  185. there is no constant minimum or maximum value, this routine is best used for
  186. applications involving dictionary searches.  You would scan the dictionary
  187. and make a list of the best matches.  This is appropriate for a spelling
  188. checker, for instance.
  189.  
  190.    Bickel St1$, St2$, Result%
  191.  
  192. St1$      first string to compare
  193. St2$      second string to compare
  194. -------
  195. Result%   resulting "match magnitude" value
  196.  
  197. Name  : BigPrint             (Big Print)
  198. Class : Display
  199. Level : BIOS
  200.  
  201. As the name suggests, this routine displays text in large characters.  How
  202. large?  Eight times as high and as wide as normal!  Each "big character" will
  203. be composed of many normal-sized characters.  You may choose the normal
  204. character used to create the big characters (the default is a CHR$(219) solid
  205. block character, if you pass a null string here).
  206.  
  207. You should avoid using CHR$(128) to CHR$(255) when in either of the CGA
  208. graphics modes, as many CGAs are unable to display these characters when in
  209. graphics mode.
  210.  
  211.    BigPrint St$, FormCh$, Row%, Column%, Attr%
  212.  
  213. St$       string to display in big characters
  214. FormCh$   character used to compose the big characters
  215. Row%      starting row
  216. Column%   starting column
  217. Attr%     color/attribute of big characters (see CalcAttr)
  218.  
  219. Name  : BinSeekD             (Binary Seek Double precision)
  220. Class : Array management
  221. Level : Any
  222.  
  223. This routine uses binary search techniques to locate a specific number in a
  224. sorted double-precision array.  Each number in the array must be unique (no
  225. duplicates) for this to work.  This is a very, very fast routine and is
  226. especially handy for look-up tables.
  227.  
  228. The array is expected to begin at element 1.  You may specify the maximum
  229. element to search, allowing use of only part of an array.
  230.  
  231. A single number is returned in Posn%.  If Posn% is greater than zero, the
  232. target number was found and Posn% is the position in the array where it was
  233. found.  If Posn% is negative, the target number was not found, but it could
  234. be inserted into the array at the -Posn% element.  If the number is zero, the
  235. target number was not found and there is no room in the array to add any more
  236. values.
  237.  
  238.    BinSeekD Array#(), Elements%, Target#, Posn%
  239.  
  240. Array#()    array of sorted, unique values to search
  241. Elements%   maximum array element to search
  242. Target#     value to look for
  243. -------
  244. Posn%       whether and where the target was found (see above for details)
  245.  
  246. Name  : BinSeekI             (Binary Seek Integer)
  247. Class : Array management
  248. Level : Any
  249.  
  250. This routine uses binary search techniques to locate a specific number in a
  251. sorted integer array.  Each number in the array must be unique (no
  252. duplicates) for this to work.  This is a very, very fast routine and is
  253. especially handy for look-up tables.
  254.  
  255. The array is expected to begin at element 1.  You may specify the maximum
  256. element to search, allowing use of only part of an array.
  257.  
  258. A single number is returned in Posn%.  If Posn% is greater than zero, the
  259. target number was found and Posn% is the position in the array where it was
  260. found.  If Posn% is negative, the target number was not found, but it could
  261. be inserted into the array at the -Posn% element.  If the number is zero, the
  262. target number was not found and there is no room in the array to add any more
  263. values.
  264.  
  265.    BinSeekI Array%(), Elements%, Target%, Posn%
  266.  
  267. Array%()    array of sorted, unique values to search
  268. Elements%   maximum array element to search
  269. Target%     value to look for
  270. -------
  271. Posn%       whether and where the target was found (see above for details)
  272.  
  273. Name  : BinSeekL             (Binary Seek Long integer)
  274. Class : Array management
  275. Level : Any
  276.  
  277. This routine uses binary search techniques to locate a specific number in a
  278. sorted long integer array.  Each number in the array must be unique (no
  279. duplicates) for this to work.  This is a very, very fast routine and is
  280. especially handy for look-up tables.
  281.  
  282. The array is expected to begin at element 1.  You may specify the maximum
  283. element to search, allowing use of only part of an array.
  284.  
  285. A single number is returned in Posn%.  If Posn% is greater than zero, the
  286. target number was found and Posn% is the position in the array where it was
  287. found.  If Posn% is negative, the target number was not found, but it could
  288. be inserted into the array at the -Posn% element.  If the number is zero, the
  289. target number was not found and there is no room in the array to add any more
  290. values.
  291.  
  292.    BinSeekL Array&(), Elements%, Target&, Posn%
  293.  
  294. Array&()    array of sorted, unique values to search
  295. Elements%   maximum array element to search
  296. Target&     value to look for
  297. -------
  298. Posn%       whether and where the target was found (see above for details)
  299.  
  300. Name  : BinSeekS             (Binary Seek Single precision)
  301. Class : Array management
  302. Level : Any
  303.  
  304. This routine uses binary search techniques to locate a specific number in a
  305. sorted single-precision array.  Each number in the array must be unique (no
  306. duplicates) for this to work.  This is a very, very fast routine and is
  307. especially handy for look-up tables.
  308.  
  309. The array is expected to begin at element 1.  You may specify the maximum
  310. element to search, allowing use of only part of an array.
  311.  
  312. A single number is returned in Posn%.  If Posn% is greater than zero, the
  313. target number was found and Posn% is the position in the array where it was
  314. found.  If Posn% is negative, the target number was not found, but it could
  315. be inserted into the array at the -Posn% element.  If the number is zero, the
  316. target number was not found and there is no room in the array to add any more
  317. values.
  318.  
  319.    BinSeekS Array!(), Elements%, Target!, Posn%
  320.  
  321. Array!()    array of sorted, unique values to search
  322. Elements%   maximum array element to search
  323. Target!     value to look for
  324. -------
  325. Posn%       whether and where the target was found (see above for details)
  326.  
  327. Name  : BinSeekSt            (Binary Seek String)
  328. Class : Array management
  329. Level : Any
  330.  
  331. This routine uses binary search techniques to locate a specific string in a
  332. sorted string array.  Each string in the array must be unique (no duplicates)
  333. for this to work.  This is a very, very fast routine and is especially handy
  334. for look-up tables.
  335.  
  336. The string array is expected to begin at element 1.  You may specify the
  337. maximum element to search, allowing use of only part of an array.  You must
  338. specify whether capitalization matters-- set CapsCount% to 0 if it doesn't.
  339.  
  340. A single number is returned in Posn%.  If the number is greater than zero,
  341. the target string was found, and the number is the position in the array
  342. where it was found.  If the number is negative, the target string was not
  343. found, but it could be inserted into the array at the -Posn% element.  If the
  344. number is zero, the target string was not found and there is no room in the
  345. array to add any more values.
  346.  
  347.    BinSeekSt Array$(), Elements%, Target$, CapsCount%, Posn%
  348.  
  349. Array$()    array of sorted, unique values to search
  350. Elements%   maximum array element to search
  351. Target$     string to look for
  352. CapsCount%  0 if capitalization doesn't matter
  353. -------
  354. Posn%       whether and where the target was found (see above for details)
  355.  
  356. Name  : BIOSInkey            (BIOS INKEY$)
  357. Class : Input
  358. Level : BIOS
  359.  
  360. BIOSInkey works like INKEY$, but it gets its key directly by asking the BIOS.
  361. The primary advantage of this is that you get the "scan" code as well as the
  362. ASCII code of the key.  The scan code is independent of the shift status--
  363. for instance, the scan code for "A" is the same as the scan code for "a" or
  364. Control-A or Alt-A.  This can be very handy.
  365.  
  366. If there is no key available, both the scan code and ASCII code will be zero.
  367.  
  368.    BIOSInkey AscCode%, ScanCode%
  369.  
  370. -------
  371. AscCode%    ASCII code of the key, if any
  372. ScanCode%   scan code of the key, if any
  373.  
  374. Name  : BkScroll             (Backward Scroll)
  375. Class : Display
  376. Level : BIOS
  377.  
  378. This routine scrolls any selected part of the display down-- it does a
  379. backwards scroll.  You may scroll as many times as you like, or scroll "zero"
  380. times to totally clear the selected part of the display.
  381.  
  382. Note that BIOS-level scrolling can cause the screen to flicker on some CGAs
  383. due to a combination of unfortunate design factors.
  384.  
  385.    BkScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  386.  
  387. TopRow%      top row of the area to scroll
  388. LeftCol%     left column of the area to scroll
  389. BottomRow%   top row of the area to scroll
  390. RightCol%    left column of the area to scroll
  391. Times%       number of times (or rows) to scroll
  392.  
  393. Name  : BkSpace              (Backspace)
  394. Class : Display
  395. Level : BIOS
  396.  
  397. Although CHR$(8) is supposed to mean "backspace", it shows up as a graphics
  398. character when BASIC prints it.  This routine does an actual backspace with
  399. full wrap-- if it's at the beginning of the line, it will move back to the
  400. previous line (if there is one).  It backspaces destructively (erasing the
  401. previous character) from the current cursor position.  The new cursor is
  402. returned to you, since QuickBASIC may ignore the new status.
  403.  
  404.    BkSpace Row%, Column%       ' do the backspace
  405.    LOCATE Row%, Column%        ' inform QuickBASIC
  406.  
  407. -------
  408. Row%      new row
  409. Column%   new column
  410.  
  411. Name  : Blink                (Blink toggle)
  412. Class : Display
  413. Level : BIOS / Clone (see text)
  414.  
  415. It is possible to make characters in text mode blink by giving them an
  416. appropriate "color".  I wouldn't mention something so obvious but for another
  417. possibility which is less widely known: blinking can be turned off, in which
  418. case the characters that would have otherwise blinked will instead have a
  419. bright background.  In other words, turn off blinking, and you double the
  420. possible number of background colors.
  421.  
  422. This technique will always work with EGA and VGA displays.  It can also be
  423. used with MDA/Hercules and CGA displays, on which it will almost always
  424. work... unfortunately, on some less-than-perfect PC clones, it will cause the
  425. computer to lock up instead.  So, be careful with this one!
  426.  
  427.    Blink SetBlink%
  428.  
  429. SetBlink%    whether to blink (-1) or use intense backgrounds (0)
  430.  
  431. Name  : BlockMove            (Block memory Move)
  432. Class : Memory
  433. Level : Clone
  434.  
  435. This routine allows you to copy or "move" a block of data from one memory
  436. location to another.  It isn't very bright, so if the memory areas overlap,
  437. you will have to tell the routine to "move backwards" instead of forwards.
  438. In that case, you will also have to change the offsets to point to the ends
  439. of the memory areas instead of the beginnings.
  440.  
  441. Normally, you can use forward moves.  In that case, the offsets you specify
  442. are those of the beginning of the memory areas.  If backward moves are
  443. required, the offsets specified are those of the end of the memory areas.
  444.  
  445. If you are familiar with assembly language, you may recognize this as a
  446. straightforward implementation of the "REP MOVSB" instruction.
  447.  
  448. You may move up to 65,520 bytes at a time, provided that the addresses are in
  449. normalized form (if you don't know what this means, you probably don't need
  450. to worry about it).
  451.  
  452. This routine can be used to copy information to an array from any area of
  453. memory (the BIOS data area, the screen, another array, etc), or vice versa.
  454. It can also be used to do things like insert/delete elements from an array,
  455. scroll the screen, fill the screen with a specified character, and so on.
  456.  
  457.    BlockMove FromSeg%, FromOfs%, ToSeg%, ToOfs%, Bytes&, Direction%
  458.  
  459. FromSeg%    segment of the area from which to copy
  460. FromOfs%    offset of the area from which to copy
  461. ToSeg%      segment of the area to which to copy
  462. ToOfs%      offset of the area to which to copy
  463. Bytes&      number of bytes to copy (0-65,520)
  464. Direction%  direction to copy (0 if forward, else backward)
  465.  
  466. Name  : BootDrive            (get Boot Drive)
  467. Class : Disk
  468. Level : DOS 4.0+
  469.  
  470. This routine tells you which drive was used to boot the system.  See also
  471. BootDrive2, a function version of this routine.
  472.  
  473. One use for BootDrive would be in installation programs, to determine the
  474. most likely destination drive for your software.
  475.  
  476.    Drive$ = "x"
  477.    BootDrive Drive$
  478.  
  479. -------
  480. Drive$   boot drive-- set it to at least one char beforehand!
  481.  
  482. Name  : BootDrive2$          (get Boot Drive)
  483. Class : Disk
  484. Level : DOS 4.0+
  485.  
  486. This routine tells you which drive was used to boot the system.
  487.  
  488. One use for BootDrive2 would be in installation programs, to determine the
  489. most likely destination drive for your software.
  490.  
  491.    Drive$ = BootDrive2$
  492.  
  493. -------
  494. Drive$   boot drive (null if wrong DOS version)
  495.  
  496. Name  : BreakCheck%          (Break key Check)
  497. Class : Input
  498. Level : BIOS
  499.  
  500. This routine is for use after BreakOff.  It allows you to see whether the
  501. Break key has been pressed since you last checked.  The Break status is
  502. cleared after the value is returned.
  503.  
  504.    Brk% = BreakCheck%
  505.    IF Brk% THEN
  506.       PRINT "** Break key pressed **"
  507.       GOTO EndProgram
  508.    END IF
  509.  
  510. -------
  511. Brk%    whether Break was pressed (0 no, -1 yes)
  512.  
  513. Name  : BreakOff             (Break key Off)
  514. Class : Input
  515. Level : BIOS
  516.  
  517. This routine disables the Break key.  It is not effective in the QB or QBX
  518. environments, as these use their own keyboard handler.  It is also not
  519. effective if your program was compiled with Debugging on (/D switch).
  520.  
  521. Note that BreakOff installs a routine to intercept some interrupt vectors.
  522. You MUST use the BreakOffDone routine to reverse this process before your
  523. program ends, or the computer will be left in an indeterminate state and will
  524. probably crash the next time Break is pressed!
  525.  
  526.    BreakOff
  527.  
  528. Name  : BreakOffDone         (Break key Off routine Done)
  529. Class : Input
  530. Level : BIOS
  531.  
  532. This routine is used after BreakOff to restore the original interrupt
  533. vectors.  If you use BreakOff, you MUST call BreakOffDone before your program
  534. ends!  Otherwise, the computer will probably crash the next time someone
  535. presses Break.
  536.  
  537.    BreakOffDone
  538.  
  539. Name  : BSq                  (Blank Squeeze)
  540. Class : String
  541. Level : Any
  542.  
  543. A simple compression routine, BSq "squeezes" the blank spaces in a string.
  544. It is designed expressly for use with text data.  The text may not contain
  545. more than 131 spaces in a row, or CHR$(128) through CHR$(255), which are used
  546. in the compression.
  547.  
  548. Average text files are liable to be compressed by around 16%.  Files that
  549. contain more spaces, such as structured programs, will benefit more.  The
  550. compression algorithm is simple but extremely fast, adding no noticeable
  551. overhead to string processing.
  552.  
  553. See also BUsq, BUsqLen.
  554.  
  555.    BSq St$, StLen%
  556.    St$ = LEFT$(St$, StLen%)
  557.  
  558. St$     string to compress
  559. -------
  560. St$     compressed string
  561. StLen%  length of the compressed string
  562.  
  563. Name  : BUsq                 (Blank Unsqueeze)
  564. Class : String
  565. Level : Any
  566.  
  567. This routine is used to uncompress strings that were processed by BSq.
  568. Before uncompression, the BUsqLen routine must be used to find out how long
  569. the resulting string will be.
  570.  
  571. See also BSq, BUsqLen.
  572.  
  573.    BUsqLen St$, StLen%
  574.    IF StLen% < 0 THEN
  575.       PRINT "Error in compressed string"
  576.    ELSE
  577.       Result$ = SPACE$(StLen%)
  578.       BUsq St$, Result$
  579.    END IF
  580.  
  581. St$      string to uncompress
  582. -------
  583. Result$  uncompressed string
  584.  
  585. Name  : BUsqLen              (Blank Unsqueeze Length)
  586. Class : String
  587. Level : Any
  588.  
  589. This routine is used in coordination with BUsq to uncompress strings that
  590. were processed by BSq.  It determines what the length of the uncompressed
  591. string will be, which is necessary to initialize the string for BUsq.
  592.  
  593. See also BSq, BUsq.
  594.  
  595.    BUsqLen St$, StLen%
  596.    IF StLen% < 0 THEN
  597.       PRINT "Error in compressed string"
  598.    ELSE
  599.       Result$ = SPACE$(StLen%)
  600.       BUsq St$, Result$
  601.    END IF
  602.  
  603. St$      string to uncompress
  604. -------
  605. StLen%   length of the uncompressed string
  606.  
  607. Name  : CalcAttr             (Calculate Attribute)
  608. Class : Display
  609. Level : Any
  610.  
  611. Many of the display routines in this library require an "attribute" rather
  612. than foreground and background colors.  An attribute is a combination of the
  613. foreground and background colors in a format which is used by all types of
  614. displays when in text mode.
  615.  
  616. Foreground colors are usually specified as 0-31, with backgrounds as 0-7.  If
  617. you turn blinking off (see Blink), it may be more convenient to express the
  618. same thing as foreground 0-15, background 0-15.  The CalcAttr routine will
  619. accept either way of expressing it.
  620.  
  621. Note, however, that UnCalcAttr will always return the former pair of results,
  622. since it has no way of knowing whether Blink has been used (foreground 0-31,
  623. background 0-15).  See UnCalcAttr for more details and a solution.
  624.  
  625. See also CalcAttr2, the FUNCTION version of this routine.
  626.  
  627.    CalcAttr Foreground%, Background%, Attr%
  628.  
  629. Foreground%  foreground color
  630. Background%  background color
  631. -------
  632. Attr%        color "attribute"
  633.  
  634. Name  : CalcAttr2%           (Calculate Attribute)
  635. Class : Display
  636. Level : Any
  637.  
  638. Many of the display routines in this library require an "attribute" rather
  639. than foreground and background colors.  An attribute is a combination of the
  640. foreground and background colors in a format which is used by all types of
  641. displays when in text mode.
  642.  
  643. Foreground colors are usually specified as 0-31, with backgrounds as 0-7.  If
  644. you turn blinking off (see Blink), it may be more convenient to express the
  645. same thing as foreground 0-15, background 0-15.  The CalcAttr2 routine will
  646. accept either way of expressing it.
  647.  
  648. Note, however, that UnCalcAttr will always return the former pair of results,
  649. since it has no way of knowing whether Blink has been used (foreground 0-31,
  650. background 0-15).  See UnCalcAttr for more details and a solution.
  651.  
  652. See also CalcAttr, the SUB version of this routine.
  653.  
  654.    Attr% = CalcAttr2%(Foreground%, Background%)
  655.  
  656. Foreground%  foreground color
  657. Background%  background color
  658. -------
  659. Attr%        color "attribute"
  660.  
  661. Name  : CalcDate             (Calculate Date)
  662. Class : Time
  663. Level : Any
  664.  
  665. This routine calculates what the date will be a given number of days from
  666. now, either in the past or the future.  Actually, you may use any starting
  667. date, not just the current date.  An error code is returned if the starting
  668. date or resulting date are not valid.  Dates may not preceed January 1, 1900.
  669.  
  670. CalcDate accepts the date in any standard form ("01/30/91" or "01-30-1991",
  671. for example) and returns its results in the same format.
  672.  
  673.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  674.  
  675. StartDate$   starting date
  676. Days&        number of days from the current date (0 or more)
  677. Direction%   whether to return result in the future (0) or past (nonzero)
  678. -------
  679. NewDate$     resulting date
  680. ErrCode%     whether the dates are valid (0 yes)
  681.  
  682. Name  : CalcSize             (Calculate array Size)
  683. Class : Display
  684. Level : Any
  685.  
  686. This routine calculates the necessary DIM size for an integer array, assuming
  687. that you intend to store display data in the array.  This is most useful in
  688. conjunction with DGetScreen and GetScreen.
  689.  
  690.    CalcSize TopRow%, LeftCol%, BottomRow%, RightCol%, Elements%
  691.    DIM Array%(1 TO Elements%)
  692.  
  693. TopRow%      top row of the display area
  694. LeftCol%     left column of the display area
  695. BottomRow%   top row of the display area
  696. RightCol%    left column of the display area
  697. -------
  698. Elements%    required size of the integer array
  699.  
  700. Name  : CalcVGAColor         (Calculate VGA palette Color)
  701. Class : Display
  702. Level : Any
  703.  
  704. The QuickBASIC manual gives a cumbersome formula for calculating VGA palette
  705. colors.  This routine does it faster and with less fuss.  All you need to do
  706. is pass it the appropriate intensity values (0-63) and you get back a long
  707. integer, just the way BASIC wants it.
  708.  
  709.    CalcVGAColor Red%, Green%, Blue%, Colour&
  710.  
  711. Red%      red   intensity
  712. Green%    green intensity
  713. Blue%     blue  intensity
  714. -------
  715. Colour&   color value for use in the PALETTE statement
  716.  
  717. Name  : Carrier              (detect Carrier)
  718. Class : Serial
  719. Level : Clone
  720.  
  721. If you write communications programs, particularly things like doors and
  722. BBSes, you probably want to keep an eye on the carrier.  BASIC won't do it,
  723. but we will!
  724.  
  725.    Carrier CommPort%, CarrierHigh%
  726.  
  727. CommPort%     serial port number (1-4, although BASIC only handles 1-2)
  728. -------
  729. CarrierHigh%  zero if no carrier
  730.  
  731. Name  : CatchError           (Catch Error from SHELL)
  732. Class : Miscellaneous
  733. Level : Clone
  734.  
  735. The CatchError routine is used in conjunction with GetError.  It lets you get
  736. the exit code (error level) returned by a program to which you have SHELLed.
  737. Since CatchError hooks an interrupt to do its work, you must always make sure
  738. to use GetError afterwards to "clean up".  See also GetError.
  739.  
  740. Note that differences in DOS mean that this routine will not always work.  In
  741. some versions of DOS, you can only get the error level if a batch file was
  742. executed; in others, you can't get the error level from a batch file at all.
  743. Sorry about that.  I don't know of any way to work around it.
  744.  
  745.    CatchError
  746.    SHELL ProgramName$
  747.    GetError ExitCode%
  748.  
  749. Name  : CDROM                (check for CD-ROM)
  750. Class : Disk / Equipment
  751. Level : DOS
  752.  
  753. This routine tells you whether the Microsoft CD-ROM Extensions are installed.
  754. If so, it tells you what the letter of the first CD-ROM logical drive is and
  755. how many logical drives exist.
  756.  
  757. Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
  758. installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
  759. This may cause unexpected results.  I'm not yet sure whether DOS 5.0 is
  760. similarly afflicted.
  761.  
  762.    FirstDrive$ = "x"
  763.    CDROM FirstDrive$, Drives%
  764.  
  765. -------
  766. FirstDrive$   letter of the first logical drive (init to at least one space!)
  767. Drives%       number of logical drives available (0 if no CD-ROM is there)
  768.  
  769. Name  : CDROM2%              (check for CD-ROM)
  770. Class : Disk / Equipment
  771. Level : DOS
  772.  
  773. This routine tells you whether the Microsoft CD-ROM Extensions are installed.
  774. If so, it tells you how many logical drives exist.
  775.  
  776. Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
  777. installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
  778. This may cause unexpected results.  I'm not yet sure whether DOS 5.0 is
  779. similarly afflicted.
  780.  
  781.    Drives% = CDROM2%
  782.  
  783. -------
  784. Drives%       number of logical drives available (0 if no CD-ROM is there)
  785.  
  786. Name  : CheckDate            (Check Date validity)
  787. Class : Time
  788. Level : Any
  789.  
  790. This routine checks a date to see if it is valid.
  791.  
  792.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  793.  
  794. MonthNr%     month number (1-12)
  795. DayNr%       day number (1-31)
  796. YearNr%      year number (1900 on; years <100 will be assumed 20th century)
  797. -------
  798. ErrCode%     whether the date is valid (0 yes)
  799.  
  800. Name  : CheckDisk            (Check Disk readiness)
  801. Class : Disk
  802. Level : DOS
  803.  
  804. The CheckDisk routine determines whether a disk is ready.  About the only
  805. thing it won't tell you is if a disk is write-protected or out of space.
  806. Since the PBClone disk routines all contain critical error handling, which
  807. reports back an appropriate error code for all such problems, this routine
  808. isn't really needed any more.  It's included for compatibility with older
  809. ProBas programs.
  810.  
  811. Note that DOS versions before 3.0 do not return as useful error codes as
  812. later versions.  Under such circumstances, both "unformatted disk" and "open
  813. drive door" will be returned as "open drive door".
  814.  
  815.    CheckDisk Drive$, ErrCode%
  816.  
  817. Drive$    letter of the drive to check
  818. -------
  819. ErrCode%  0: no error; 1: unformatted disk; 2: open drive door; 3: bad drive
  820.  
  821. Name  : CheckDsk%            (Check Disk readiness)
  822. Class : Disk
  823. Level : DOS
  824.  
  825. The CheckDsk% function determines whether a disk is ready.  About the only
  826. thing it won't tell you is if a disk is write-protected or out of space.
  827. Since the PBClone disk routines all contain critical error handling, which
  828. reports back an appropriate error code for all such problems, this routine
  829. isn't really needed any more.  It's included for compatibility with older
  830. ProBas programs.
  831.  
  832. Note that DOS versions before 3.0 do not return as useful error codes as
  833. later versions.  Under such circumstances, both "unformatted disk" and "open
  834. drive door" will be returned as "open drive door".
  835.  
  836.    ErrCode% = CheckDsk%(Drive$)
  837.  
  838. Drive$    letter of the drive to check
  839.  
  840. Name  : CheckKey             (Check for Key or mouse)
  841. Class : Input, Mouse
  842. Level : BIOS
  843.  
  844. This routine is kind of an extended version of INKEY$.  It checks the
  845. keyboard to see if any key is available and gets the key if it is.  At your
  846. option, it can also check the mouse to see if a button has been pressed.
  847.  
  848.    CheckKey Mouse%, ASCIIcode%, ScanCode%, LeftButton%, RightButton%
  849.  
  850. Mouse%        whether to check the mouse (0: no)
  851. -------
  852. ASCIIcode%    ASCII code of the key pressed
  853. ScanCode%     scan code of the key pressed (0 if none)
  854. LeftButton%   whether the left  mouse button was pressed
  855. RightButton%  whether the right mouse button was pressed
  856.  
  857. Name  : CheckKey3            (Check for Key or 3-button mouse)
  858. Class : Input, Mouse
  859. Level : BIOS
  860.  
  861. This routine is kind of an extended version of INKEY$.  It checks the
  862. keyboard to see if any key is available and gets the key if it is.  At your
  863. option, it can also check the mouse to see if a button has been pressed.
  864.  
  865.    CheckKey3 Mouse%, ASCIIcode%, ScanCode%, LeftButton%, MidBttn%, RightButton%
  866.  
  867. Mouse%        whether to check the mouse (0: no)
  868. -------
  869. ASCIIcode%    ASCII code of the key pressed
  870. ScanCode%     scan code of the key pressed (0 if none)
  871. LeftButton%   whether the left   mouse button was pressed
  872. MidBttn%      whether the middle mouse button was pressed
  873. RightButton%  whether the right  mouse button was pressed
  874.  
  875. Name  : CheckShare           (Check for SHARE)
  876. Class : Disk
  877. Level : DOS
  878.  
  879. The CheckShare routine determines whether SHARE.EXE is active.  This is
  880. particularly helpful before using the BASIC OPEN statement, which will fail
  881. if you request file sharing when it's not available.  The PBClone file
  882. routines handle such situations automatically, so CheckShare is not needed
  883. for them.
  884.  
  885.    CheckShare ShareActive%
  886.  
  887. -------
  888. ShareActive%   whether SHARE is active (0 if no)
  889.  
  890. Name  : CheckShare2%         (Check for SHARE)
  891. Class : Disk
  892. Level : DOS
  893.  
  894. The CheckShare2% function determines whether SHARE.EXE is active.  This is
  895. particularly helpful before using the BASIC OPEN statement, which will fail
  896. if you request file sharing when it's not available.  The PBClone file
  897. routines handle such situations automatically, so CheckShare2% is not needed
  898. for them.
  899.  
  900.    ShareActive% = CheckShare2%
  901.  
  902. -------
  903. ShareActive%   whether SHARE is active (0 if no)
  904.  
  905. Name  : Checksum             (calculate Checksum)
  906. Class : String / Serial
  907. Level : Any
  908.  
  909. The Checksum routine calculates a checksum on a string.  The resulting number
  910. is compatible with Xmodem and Ymodem checksum routines and will vary from
  911. 0-255.  This checksum provides a minimal, but fast, check of what characters
  912. are contained in the string.  See also CRC1.
  913.  
  914.    Checksum St$, ChkSum%
  915.  
  916. St$       string to process
  917. -------
  918. ChkSum%   checksum of the characters in the string
  919.  
  920. Name  : Cipher               (Cipher)
  921. Class : String
  922. Level : Any
  923.  
  924. This is a very simple text encryption routine.  It isn't particularly hard to
  925. crack, but will provide a basic level of security for undemanding
  926. applications.  The same routine can be used either to encrypt or decrypt
  927. text.  The original text may contain any character; likewise, the resulting
  928. text.  This is not well suited for use with sequential files-- if such is
  929. required, see CipherP.
  930.  
  931. I'd suggest using a long password composed of an unlikely string of
  932. characters, e.g. "#*@@!A^%x{.'".
  933.  
  934.    Cipher St$, Password$
  935.  
  936. St$        string to encrypt or decrypt
  937. Password$  password
  938. -------
  939. St$        encrypted or decrypted string
  940.  
  941. Name  : CipherP              (Cipher Printable)
  942. Class : String
  943. Level : Any
  944.  
  945. This is a very simple text encryption routine.  It isn't particularly hard to
  946. crack, but will provide a basic level of security for undemanding
  947. applications.  The same routine can be used either to encrypt or decrypt
  948. text.  The original text may contain any character below CHR$(128), as may
  949. the password.  The resulting text will be printable, if bizarre (all
  950. characters will be above CHR$(127)), and may be used with sequential files.
  951.  
  952. This routine is potentially less secure than the Cipher routine (see).
  953.  
  954. I'd suggest using a long password composed of an unlikely string of
  955. characters, e.g. "#*@@!A^%x{.'".
  956.  
  957.    CipherP St$, Password$
  958.  
  959. St$        string to encrypt or decrypt
  960. Password$  password
  961. -------
  962. St$        encrypted or decrypted string
  963.  
  964. Name  : ClearArea            (Clear a screen Area)
  965. Class : Display
  966. Level : Clone
  967.  
  968. This routine clears an area of the screen to a specified color.  The clearing
  969. is done by removing random characters until the area is totally clear.
  970.  
  971.    ClearArea TopRow%, LeftCol%, BottomRow%, RightCol%, Attr%, Fast%
  972.  
  973. TopRow%     top row of area to clear
  974. LeftCol%    left column of area to clear
  975. BottomRow%  bottom row of area to clear
  976. RightCol%   right column of area to clear
  977. Attr%       color/attribute to clear to
  978. Fast%       whether to use fast displays (may cause snow on CGAs) (0 no)
  979.  
  980. Name  : Clock                (Clock)
  981. Class : Display / Time
  982. Level : Clone
  983.  
  984. This routine allows you to turn a visible time display on or off.  When on,
  985. the time will be continuously displayed at a selected location while your
  986. program continues processing.  The clock is managed as a background process,
  987. in effect doing some simple multitasking.
  988.  
  989. You should turn the clock off before you terminate your program, including
  990. any time you execute another program with RUN.  The clock can be safely kept
  991. on when you SHELL to another program, however, as long as you can be sure
  992. that control will return to your program when the other is done.
  993.  
  994. The clock must also be turned off if you change any of its parameters with
  995. the ClockSet routine (see).
  996.  
  997. The clock will only be visible when the display is in text mode.  The use of
  998. PLAY or SOUND statements may shut off the clock, depending on your version of
  999. the BASIC compiler.
  1000.  
  1001.    Clock DisplayOn%
  1002.  
  1003. DisplayOn%   whether to display the clock (0 if no)
  1004.  
  1005. Name  : ClockSet             (Clock Settings)
  1006. Class : Display / Time
  1007. Level : Clone
  1008.  
  1009. The ClockSet routine is used in conjunction with Clock (see).  It should only
  1010. be used when the clock is turned off.
  1011.  
  1012. This routine allows you to set 12-hour or 24-hour time, whether to display
  1013. the seconds or not, how often to update the clock display (in 1/18th seconds;
  1014. 9 is usually the best choice), where to display the clock and in what color,
  1015. and whether to use flicker-free displays (needed for cheap CGAs only).  The
  1016. defaults are 12-hour time, display seconds, put the time (in white on black)
  1017. in the upper right corner, and display quickly (may flicker on some CGAs).
  1018.  
  1019.    ClockSet Hours24%, Seconds%, Updates%, Row%, Column%, Attr%, Fast%
  1020.  
  1021. Hours24%   whether to display 24-hour time (0 if no)
  1022. Seconds%   whether to display seconds (0 if no)
  1023. Updates%   display update frequency in 1/18th seconds (9 is usually best)
  1024. Row%       row on which to display the clock
  1025. Col%       column at which to display the clock
  1026. Attr%      color/attribute to use (see CalcAttr)
  1027. Fast%      whether to use fast mode (nonzero if so; may cause snow on CGAs)
  1028.  
  1029. Name  : CloseA               (Close Archive)
  1030. Class : Disk / Time
  1031. Level : DOS
  1032.  
  1033. This routine closes an archive opened by FindFirstA or FindNextA.  It must be
  1034. used when you are done searching the archive.
  1035.  
  1036. Routines in this series include:
  1037.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  1038.    GetSizeAL, GetStoreA
  1039.  
  1040.    CloseA
  1041.  
  1042. Name  : ClrCols              (Clear Columns)
  1043. Class : Display
  1044. Level : BIOS
  1045.  
  1046. This routine clears the current row between the specified columns, inclusive.
  1047. It does not affect the cursor position.
  1048.  
  1049.    ClrCols StartCol%, EndCol%
  1050.  
  1051. StartCol%  starting column
  1052. EndCol%    ending column
  1053.  
  1054. Name  : ClrEOL               (Clear to End Of Line)
  1055. Class : Display
  1056. Level : BIOS
  1057.  
  1058. This routine clears from the cursor to the end of the line, inclusive.  It
  1059. does not affect the current cursor position.
  1060.  
  1061.    ClrEOL
  1062.  
  1063. Name  : ClrEOP               (Clear to End Of Page)
  1064. Class : Display
  1065. Level : BIOS
  1066.  
  1067. This routine clears from the cursor to the end of the display, inclusive.  It
  1068. does not affect the current cursor position.
  1069.  
  1070.    ClrEOP
  1071.  
  1072. Name  : ClrSOL               (Clear to Start Of Line)
  1073. Class : Display
  1074. Level : BIOS
  1075.  
  1076. This routine clears from the start of the line to the cursor, inclusive.  It
  1077. does not affect the current cursor position.
  1078.  
  1079.    ClrSOL
  1080.  
  1081. Name  : ClrKbd               (Clear Keyboard buffer)
  1082. Class : Input
  1083. Level : DOS
  1084.  
  1085. ClrKbd clears the keyboard buffer, discarding any keys that may be waiting.
  1086. This is a good idea for situations where an unexpected input is made and you
  1087. don't want to chance it being answered accidentally by keys that were typed
  1088. beforehand-- for instance, in the event of an error or other condition where
  1089. it is important that the user see a message or take an action before pressing
  1090. a key.
  1091.  
  1092.    ClrKbd
  1093.  
  1094. Name  : ClrSOP               (Clear to Start Of Page)
  1095. Class : Display
  1096. Level : BIOS
  1097.  
  1098. This routine clears from the start of the display to the cursor, inclusive.
  1099. It does not affect the current cursor position.
  1100.  
  1101.    ClrSOP
  1102.  
  1103. Name  : CopyFile             (Copy a File)
  1104. Class : Disk
  1105. Level : DOS
  1106.  
  1107. This works like the DOS COPY command, although it does not allow wildcards.
  1108. One file is copied to another, retaining the same date and time.  Full path
  1109. specifications are supported, including drive and subdirectory specs.
  1110.  
  1111. See also FileCopy, which supports wildcards.
  1112.  
  1113.    CopyFile FromFile$, ToFile$, ErrCode%
  1114.  
  1115. FromFile$   name of file to copy
  1116. ToFile$     name of new file to create
  1117. -------
  1118. ErrCode%    0 if no error, else DOS Error
  1119.  
  1120. Name  : CPrintScreen1        (CGA Print Screen [SCREEN 1])
  1121. Class : Display / Printer
  1122. Level : Clone
  1123.  
  1124. This routine dumps a SCREEN 1 display (CGA 320x200) to the printer.  It uses
  1125. the stdprn device (normally PRN or LPT1) by default, although this can be
  1126. altered with the PrtSwap routine.
  1127.  
  1128.    CPrintScreen1
  1129.  
  1130. Name  : CPrintScreen2        (CGA Print Screen [SCREEN 2])
  1131. Class : Display / Printer
  1132. Level : Clone
  1133.  
  1134. This routine dumps a SCREEN 2 display (CGA 640x200) to the printer.  It uses
  1135. the stdprn device (normally PRN or LPT1) by default, although this can be
  1136. altered with the PrtSwap routine.
  1137.  
  1138.    CPrintScreen2
  1139.  
  1140. Name  : CRC                  (calculate CRC)
  1141. Class : String / Serial
  1142. Level : Any
  1143.  
  1144. This routine has become obsolete; the CRC1 routine is much faster.  However,
  1145. CRC is still included for backwards compatibility.
  1146.  
  1147. This routine calculates a complex 16-bit checksum, called a Cyclical
  1148. Redundancy Check (or CRC) on a string.  The results are compatible with
  1149. Xmodem and Ymodem CRC routines.  The CRC provides a fairly reliable check of
  1150. what characters are contained in the string.  See also Checksum.
  1151.  
  1152. If you are using this routine for Xmodem or Ymodem, note that the string
  1153. should be padded with two null characters before calculating a "send" CRC:
  1154. St$ = St$ + STRING$(2, 0).  On receive, you should calculate the CRC on the
  1155. entire data block, plus the received CRC; if the block was received
  1156. correctly, the calculated CRC will be zero in both lsb and msb.
  1157.  
  1158. Although Intel notation uses "lsb, msb" order, the Xmodem/Ymodem CRC uses the
  1159. opposite format, which is why the parameters are ordered in this fashion.
  1160.  
  1161.    CRC St$, CRCmsb%, CRClsb%
  1162.  
  1163. St$       string to process
  1164. -------
  1165. CRCmsb%   most significant byte of CRC
  1166. CRClsb%   least significant byte of CRC
  1167.  
  1168. Name  : CRC1                 (calculate CRC)
  1169. Class : String / Serial
  1170. Level : Any
  1171.  
  1172. This routine calculates a complex 16-bit checksum, called a Cyclical
  1173. Redundancy Check (or CRC) on a string.  The results are compatible with
  1174. Xmodem and Ymodem CRC routines.  The CRC provides a fairly reliable check of
  1175. what characters are contained in the string.  See also Checksum.
  1176.  
  1177. Note that CRC1 does not work like the older CRC routine.  You should not pad
  1178. outgoing strings with a STRING$(2, 0) sequence.
  1179.  
  1180. Although Intel notation uses "lsb, msb" order, the Xmodem/Ymodem CRC uses the
  1181. opposite format, which is why the parameters are ordered in this fashion.
  1182.  
  1183.    CRC St$, CRCmsb%, CRClsb%
  1184.  
  1185. St$       string to process
  1186. -------
  1187. CRCmsb%   most significant byte of CRC
  1188. CRClsb%   least significant byte of CRC
  1189.  
  1190. Name  : Crunch               (Crunch repeated characters)
  1191. Class : String
  1192. Level : Any
  1193.  
  1194. It was hard to decide on a name for this routine, and I don't know if I've
  1195. done the best job.  What Crunch does is to eliminate repeated sequences of
  1196. the same character.  For instance, if you gave it "This    is a   test" and
  1197. asked it to crunch spaces, it would return "This is a test".  I use this to
  1198. filter information from the COMMAND$ function, but it's a good general
  1199. purpose input filter.
  1200.  
  1201.    Crunch St$, Ch$, StLen%
  1202.    St$ = LEFT$(St$, StLen%)
  1203.  
  1204. St$       string to be processed
  1205. Ch$       character to crunch out of the string
  1206. -------
  1207. St$       crunched string
  1208. StLen%    length of the crunched string
  1209.  
  1210. Name  : CtrlKey              (Control Key)
  1211. Class : Input
  1212. Level : Any
  1213.  
  1214. This routine works in conjunction with a key input routine, such as INKEY$ or
  1215. the CheckKey and GetKey routines.  Given the ASCII code of a key, CtrlKey
  1216. returns the associated key letter, if any.  For instance, it returns "A" if
  1217. you pass it ASCII code 1, because that code represents Ctrl-A.
  1218.  
  1219.    CtrlKey ASCIICode%, Ky$
  1220.  
  1221. ASCIICode%   ASCII code of the key
  1222. -------
  1223. Ky$          associated key letter ("" if none)
  1224.  
  1225. Name  : CursorInfo           (Cursor Information)
  1226. Class : Input
  1227. Level : Clone
  1228.  
  1229. While BASIC allows you to set the size and shape of the cursor with LOCATE,
  1230. it's fairly hazardous to do so.  There is no way to find out the maximum size
  1231. of the cursor, so your cursor may end up a peculiar shape on some adapters.
  1232. If you change the cursor size or visibility in a subprogram, you may be
  1233. screwing up the main program.
  1234.  
  1235. CursorInfo offers a solution to these problems.  It returns the current
  1236. cursor visibility and size, plus the maximum size possible with the current
  1237. video adapter.
  1238.  
  1239.    CursorInfo Visible%, StartLine%, EndLine%, MaxLine%
  1240.  
  1241. -------
  1242. Visible%      whether the cursor is visible (0 no, 1 yes)
  1243. StartLine%    starting scan line of cursor
  1244. EndLine%      ending scan line of cursor
  1245. MaxLine%      maximum possible scan line for cursor (minimum is always zero)
  1246.  
  1247. Name  : CWindowManager       (CGA Window Manager)
  1248. Class : Display
  1249. Level : Clone
  1250.  
  1251. CWindowManager displays a pop-up window on a CGA graphics screen.  It is
  1252. intended for SCREEN 1, although it can be used on SCREEN 2 as well (it will
  1253. still have 40 columns and will display shades rather than colors).  The
  1254. window may have any of a variety of frames, a title, or a shadow, and it may
  1255. appear instantly or "grow" onto the screen.
  1256.  
  1257. These are the available frame types:
  1258.     0   no frame
  1259.     1   single lines
  1260.     2   double lines
  1261.     3   single horizontal, double vertical lines
  1262.     4   double horizontal, single vertical lines
  1263.     5   block graphic lines
  1264.  
  1265. Options for growing windows are as follows:
  1266.    -1   grow as fast as possible
  1267.     0   pop onto the screen
  1268.    1+   grow with a specified delay in milliseconds (15 works well for me)
  1269.  
  1270. Note that this routine is different from its ProBas equivalent in a number of
  1271. respects.  The grow delay time is different.  Growing is done more smoothly.
  1272. The shadow and title parameters are not changed by this routine.  A new frame
  1273. type (5) was added.  If a title is too long, it is truncated instead of being
  1274. ignored completely.  Using a -1 as the title foreground color will not turn
  1275. off the title; instead, use a null title string.
  1276.  
  1277.    CWindowManager TopRow%, LeftCol%, BottomRow%, RightCol%, Frame%,
  1278.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Fast%
  1279.  
  1280. TopRow%     top row of window
  1281. LeftCol%    left column of window
  1282. BottomRow%  bottom row of window
  1283. RightCol%   right column of window
  1284. Frame%      frame type (see above)
  1285. Fore%       frame foreground color
  1286. Back%       frame background color
  1287. Grow%       window growing option (see above)
  1288. Shade%      window shadow option (0 for none)
  1289. TFore%      title foreground color
  1290. Title$      window title ("" if none)
  1291. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  1292.  
  1293. Name  : DataSeg              (Data Segment)
  1294. Class : Memory
  1295. Level : Any
  1296.  
  1297. It's rare that you need to know the data segment used by BASIC, but it does
  1298. happen.  DataSeg tells you that value.  This is the segment used by (near)
  1299. strings, static arrays (except in the QuickBASIC environment), some COMMON
  1300. data, BASIC internal variables and so forth.  It is also the area specified
  1301. by a plain "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1302.  
  1303.    DataSeg DSeg%
  1304.  
  1305. -------
  1306. DSeg%     data segment for BASIC
  1307.  
  1308. Name  : Date2Int             (Date to Integer)
  1309. Class : Time
  1310. Level : Any
  1311.  
  1312. This routine compresses a date into a single integer.  Note that this integer
  1313. is not in a format that lends itself to simple computation-- you cannot
  1314. subtract one from another to find out the length of time between them.
  1315. However, as long as the year is in the range 1980-2042, you can compare the
  1316. two integers to see if one date is before or after another.
  1317.  
  1318. You may express the year as either a two-digit or four-digit number.
  1319.  
  1320. The ProBas and PBClone versions of this routine do not work the same way in
  1321. regards to the year.  ProBas assumed that any two-digit year was in the
  1322. 1900s.  In contrast, PBClone assumes that years 80-99 should be converted to
  1323. 1980-1999 and that 0-79 should be converted to 2000-2079.  I consider the
  1324. PBClone method more appropriate, with the turn of the century moving closer.
  1325. The date format used does not allow dates before 1980 anyway, so nothing is
  1326. being lost by this change.
  1327.  
  1328.    Date2Int MonthNr%, Day%, Year%, IntDate%
  1329.  
  1330. MonthNr%     month number (1-12)
  1331. Day%         day (1-31)
  1332. Year%        year (1980-2079; see above for two-digit year handling)
  1333. -------
  1334. IntDate%     date compressed into an integer
  1335.  
  1336. Name  : DateA2R              (Date Actual to Relative)
  1337. Class : Time
  1338. Level : Any
  1339.  
  1340. This routine converts an actual date to a relative date, expressed as a
  1341. number of days.  This allows you to compare dates, find out what the date
  1342. will be in a given number of days (or what it was a given number of days
  1343. ago), see how many days passed between two dates, and so forth.
  1344.  
  1345. I've frequently seen routines of this nature called "Julian date" routines.
  1346. I'm not sure where that nomenclature originated, as it has nothing to do with
  1347. the Julian calendar.  Most of these routines rely on approximations through
  1348. floating point math, and may or may not handle leap years and centuries
  1349. appropriately.  The DateA2R routine takes no such shortcuts and may be relied
  1350. upon to return accurate results.
  1351.  
  1352.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  1353.  
  1354. MonthNr%     month number (1-12)
  1355. DayNr%       day number (1-31)
  1356. YearNr%      year number (1900 on; years <100 will be assumed 20th century)
  1357. -------
  1358. RelDate&     relative date
  1359.  
  1360. Name  : DateN2S              (Date Numbers to String)
  1361. Class : Time
  1362. Level : Any / DOS
  1363.  
  1364. Many of the PBClone routines return the date as a set of numbers.  This
  1365. routine provides an easy way to convert those numbers into string form.  The
  1366. date format used (year length and delimiter) will be based on the string
  1367. which you pass to the routine.  For instance, "xx-xx-xxxx" will return a date
  1368. like "11-26-1990", whereas "xx.xx.xxxx" would return "11.26.1990", and
  1369. "xx/xx/xx" would return "11/26/90".
  1370.  
  1371. If you pass zeroes for the MonthNr%, Day%, and Year% values, the current date
  1372. will be returned in the format that you specified.
  1373.  
  1374. The ProBas and PBClone versions of this routine do not work the same way in
  1375. regards to the year.  ProBas assumed that any two-digit year was in the
  1376. 1900s.  In contrast, PBClone assumes that years 80-99 should be converted to
  1377. 1980-1999 and that 0-79 should be converted to 2000-2079.
  1378.  
  1379.    DateSt$ = "xx-xx-xxxx"
  1380.    DateN2S MonthNr%, Day%, Year%, DateSt$
  1381.  
  1382. MonthNr%  month
  1383. Day%      day
  1384. Year%     year
  1385. -------
  1386. DateSt$   date string.  Init to 8 or 10 chars including delimiters (see above).
  1387.  
  1388. Name  : DateR2A              (Date Relative to Actual)
  1389. Class : Time
  1390. Level : Any
  1391.  
  1392. This is the opposite of the DateA2R routine-- it takes a "relative" date and
  1393. converts it back to the usual form.
  1394.  
  1395.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  1396.  
  1397. RelDate&     relative date
  1398. -------
  1399. MonthNr%     month number (1-12)
  1400. DayNr%       day number (1-31)
  1401. YearNr%      year number (1900 on)
  1402.  
  1403. Name  : DateS2N              (Date String to Numbers)
  1404. Class : Time
  1405. Level : Any
  1406.  
  1407. Many of the PBClone routines need to be passed the date as a set of numbers.
  1408. This routine provides an easy way to convert a date from string form into
  1409. numbers.  You may use either "xx/xx/xx" or "xx-xx-xxxx" form to specify the
  1410. date (the string length is important, but the delimiter and contents of the
  1411. string are ignored).
  1412.  
  1413. The ProBas and PBClone versions of this routine do not work the same way in
  1414. regards to the year.  ProBas assumed that any two-digit year was in the
  1415. 1900s.  In contrast, PBClone assumes that years 80-99 should be converted to
  1416. 1980-1999 and that 0-79 should be converted to 2000-2079.
  1417.  
  1418.    DateS2N MonthNr%, Day%, Year%, DateSt$
  1419.  
  1420. DateSt$   date string.  Init to 8 or 10 characters (see above).
  1421. -------
  1422. MonthNr%  month
  1423. Day%      day
  1424. Year%     year
  1425.  
  1426. Name  : DCal                 (Direct-to-memory Calendar)
  1427. Class : Time
  1428. Level : Any
  1429.  
  1430. This routine draws a calendar for a specific month and year.  The results are
  1431. placed in an array which can be displayed using ScrRest or the other PBClone
  1432. routines to restore a screen image.
  1433.  
  1434. You must supply an integer array large enough to hold the image generated by
  1435. DCal, which expects a 25x80 screen.  DIM Scrn%(1 TO 2000) will do it.  If you
  1436. supply a null date, the current date will be used.
  1437.  
  1438.    DCal Scrn%(), CalDate$
  1439.  
  1440. Scrn%()      array to hold screen image
  1441. CalDate$     date for the calendar
  1442. Page%        ignored
  1443. Fast%        ignored
  1444.  
  1445. Name  : DCalendar            (Direct-to-memory Calendar)
  1446. Class : Time
  1447. Level : Clone
  1448.  
  1449. This routine displays a calendar for a specific month and year.  It waits for
  1450. input and acts accordingly, allowing the user to move to different dates via
  1451. the arrow keys or by entering the date directly. The bottom row of the screen
  1452. gives a list of the available key commands.
  1453.  
  1454. Screen handling is largely done by writing to an array, then dumping the
  1455. entire array to the display with DScrRest.  This provides for very smooth
  1456. displays.  You must supply an integer array large enough to hold the image
  1457. generated by DCalendar, which expects a 25x80 screen.  DIM Scrn%(1 TO 2000)
  1458. will do it.  Only text mode is supported by this routine.
  1459.  
  1460. If you supply a null date, the current date will be used.
  1461.  
  1462.    DCalendar Scrn%(), CalDate$, Page%, Fast%
  1463.  
  1464. Scrn%()      array to hold screen image
  1465. CalDate$     date for the calendar
  1466. Page%        page on which to display (normally zero)
  1467. Fast%        whether to use fast mode (nonzero if so; may cause snow on CGAs)
  1468.  
  1469. Name  : DClear               (Direct-to-memory Clear)
  1470. Class : Display
  1471. Level : Any
  1472.  
  1473. The DClear routine allows you to clear a text-mode display.
  1474.  
  1475. This routine does not necessarily work on the display itself.  Instead, it
  1476. allows you to specify the memory location (segment and offset) of the
  1477. "screen", which may be an actual screen, a saved screen in an array, a
  1478. multitasker's virtual screen, etc.  Among other things, this makes it easy to
  1479. work with two displays at once: use a segment of &HB000 for the mono display
  1480. and &HB800 for the color display (the offset in each case is zero).
  1481.  
  1482.    DClear DSeg%, DOfs%, Attr%
  1483.  
  1484. DSeg%    segment of "screen" memory
  1485. DOfs%    offset of "screen" memory
  1486. Attr%    color/attribute to use (see CalcAttr)
  1487.  
  1488. Name  : DClearSS             (Direct-to-memory Clear for Specified Size)
  1489. Class : Display
  1490. Level : Any
  1491.  
  1492. Like the CLS statement, this routine allows you to clear a text display.
  1493. However, rather than clearing the actual screen, DClearSS clears a screen
  1494. that is stored in an array.  This allows you to design a screen in memory,
  1495. then flash it onto the display using PutScreen or a similar routine.
  1496.  
  1497. This routine is designed for a text screen of any specified size.
  1498.  
  1499.    DClearSS DSeg%, DOfs%, Attr%, Rows%, Columns%
  1500.  
  1501. DSeg%     segment of the array that holds the screen
  1502. DOfs%     offset of the array that holds the screen
  1503. Attr%     color/attribute to use (see CalcAttr)
  1504. Rows%     length of the screen
  1505. Columns%  width of the screen
  1506.  
  1507. Name  : Dec2Any              (Decimal to Any base)
  1508. Class : Numeric
  1509. Level : Any
  1510.  
  1511. This routine converts a normal integer to a number in any base.  It works
  1512. like the HEX$ function in BASIC, but rather than working only in hexadecimal
  1513. (base 16), it can be used for binary, octal, or almost anything else.
  1514.  
  1515. The result will be right-justified in the string you provide.  If you use
  1516. zeroes, this allows you to ignore the NumberLen% spec and just trim the
  1517. string to the desired length, leaving nothing worse than possible leading
  1518. zeroes.
  1519.  
  1520. The length needed by the return string will vary according to the number,
  1521. with a maximum length depending on the number base chosen.  For integers,
  1522. this will be at most 16 characters (worst case: base 2 or binary).
  1523.  
  1524.    Number$ = STRING$(16, "0")
  1525.    Dec2Any DecimalNr%, NrBase%, Number$, NumberLen%
  1526.    Number$ = RIGHT$(Number$, NumberLen%)
  1527.  
  1528. DecimalNr   integer to convert to another base
  1529. NrBase%     desired number base (2-31)
  1530. -------
  1531. Number$     resulting number in desired base (init to at least 16 chars)
  1532. NumberLen%  length of the result (-1 if insufficient space in string)
  1533.  
  1534. Name  : Delay                (Delay for seconds)
  1535. Class : Time
  1536. Level : Clone
  1537.  
  1538. This routine delays for a given number of seconds.  The timing will be the
  1539. same from an 8088 PC through an 80486 AT-- it's entirely independent of the
  1540. processor.  See also Delay18th.
  1541.  
  1542.    Delay Seconds%
  1543.  
  1544. Seconds%   number of seconds for which to delay
  1545.  
  1546. Name  : Delay18th            (Delay for 1/18th seconds)
  1547. Class : Time
  1548. Level : Clone
  1549.  
  1550. This routine delays for a given number of 18ths of seconds.  The timing will
  1551. be the same from an 8088 PC through an 80486 AT-- it's entirely independent
  1552. of the processor.  See also Delay.
  1553.  
  1554.    Delay WaitTime%
  1555.  
  1556. WaitTime%  number of 18ths of seconds for which to delay
  1557.  
  1558. Name  : DelayV               (Delay based on Video timing)
  1559. Class : Time
  1560. Level : Clone
  1561.  
  1562. This routine delays for a given number of milliseconds.  The timing is based
  1563. on a signal from the video adapter and may vary somewhat depending on the
  1564. adapter.  The delay is largely independent of the cpu type and speed, however.
  1565.  
  1566. For anyone unfamiliar with the metric system: there are 1000 milliseconds in
  1567. one second.  Depending on the specific display adapter, this routine may well
  1568. be fairly inaccurate; it is intended for providing small delays for animation
  1569. and similar purposes, not as a reliable timer.
  1570.  
  1571.    DelayV MilliSeconds%
  1572.  
  1573. MilliSeconds%   number of milliseconds for which to delay
  1574.  
  1575. Name  : DelChr               (Delete Character)
  1576. Class : Display
  1577. Level : Clone
  1578.  
  1579. The DelChr routine deletes the character at the specified screen location.
  1580.  
  1581.    DelChr Row%, Column%
  1582.  
  1583. Row%      row of character
  1584. Column%   column of character
  1585.  
  1586. Name  : DelLine              (Delete Line)
  1587. Class : Display
  1588. Level : BIOS
  1589.  
  1590. This routine deletes the specified row from the screen.
  1591.  
  1592.    DelLine Row%, Attr%
  1593.  
  1594. Row%      row to delete
  1595. Attr%     color/attribute to use on new bottom row (see CalcAttr)
  1596.  
  1597. Name  : DelFile              (Delete File)
  1598. Class : Disk
  1599. Level : DOS
  1600.  
  1601. This works like the DOS DEL (or ERASE) command, although it does not allow
  1602. wildcards.  The specified file is deleted.  Full path specifications are
  1603. supported, including drive and subdirectory specs.
  1604.  
  1605.    DelFile FileName$, ErrCode%
  1606.  
  1607. FileName$   name of the file to delete
  1608. -------
  1609. ErrCode%    0 if no error, else DOS Error
  1610.  
  1611. Name  : DelSub               (Delete Subdirectory)
  1612. Class : Disk
  1613. Level : DOS
  1614.  
  1615. This works like the DOS RD (or RMDIR) command.  It does not allow wildcards.
  1616. The specified subdirectory is deleted.  Note that you may not delete a
  1617. subdirectory that you're located in, or a subdirectory which contains files,
  1618. or the root directory.
  1619.  
  1620.    DelSub SubDir$, ErrCode%
  1621.  
  1622. SubDir$     name of the subdirectory to delete
  1623. -------
  1624. ErrCode%    0 if no error, else DOS Error
  1625.  
  1626. Name  : DFRead               (Direct-to-memory File Read)
  1627. Class : Disk
  1628. Level : DOS
  1629.  
  1630. This routine reads data into an array from a file that was opened by FOpen or
  1631. FCreate.  If it wasn't possible to read it all from the file, an error code
  1632. will be returned and the BytesRead% value will tell you how many bytes were
  1633. actually read.
  1634.  
  1635.    DFRead Handle%, DSeg%, DOfs%, Bytes%, BytesRead%, ErrCode%
  1636.  
  1637. Handle%     handle of the file from which to read
  1638. DSeg%       segment of the array into which to read the file
  1639. DOfs%       offset of the array into which to read the file
  1640. Bytes%      number of bytes to read
  1641. -------
  1642. BytesWrit%  number of bytes actually read from the file (if error)
  1643. ErrCode%    error code: 0 if no error, else DOS Error
  1644.  
  1645. Name  : DFWrite              (Direct-from-memory File Write)
  1646. Class : Disk
  1647. Level : DOS
  1648.  
  1649. This routine writes data from an array to a file that was opened by FOpen or
  1650. FCreate.  If it wasn't possible to write it all to the file, an error code
  1651. will be returned and the BytesWrit% value will tell you how many bytes were
  1652. actually written.
  1653.  
  1654.    DFWrite Handle%, DSeg%, DOfs%, Bytes%, BytesWrit%, ErrCode%
  1655.  
  1656. Handle%     handle of the file to which to write
  1657. DSeg%       segment of the data to write to the file
  1658. DOfs%       offset of the data to write to the file
  1659. Bytes%      number of bytes to write
  1660. -------
  1661. BytesWrit%  number of bytes actually written to the file (if error)
  1662. ErrCode%    error code: 0 if no error, else DOS Error
  1663.  
  1664. Name  : DGClear              (Direct-to-memory Graphics Clear)
  1665. Class : Display
  1666. Level : Any
  1667.  
  1668. This routine works like the CLS statement, clearing a CGA graphics display.
  1669. However, rather than clearing the actual screen, DClearSS clears a screen
  1670. that is stored in an array.  This allows you to design a screen in memory,
  1671. then flash it onto the display using GrafRest.
  1672.  
  1673. This routine is designed for use with SCREEN 1 or SCREEN 2 (CGA graphics).
  1674.  
  1675.    DGClear DSeg%, DOfs%, Colour%
  1676.  
  1677. DSeg%     segment of the array that holds the screen
  1678. DOfs%     offset of the array that holds the screen
  1679. Colour%   color to use
  1680.  
  1681. Name  : DGetRec              (Direct-from-memory Get Record)
  1682. Class : String
  1683. Level : Clone
  1684.  
  1685. The DGetRec routine allows you to get a string from a specified area of
  1686. memory (numeric array, BIOS data area, display memory, or whatever).  The
  1687. string should be initialized to the desired record length in advance.
  1688.  
  1689. This works somewhat like an array of fixed length strings or a random file,
  1690. treating memory as a contiguous series of records of a specified length.
  1691.  
  1692.    DGetRec DSeg%, DOfs%, RecNr%, St$
  1693.  
  1694. DSeg%      segment of the array to read from
  1695. DOfs%      offset of the array to read from
  1696. RecNr%     record number (starting at 1)
  1697. -------
  1698. St$        returned string.  Init to the record length (see above).
  1699.  
  1700. Name  : DGetScreen           (Direct-to-memory Get Screen image)
  1701. Class : Display
  1702. Level : Clone
  1703.  
  1704. This routine saves any portion of the display to an array.  Only text modes
  1705. are supported.  If your program uses multiple display pages, you can get an
  1706. image from any of those pages.  A special "slow" mode is supported for the
  1707. CGA, to prevent flickering (a problem only with some CGAs).
  1708.  
  1709. The size of the integer array needed to store a specific area of the screen
  1710. can be calculated using the CalcSize routine (see).
  1711.  
  1712. The GetScreen routine works the same way as this, but has a simpler calling
  1713. convention.  Also, if you wish to save the entire screen, you may find
  1714. ScrSave easier.
  1715.  
  1716.    DGetScreen DSeg%, DOfs%, TopRow%, LeftCol%, BotRow%, RightCol%, Page%, Fast%
  1717.  
  1718. DSeg%      segment of the array in which to store the image
  1719. DOfs%      offset of the array in which to store the image
  1720. TopRow%    top row of the desired screen area
  1721. LeftCol%   left column of the desired screen area
  1722. BotRow%    bottom row of the desired screen area
  1723. RightCol%  right column of the desired screen area
  1724. Page%      page from which to get the display area
  1725. Fast%      whether to use fast mode (nonzero if so; else slow, for some CGAs)
  1726.  
  1727. Name  : DGetSt               (Direct-from-memory Get String)
  1728. Class : String
  1729. Level : Clone
  1730.  
  1731. The DGetSt routine allows you to get a string from a specified area of memory
  1732. (numeric array, BIOS data area, display memory, or whatever).  The string
  1733. should be initialized to the desired length in advance.
  1734.  
  1735. You may specify an additional offset from the initial location, which itself
  1736. is specified as a segment and an offset.  The second offset begins with
  1737. position 1.  The combined total of the two offsets must be under 65,536 at
  1738. the moment.  I'll remove that restriction at a later time.  With normalized
  1739. segment and offset specifications, which is usually the case, this allows you
  1740. to specify a number from 1-65,521 for the second offset.
  1741.  
  1742.    DGetSt DSeg%, DOfs%, Posn&, St$
  1743.  
  1744. DSeg%      segment of the array to read from
  1745. DOfs%      offset of the array to read from
  1746. Posn&      location relative to the start of the array
  1747. -------
  1748. St$        returned string.  Init to the number of chars desired (see above).
  1749.  
  1750. Name  : DGQPrint             (Direct-to-memory Graphics Quick Print)
  1751. Class : Display
  1752. Level : Any
  1753.  
  1754. This is a simple high-speed replacement for the PRINT statement which works
  1755. on a CGA virtual graphics screen (SCREEN 2).  It does not interpret control
  1756. codes or support graphics characters (ASCII 128-255).
  1757.  
  1758. DGQPrint allows you to display to a CGA even if it isn't the active display
  1759. (use a segment of &HB800 and offset of 0).  Its intended use, however, is to
  1760. display to a virtual screen kept in an array or other memory area.  The
  1761. results can then be displayed using GrafRest.
  1762.  
  1763.    DGQPrint DSeg%, DOfs%, St$, Row%, Column%
  1764.  
  1765. DSeg%    segment of CGA virtual screen
  1766. DOfs%    offset of CGA virtual screen
  1767. St$      string to display
  1768. Row%     row (1-25)
  1769. Column%  column (1-80)
  1770.  
  1771. Name  : DGXQPrint            (Direct-to-memory Graphics Extended Quick Print)
  1772. Class : Display
  1773. Level : Any
  1774.  
  1775. This is a simple high-speed replacement for the PRINT statement which works
  1776. on a CGA virtual graphics screen (SCREEN 1).  It does not interpret control
  1777. codes or support graphics characters (ASCII 128-255).
  1778.  
  1779. This routine can also be used on a SCREEN 2 display, where it will display
  1780. the string in shades instead of in color (using 40 columns/row).
  1781.  
  1782. DGXQPrint allows you to display to a CGA even if it isn't the active display
  1783. (use a segment of &HB800 and offset of 0).  Its intended use, however, is to
  1784. display to a virtual screen kept in an array or other memory area.  The
  1785. results can then be displayed using GrafRest.
  1786.  
  1787.    DGXQPrint DSeg%, DOfs%, St$, Row%, Column%, Fore%
  1788.  
  1789. DSeg%    segment of CGA virtual screen
  1790. DOfs%    offset of CGA virtual screen
  1791. St$      string to display
  1792. Row%     row (1-25)
  1793. Column%  column (1-40)
  1794. Fore%    foreground color (0-3)
  1795.  
  1796. Name  : DGXQPrint1           (Direct-to-memory Graphics Extended Quick Print)
  1797. Class : Display
  1798. Level : Any
  1799.  
  1800. This is a high-speed replacement for the PRINT statement which works on a CGA
  1801. virtual graphics screen (SCREEN 1). It does not interpret control codes.
  1802.  
  1803. This routine can also be used on a SCREEN 2 display, where it will display
  1804. the string in shades instead of in color (using 40 columns/row).
  1805.  
  1806. DGXQPrint1 allows you to display to a CGA even if it isn't the active display
  1807. (use a segment of &HB800 and offset of 0).  Its intended use, however, is to
  1808. display to a virtual screen kept in an array or other memory area.  The
  1809. results can then be displayed using GrafRest.
  1810.  
  1811.    DGXQPrint1 DSeg%, DOfs%, St$, Row%, Column%, Fore%, Back%
  1812.  
  1813. DSeg%    segment of CGA virtual screen
  1814. DOfs%    offset of CGA virtual screen
  1815. St$      string to display
  1816. Row%     row (1-25)
  1817. Column%  column (1-40)
  1818. Fore%    foreground color (0-3)
  1819. Back%    background color (0-3)
  1820.  
  1821. Name  : DInput               (Dollar Input)
  1822. Class : Input
  1823. Level : Clone
  1824.  
  1825. This routine provides formatted input of a dollar amount.  You specify the
  1826. format and an initial value (may be zero).  You may also specify whether to
  1827. allow negation-- if so, the user may press the "-" key to toggle the number
  1828. between negative and positive.  The numeric keypad will automatically be
  1829. locked into the numeric state.  Since the decimal point is implicit, the "."
  1830. key functions as a delete or backspace operation, for convenient one-handed
  1831. data entry and correction.
  1832.  
  1833. The dollar amount is kept in a long integer as a number of pennies, to avoid
  1834. the possibility of round-off errors which might result from use of floating
  1835. point math.  The results are returned to you both as a long integer and as a
  1836. formatted number.
  1837.  
  1838. The format string works just like a PRINT USING format string.  Editing is
  1839. not as flexible as for SInput, but is quite adequate.  The SInputSet routines
  1840. will work for DInput as well as SInput.  The ExitCode% returned is the same
  1841. as for SInput, but left and right arrows may also be returned.
  1842.  
  1843.    DInput Format$, St&, St$, MinusOk%, Attr%, ExitCode%
  1844.  
  1845. Format$    numeric format (just like PRINT USING format); e.g. "$$##,###.##-"
  1846. St&        dollar amount (in pennies)
  1847. MinusOk%   whether negation is allowed (0 if no)
  1848. Attr%      color/attribute to use (see CalcAttr)
  1849. -------
  1850. St&        dollar amount (in pennies)
  1851. St$        formatted dollar amount
  1852. ExitCode%  key used to exit (ASCII code if positive, scan code if negative)
  1853.  
  1854. Name  : DiskStat             (Disk Statistics)
  1855. Class : Disk
  1856. Level : DOS
  1857.  
  1858. DiskStat gives you statistics on the memory usage of a specified disk drive:
  1859. the total number of clusters, the number of available or free clusters, the
  1860. number of sectors per cluster, and the number of bytes per sector.
  1861.  
  1862. From this information, you can determine how much total disk space there is,
  1863. how much space is left and how much is used, the size of a cluster, et al.
  1864.  
  1865. A few formulas for you:
  1866.  
  1867.    ClusterSize% = BytesPerSec% * SecsPerClus%
  1868.    FreeSpace& = FreeClus& * ClusterSize%
  1869.    TotalSpace& = TotalClus& * ClusterSize%
  1870.    UsedSpace& = TotalSpace& - FreeSpace&
  1871.  
  1872. A "cluster" is the minimum amount of disk space that can be allocated at a
  1873. time.  A typical cluster size for a medium-sized hard drive is 2048 bytes,
  1874. which means that any file from 1-2048 bytes in length is actually taking up a
  1875. full 2048 bytes on the disk.  Large cluster sizes improve file access times
  1876. but can waste a lot of disk space.
  1877.  
  1878.    DiskStat Drive$, FreeClus&, TotalClus&, BytesPerSec%, SecsPerClus%
  1879.  
  1880. Drive$        letter of the drive to examine
  1881. -------
  1882. FreeClus&     number of free or available clusters
  1883. TotalClus&    total number of clusters
  1884. BytesPerSec%  bytes per sector
  1885. SecsPerClus%  sectors per cluster (-1 if bad drive, open drive door, etc)
  1886.  
  1887. Name  : Dissolve             (Dissolve)
  1888. Class : Display
  1889. Level : Clone
  1890.  
  1891. Like CLS, but a bit more fancy, this routine provides an interesting way to
  1892. clear the screen.  See also FadeOut.
  1893.  
  1894. This routine may cause heavy flickering on some CGA displays.
  1895.  
  1896.    Dissolve Attr%
  1897.  
  1898. Attr%   color/attribute to which to clear (see CalcAttr)
  1899.  
  1900. Name  : DMPrint              (DOS Message Print)
  1901. Class : Display
  1902. Level : DOS
  1903.  
  1904. This routine is similar to PRINT, but goes through DOS output services, which
  1905. allows your program to support output redirection, filters, CTTY and other
  1906. handy things.  See DOSInkey for a DOS input service.
  1907.  
  1908. Note that the use of DMPrint means that you should avoid using BASIC display
  1909. handling (CLS, INPUT, LINE INPUT, PRINT, LOCATE, CSRLIN, POS, etc).  Instead,
  1910. you should use ANSI escape sequences to control the display.  This requires
  1911. that an ANSI driver (like ANSI.SYS, DVANSI.SYS, NANSI.SYS, or ZANSI.SYS) be
  1912. installed on your system.  See your DOS manual for details on ANSI sequences,
  1913. or grab the documentation on ANSI from one of your friendly local BBSes.
  1914.  
  1915. It is -possible- to use BASIC display handling in conjunction with DMPrint,
  1916. but that tends to defeat the purpose of using DMPrint in the first place.
  1917.  
  1918. Note that the DMPrint routine does not add a carriage return/linefeed to the
  1919. end of a string.  If you want that, add CHR$(13) + CHR$(10) to the end of the
  1920. string.
  1921.  
  1922.    DMPrint St$
  1923.  
  1924. St$    string to display
  1925.  
  1926. Name  : DOSClrEol            (DOS Clear to End Of Line)
  1927. Class : Display
  1928. Level : DOS
  1929.  
  1930. This routine clears from the cursor position to the end of the row using DOS
  1931. output functions.  It requires that ANSI.SYS or another ANSI driver be
  1932. installed.
  1933.  
  1934.    DOSClrEol
  1935.  
  1936. Name  : DOSCls               (DOS Clear Screen)
  1937. Class : Display
  1938. Level : DOS
  1939.  
  1940. This routine clears the screen using DOS output functions.  It requires that
  1941. ANSI.SYS or another ANSI driver be installed.
  1942.  
  1943.    DOSCls
  1944.  
  1945. Name  : DOSColor             (DOS Color)
  1946. Class : Display
  1947. Level : DOS
  1948.  
  1949. This routine sets the screen colors using DOS output functions.  It requires
  1950. that ANSI.SYS or another ANSI driver be installed.
  1951.  
  1952.    DOSColor Fore%, Back%
  1953.  
  1954. Fore%    foreground color
  1955. Back%    background color
  1956.  
  1957. Name  : DOSErrM$             (DOS Error Message)
  1958. Class : Miscellaneous
  1959. Level : DOS
  1960.  
  1961. Of the many PBClone routines that return error codes, most simply pass the
  1962. code back from DOS without any processing.  You can see what the codes mean
  1963. by checking the chart in PBClone.DOC, or it may be more convenient to use
  1964. DOSErrM$ instead.  This routine returns a short text description of the error
  1965. in question.
  1966.  
  1967.    ErrMsg$ = DOSErrM$(ErrCode%)
  1968.  
  1969. ErrCode%     error code to translate
  1970. -------
  1971. ErrMsg$      brief explanation of the error
  1972.  
  1973. Name  : DOSInkey             (DOS INKEY$)
  1974. Class : Input
  1975. Level : DOS
  1976.  
  1977. This routine is similar to INKEY$, but goes through DOS input services, which
  1978. allows your program to support input redirection, filters, CTTY and other
  1979. handy things.  See DMPrint for a DOS output service.  See also DOSInky$.
  1980.  
  1981.    DOSInkey CharCode%, CharType%
  1982.  
  1983. -------
  1984. CharType%    0 if no key, 1 if normal key, 2 if extended key
  1985. CharCode%    ASCII code if normal key, scan code if extended key
  1986.  
  1987. Name  : DOSInky$             (DOS INKEY$)
  1988. Class : Input
  1989. Level : DOS
  1990.  
  1991. This routine works just like INKEY$, but goes through DOS input services,
  1992. which allows your program to support input redirection, filters, CTTY and
  1993. other handy things.  See DMPrint for a DOS output service.  See also DOSInkey.
  1994.  
  1995.    ky$ = DOSInky$
  1996.  
  1997. -------
  1998. ky$      key, if any was waiting (0-2 characters per key, like INKEY$)
  1999.  
  2000. Name  : DOSInt%              (DOS Interrupt)
  2001. Class : Miscellaneous
  2002. Level : DOS
  2003.  
  2004. This routine provides you with easy access to DOS functions via INT 21H, the
  2005. major DOS interrupt.  It works like the CALL INTERRUPT routines provided with
  2006. QuickBASIC but is easier to use, at the expense of some flexibility.
  2007.  
  2008. CAUTION: This routine works directly with DOS, bypassing most of BASIC's
  2009. safety precautions.  Possible chaos may result if you don't know what you're
  2010. doing!  A few specific caveats:
  2011.  
  2012.    1) Do Not use this routine to exit your program or execute another.  BASIC
  2013.       needs to clean up after itself before these tasks, and bypassing its
  2014.       handling is liable to make the system unstable at best.
  2015.  
  2016.    2) If you expect to use a string or array as a buffer, make sure it is
  2017.       long enough to handle the maximum amount of information anticipated.
  2018.       Strings and arrays can move about in memory, so be sure to get their
  2019.       addresses Just Before using DOSInt%.
  2020.  
  2021. If you wish to specify BASIC's data segment for DS, you can find out what
  2022. that is using the DataSeg routine (q.v.).
  2023.  
  2024.    CarryFlag% = DOSInt%(AX%, BX%, CX%, DX%, DS%)
  2025.  
  2026. AX%         desired setting of the AX register
  2027. BX%         desired setting of the BX register
  2028. CX%         desired setting of the CX register
  2029. DX%         desired setting of the DX register
  2030. DS%         desired setting of the DS and ES registers
  2031. -------
  2032. AX%         returned setting of the AX register
  2033. BX%         returned setting of the BX register
  2034. CX%         returned setting of the CX register
  2035. DX%         returned setting of the DX register
  2036. DS%         returned setting of the DS and ES registers
  2037. CarryFlag%  returned carry flag (0 if no error, else AX is error code)
  2038.  
  2039. Name  : DOSLocate            (DOS Locate)
  2040. Class : Display
  2041. Level : DOS
  2042.  
  2043. This routine sets the cursor position using DOS output functions.  It
  2044. requires that ANSI.SYS or another ANSI driver be installed.
  2045.  
  2046. Note that many ANSI drivers do not fully support EGA or VGA modes in that
  2047. they are limited to a maximum of 25 rows.
  2048.  
  2049.    DOSLocate Row%, Column%
  2050.  
  2051. Row%      row
  2052. Column%   column
  2053.  
  2054. Name  : DPutRec              (Direct-to-memory Put Record)
  2055. Class : String
  2056. Level : Clone
  2057.  
  2058. The DPutRec routine allows you to put a string into a specified area of
  2059. memory (numeric array, BIOS data area, display memory, or whatever).  The
  2060. string should be initialized to the desired record length in advance.
  2061.  
  2062. This works somewhat like an array of fixed length strings or a random file,
  2063. treating memory as a contiguous series of records of a specified length.
  2064.  
  2065.    DPutRec DSeg%, DOfs%, RecNr%, St$
  2066.  
  2067. DSeg%      segment of the array to write into
  2068. DOfs%      offset of the array to write into
  2069. RecNr%     record number (starting at 1)
  2070. St$        string to write.  Init to the record length (see above).
  2071.  
  2072. Name  : DPutScreen           (Direct-from-memory Put Screen)
  2073. Class : Display
  2074. Level : Clone
  2075.  
  2076. This routine restores a portion of the display (which was saved to an array
  2077. by DGetScreen or GetScreen) to the screen.  Only text modes are supported.
  2078. If your program uses multiple display pages, you can put the image onto any
  2079. of those pages.  A special "slow" mode is supported for the CGA, to prevent
  2080. flickering (a problem only with some CGAs).
  2081.  
  2082. The PutScreen routine works the same way as this, but has a simpler calling
  2083. convention.  Also, if you wish to restore the entire screen, you may find
  2084. ScrRest easier (see).
  2085.  
  2086.    DPutScreen DSeg%, DOfs%, TopRow%, LeftCol%, BotRow%, RightCol%, Page%, Fast%
  2087.  
  2088. DSeg%      segment of the array from which to restore the image
  2089. DOfs%      offset of the array from which to restore the image
  2090. TopRow%    top row of the desired screen area
  2091. LeftCol%   left column of the desired screen area
  2092. BotRow%    bottom row of the desired screen area
  2093. RightCol%  right column of the desired screen area
  2094. Page%      page on which to restore the display
  2095. Fast%      whether to use fast mode (nonzero if so; else slow, for some CGAs)
  2096.  
  2097. Name  : DPutSt               (Direct-to-memory Put String)
  2098. Class : String
  2099. Level : Clone
  2100.  
  2101. The DPutSt routine allows you to put a string into a specified area of memory
  2102. (numeric array, BIOS data area, display memory, or whatever).
  2103.  
  2104. You may specify an additional offset from the initial location, which itself
  2105. is specified as a segment and an offset.  The second offset begins with
  2106. position 1.  The combined total of the two offsets must be under 65,536 at
  2107. the moment.  I'll remove that restriction at a later time.  With normalized
  2108. segment and offset specifications, which is usually the case, this allows you
  2109. to specify a number from 1-65,521 for the second offset.
  2110.  
  2111.    DPutSt DSeg%, DOfs%, Posn&, St$
  2112.  
  2113. DSeg%      segment of the array to write to
  2114. DOfs%      offset of the array to write to
  2115. Posn&      location relative to the start of the array
  2116. St$        string to write into memory
  2117.  
  2118. Name  : DRecDel              (Direct-to-memory Record Deletion)
  2119. Class : Array management
  2120. Level : Any
  2121.  
  2122. This routine allows you to delete an item from an array.  The item may
  2123. consist of one or more array elements.  The size of the array isn't actually
  2124. changed, but the array elements are moved as if a deletion took place.
  2125.  
  2126.    DRecDel DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2127.  
  2128. DSeg%      segment of the array
  2129. DOfs%      offset of the array
  2130. RecNr%     record/element number (starting at 1)
  2131. RecLen%    record/element length in bytes
  2132. Records%   total number of records/elements in the array
  2133.  
  2134. Name  : DRecIns              (Direct-to-memory Record Insertion)
  2135. Class : Array management
  2136. Level : Any
  2137.  
  2138. This routine allows you to insert an item into an array.  The item may
  2139. consist of one or more array elements.  The size of the array isn't actually
  2140. changed, but the array elements are moved as if an insertion took place.  You
  2141. must of course make sure that the array is DIMed large enough to handle this.
  2142.  
  2143.    DRecIns DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2144.  
  2145. DSeg%      segment of the array
  2146. DOfs%      offset of the array
  2147. RecNr%     record/element number (starting at 1)
  2148. RecLen%    record/element length in bytes
  2149. Records%   total number of records/elements in the array
  2150.  
  2151. Name  : DRecolor             (Direct-to-memory Recolor)
  2152. Class : Display
  2153. Level : Any
  2154.  
  2155. The DRecolor routine changes all text in one color to another color.  It
  2156. works only in text modes.  The colors are specified as attributes (see
  2157. CalcAttr).
  2158.  
  2159. This routine does not necessarily work on the display itself.  Instead, it
  2160. allows you to specify the memory location (segment and offset) of the
  2161. "screen", which may be an actual screen, a saved screen in an array, a
  2162. multitasker's virtual screen, etc.  Among other things, this makes it easy to
  2163. work with two displays at once: use a segment of &HB000 for the mono display
  2164. and &HB800 for the color display (the offset in each case is zero).
  2165.  
  2166.    DRecolor DSeg%, DOfs%, OldAttr%, NewAttr%
  2167.  
  2168. DSeg%      segment of "screen" memory
  2169. DOfs%      offset of "screen" memory
  2170. OldAttr%   color to be changed
  2171. NewAttr%   color to which to change
  2172.  
  2173. Name  : DRecolorArea         (Direct-to-memory Recolor Area)
  2174. Class : Display
  2175. Level : Clone
  2176.  
  2177. The DRecolorArea routine changes a specified area of the screen to a
  2178. specified color.  It works only in text modes.  The color is specified as an
  2179. attribute (see CalcAttr).
  2180.  
  2181. One of the more common applications for this routine is marking an area of
  2182. the screen, e.g. menu highlight bars.
  2183.  
  2184.    DRecolorArea DSeg%, DOfs%, TopRow%, LeftCol%, BottomRow%, RightCol%, Attr%
  2185.  
  2186. This routine does not necessarily work on the display itself.  Instead, it
  2187. allows you to specify the memory location (segment and offset) of the
  2188. "screen", which may be an actual screen, a saved screen in an array, a
  2189. multitasker's virtual screen, etc.  Among other things, this makes it easy to
  2190. work with two displays at once: use a segment of &HB000 for the mono display
  2191. and &HB800 for the color display (the offset in each case is zero).
  2192.  
  2193. DSeg%       segment of "screen" memory
  2194. DOfs%       offset of "screen" memory
  2195. TopRow%     top row of area to recolor
  2196. LeftCol%    left column of area to recolor
  2197. BottomRow%  bottom row of area to recolor
  2198. RightCol%   right column of area to recolor
  2199. Attr%       desired color
  2200.  
  2201. Name  : DriveSpace&          (Drive Space free)
  2202. Class : Disk
  2203. Level : DOS
  2204.  
  2205. This routine tells you how many bytes are free on a specified disk drive.
  2206.  
  2207.    BytesFree& = DriveSpace&(Drive$)
  2208.  
  2209. Drive$      letter of the drive to examine
  2210. -------
  2211. BytesFree&  free bytes on the specified drive, or -1 if bad drive or disk error
  2212.  
  2213. Name  : DrvSpaceL            (Drive Space free as Long integer)
  2214. Class : Disk
  2215. Level : DOS
  2216.  
  2217. This routine tells you how many bytes are free on a specified disk drive.
  2218. See also DriveSpace, a function-type version of this routine.
  2219.  
  2220.    DrvSpaceL Drive$, BytesFree&
  2221.  
  2222. Drive$      letter of the drive to examine
  2223. -------
  2224. BytesFree&  free bytes on the specified drive, or -1 if bad drive or disk error
  2225.  
  2226. Name  : DrvType              (Drive Type)
  2227. Class : Disk
  2228. Level : DOS 3.1+
  2229.  
  2230. The DrvType routine tells you whether a specified drive is fixed or
  2231. removeable, and whether it is local or remote (network drive).
  2232.  
  2233.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  2234.  
  2235. Drive$       letter of the drive to examine
  2236. -------
  2237. Removeable%  whether the disk in the drive can be removed (0 if no)
  2238. Remote%      whether this is a remote drive (0 if no)
  2239. ErrCode%     error code: 0 if none, else bad DOS version
  2240.  
  2241. Name  : DScrRest             (Direct-from-memory Screen Restore)
  2242. Class : Display
  2243. Level : Clone
  2244.  
  2245. The DScrRest routine restores a display that was saved using ScrSave or a
  2246. similar routine.  It only works in text modes.  See also ScrRest.
  2247.  
  2248.    DScrRest DSeg%, DOfs%, Page%, Fast%
  2249.  
  2250. DSeg%      segment of info to restore to the screen
  2251. DOfs%      offset of info to restore to the screen
  2252. Page%      page on which to restore the display
  2253. Fast%      whether to use fast mode (nonzero if so; may cause snow on CGAs)
  2254.  
  2255. Name  : DScrSave             (Direct-from-memory Screen Save)
  2256. Class : Display
  2257. Level : Clone
  2258.  
  2259. The DScrSave routine saves the display to an array or other storage area.
  2260. Only text modes are supported.  For an 80x25 display, the array must hold
  2261. 4,000 bytes (4,000 string characters or 2,000 integers).  See also ScrSave.
  2262.  
  2263.    DScrSave DSeg%, DOfs%, Page%, Fast%
  2264.  
  2265. DSeg%      segment of place to store the display
  2266. DOfs%      offset of place to store the display
  2267. Page%      page from which to get the display
  2268. Fast%      whether to use fast mode (nonzero if so; may cause snow on CGAs)
  2269.  
  2270. Name  : DTR                  (Data Terminal Ready signal)
  2271. Class : Serial
  2272. Level : Clone
  2273.  
  2274. Just as IBM provided the standard for personal computers, Hayes provided
  2275. the standard for modem commands.  Unfortunately, the command method of
  2276. dropping carrier (hanging up the phone) was badly designed, and all
  2277. Hayes-compatible modems have a hard time recognizing that command under
  2278. certain line conditions.
  2279.  
  2280. Fortunately, there's a more reliable way of hanging up: the DTR serial
  2281. signal.  Turning this signal off will cause the modem to hang up very
  2282. quickly.  Most Hayes-compatible modems are factory-set to pay attention to
  2283. the DTR; those that aren't can be made to do so either by flipping a hardware
  2284. switch or with a special initialization command.  See your modem manual for
  2285. details.
  2286.  
  2287. BASIC will drop the DTR when you CLOSE the comm port, but this isn't always a
  2288. convenient way to do it.  As a matter of fact, this can be a decided
  2289. nuisance, so many people have patched their version of BASIC to avoid it.  If
  2290. you would like to do so, check your local BBS for the method!  With the
  2291. PBClone DTR routine, you can get full control over the DTR without having to
  2292. CLOSE the comm port.
  2293.  
  2294. Note: it may be wise to include a brief delay after dropping the DTR, to give
  2295. the modem a chance to react.  Try Delay18th (see) with a wait of around 4.
  2296.  
  2297.    DTR CommPort%, TurnOn%
  2298.  
  2299. CommPort%    serial port number (1-4, although BASIC only handles 1-2)
  2300. TurnOn%      whether to raise (turn on) the DTR (0 if no)
  2301.  
  2302. Name  : DWindowManager       (Direct-to-memory Window Manager)
  2303. Class : Display
  2304. Level : Any
  2305.  
  2306. DWindowManager displays a pop-up window according to your specifications.
  2307. The window may have any of a variety of frames, a title, or a shadow, and it
  2308. may appear instantly or "grow" onto the screen.
  2309.  
  2310. These are the available frame types:
  2311.     0   no frame
  2312.     1   single lines
  2313.     2   double lines
  2314.     3   single horizontal, double vertical lines
  2315.     4   double horizontal, single vertical lines
  2316.     5   block graphic lines
  2317.  
  2318. These are the available shadows:
  2319.    -3   transparent shadow on the right
  2320.    -2   transparent shadow on the left
  2321.    -1   solid black shadow on the left
  2322.     0   no shadow
  2323.    1+   shadow attribute (use CalcAttr) for a colored shadow
  2324.  
  2325. Options for growing windows are as follows:
  2326.    -1   grow as fast as possible
  2327.     0   pop onto the screen
  2328.    1+   grow with a specified delay in milliseconds (15 works well for me)
  2329.  
  2330. Note that this routine is different from its ProBas equivalent in a number of
  2331. respects.  The grow delay time is different.  Growing is done more smoothly.
  2332. The shadow and title parameters are not changed by this routine.  A new frame
  2333. type (5) was added.  If a title is too long, it is truncated instead of being
  2334. ignored completely.  Using a -1 as the title foreground color will not turn
  2335. off the title; instead, use a null title string.
  2336.  
  2337.    DWindowManager DSeg%, DOfs%, TopRow%, LeftCol%, BottomRow%, RightCol%,
  2338.       Frame%, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  2339.  
  2340. This routine does not necessarily work on the display itself.  Instead, it
  2341. allows you to specify the memory location (segment and offset) of the
  2342. "screen", which may be an actual screen, a saved screen in an array, a
  2343. multitasker's virtual screen, etc.  Among other things, this makes it easy to
  2344. work with two displays at once: use a segment of &HB000 for the mono display
  2345. and &HB800 for the color display (the offset in each case is zero).
  2346.  
  2347. DSeg%       segment of "screen" memory
  2348. DOfs%       offset of "screen" memory
  2349. TopRow%     top row of window
  2350. LeftCol%    left column of window
  2351. BottomRow%  bottom row of window
  2352. RightCol%   right column of window
  2353. Frame%      frame type (see above)
  2354. Fore%       frame foreground color
  2355. Back%       frame background color
  2356. Grow%       window growing option (see above)
  2357. Shade%      window shadow option (see above)
  2358. TFore%      title foreground color
  2359. Title$      window title ("" if none)
  2360.  
  2361. Name  : DWindowMan2          (Direct-to-memory Window Manager)
  2362. Class : Display
  2363. Level : Any
  2364.  
  2365. This routine is identical to DWindowManager but for the fact that it allows
  2366. you to design your own custom window frames.  Please see the description of
  2367. DWindowManager for general information.
  2368.  
  2369. These are the additional frame types:
  2370.     6   custom frame composed of a single character
  2371.     7   custom frame composed of the specified 7-character list:
  2372.         top left corner, top middle, top right corner,
  2373.         left middle, right middle,
  2374.         bottom left corner, bottom middle, bottom right corner
  2375.  
  2376.  /------------------------------------------------------------\
  2377.  | A custom frame like this would be defined as frame type 7, |
  2378.  | with a frame string of "/-\||\-/", for instance.           |
  2379.  \------------------------------------------------------------/
  2380.  
  2381.  *************************************************
  2382.  * On the other hand, a frame like this would be *
  2383.  * frame type 6, with a frame string of "*".     *
  2384.  *************************************************
  2385.  
  2386. Note that this routine differs from the ProBas equivalent in that it supports
  2387. full frame definitions through frame type 7 (ProBas only supports type 6).
  2388. The other differences mentioned under WindowManager are also relevant.
  2389.  
  2390.    DWindowMan2 DSeg%, DOfs%, TopRow%, LeftCol%, BottomRow%, RightCol%,
  2391.       Frame%, FSt$, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  2392.  
  2393. DSeg%       segment of "screen" memory
  2394. DOfs%       offset of "screen" memory
  2395. TopRow%     top row of window
  2396. LeftCol%    left column of window
  2397. BottomRow%  bottom row of window
  2398. RightCol%   right column of window
  2399. Frame%      frame type (see above)
  2400. FSt$        frame definition string (see above)
  2401. Fore%       frame foreground color
  2402. Back%       frame background color
  2403. Grow%       window growing option (see above)
  2404. Shade%      window shadow option (see above)
  2405. TFore%      title foreground color
  2406. Title$      window title ("" if none)
  2407.  
  2408. Name  : DWindowMan3          (Direct-to-memory Window Manager)
  2409. Class : Display
  2410. Level : Any
  2411.  
  2412. This routine is identical in function to DWindowManager.  The parameters are
  2413. mostly passed as an array, however, instead of one by one.  Please see the
  2414. description of DWindowManager for general information.
  2415.  
  2416.    DWindowMan3 Parm%(), Title$
  2417.  
  2418. DSeg%       segment of "screen" memory
  2419. DOfs%       offset of "screen" memory
  2420. Parm%(1)    top row of window
  2421. Parm%(2)    left column of window
  2422. Parm%(3)    bottom row of window
  2423. Parm%(4)    right column of window
  2424. Parm%(5)    frame type (see above)
  2425. Parm%(6)    frame foreground color
  2426. Parm%(7)    frame background color
  2427. Parm%(8)    window growing option (see above)
  2428. Parm%(9)    window shadow option (see above)
  2429. Parm%(10)   title foreground color
  2430. Title$      window title ("" if none)
  2431.  
  2432. Name  : DWindowMan4          (Direct-to-memory Window Manager)
  2433. Class : Display
  2434. Level : Any
  2435.  
  2436. This is an extremely cut-down version of DWindowManager, providing no more
  2437. than a simple frame generator.
  2438.  
  2439. These are the available frame types:
  2440.     0   no frame
  2441.     1   single lines
  2442.     2   double lines
  2443.     3   single horizontal, double vertical lines
  2444.     4   double horizontal, single vertical lines
  2445.     5   block graphic lines
  2446.  
  2447. Note that this routine is different from its ProBas equivalent in that a new
  2448. frame type (5) is available.
  2449.  
  2450.    DWindowMan4 DSeg%, DOfs%, TopRow%, LeftCol%, BottomRow%, RightCol%,
  2451.       Frame%, Attr%
  2452.  
  2453. DSeg%       segment of "screen" memory
  2454. DOfs%       offset of "screen" memory
  2455. TopRow%     top row of window
  2456. LeftCol%    left column of window
  2457. BottomRow%  bottom row of window
  2458. RightCol%   right column of window
  2459. Frame%      frame type (see above)
  2460. Attr%       frame color/attribute (use CalcAttr)
  2461.  
  2462. Name  : DXQPrint             (Direct-to-memory Extended Quick Print)
  2463. Class : Display
  2464. Level : Any
  2465.  
  2466. This routine provides a rather crude, but very fast, display capability.  It
  2467. works like the PRINT statement in BASIC, except that it doesn't move the
  2468. cursor or process control codes.  It works only in text modes.
  2469.  
  2470. This routine does not necessarily work on the display itself.  Instead, it
  2471. allows you to specify the memory location (segment and offset) of the
  2472. "screen", which may be an actual screen, a saved screen in an array, a
  2473. multitasker's virtual screen, etc.  Among other things, this makes it easy to
  2474. work with two displays at once: use a segment of &HB000 for the mono display
  2475. and &HB800 for the color display (the offset in each case is zero).
  2476.  
  2477.    DXQPrint DSeg%, DOfs%, St$, Row%, Column%, Attr%
  2478.  
  2479. DSeg%     segment of "screen" memory
  2480. DOfs%     offset of "screen" memory
  2481. St$       string to display
  2482. Row%      starting row
  2483. Column%   starting column
  2484. Attr%     color/attribute (see CalcAttr)
  2485.  
  2486. Name  : EGARest7             (EGA Restore for SCREEN 7)
  2487. Class : Display
  2488. Level : Clone
  2489.  
  2490. This routine allows you to restore a SCREEN 7 (EGA, 320x200, 16 color)
  2491. display that was saved using EGASave7 (see).
  2492.  
  2493.    EGARest7 DSeg%, DOfs%
  2494.  
  2495. DSeg%        segment of storage array, returned by VARSEG
  2496. DOfs%        offset  of storage array, returned by VARPTR
  2497.  
  2498. Name  : EGARest8             (EGA Restore for SCREEN 8)
  2499. Class : Display
  2500. Level : Clone
  2501.  
  2502. This routine allows you to restore a SCREEN 8 (EGA, 640x200, 16 color)
  2503. display that was saved using EGASave8 (see).
  2504.  
  2505.    EGARest8 DSeg%, DOfs%
  2506.  
  2507. DSeg%        segment of storage array, returned by VARSEG
  2508. DOfs%        offset  of storage array, returned by VARPTR
  2509.  
  2510. Name  : EGARest9             (EGA Restore for SCREEN 9)
  2511. Class : Display
  2512. Level : Clone
  2513.  
  2514. This routine allows you to restore a SCREEN 9 (EGA, 640x350, 16 color)
  2515. display that was saved using EGASave9 (see).
  2516.  
  2517.    EGARest9 DSeg1%, DOfs1%, DSeg2%, DOfs2%
  2518.  
  2519. DSeg1%       segment of storage array #1, returned by VARSEG
  2520. DOfs1%       offset  of storage array #1, returned by VARPTR
  2521. DSeg2%       segment of storage array #2, returned by VARSEG
  2522. DOfs2%       offset  of storage array #2, returned by VARPTR
  2523.  
  2524. Name  : EGASave7             (EGA Save for SCREEN 7)
  2525. Class : Display
  2526. Level : Clone
  2527.  
  2528. This routine allows you to save a SCREEN 7 (EGA, 320x200, 16 color) display
  2529. that can be restored using EGARest7 (see).
  2530.  
  2531. The array used to hold the screen must contain 32,000 bytes.  For an integer
  2532. array, this means that you must create the array by DIM Array%(1 TO 16000).
  2533.  
  2534.    EGASave7 DSeg%, DOfs%
  2535.  
  2536. DSeg%        segment of storage array, returned by VARSEG
  2537. DOfs%        offset  of storage array, returned by VARPTR
  2538.  
  2539. Name  : EGASave8             (EGA Save for SCREEN 8)
  2540. Class : Display
  2541. Level : Clone
  2542.  
  2543. This routine allows you to save a SCREEN 8 (EGA, 640x200, 16 color) display
  2544. that can be restored using EGARest8 (see).
  2545.  
  2546. The array used to hold the screen must contain 64,000 bytes.  For an integer
  2547. array, this means that you must create the array by DIM Array%(1 TO 32000).
  2548.  
  2549.    EGASave8 DSeg%, DOfs%
  2550.  
  2551. DSeg%        segment of storage array, returned by VARSEG
  2552. DOfs%        offset  of storage array, returned by VARPTR
  2553.  
  2554. Name  : EGASave9             (EGA Save for SCREEN 9)
  2555. Class : Display
  2556. Level : Clone
  2557.  
  2558. This routine allows you to save a SCREEN 9 (EGA, 640x350, 16 color) display
  2559. that can be restored using EGARest9 (see).
  2560.  
  2561. Two arrays must be used to hold the screen, for a total of 112,000 bytes.  If
  2562. you use integer arrays, each array must be created by DIM Array%(1 TO 28000).
  2563.  
  2564.    EGASave9 DSeg%, DOfs%
  2565.  
  2566. DSeg1%       segment of storage array #1, returned by VARSEG
  2567. DOfs1%       offset  of storage array #1, returned by VARPTR
  2568. DSeg2%       segment of storage array #2, returned by VARSEG
  2569. DOfs2%       offset  of storage array #2, returned by VARPTR
  2570.  
  2571. Name  : Elapsed              (Elapsed time)
  2572. Class : Time
  2573. Level : Any
  2574.  
  2575. This routine tells you the amount of time elapsed between a given starting
  2576. time and ending time.  The difference between the times must be less than 24
  2577. hours for the results to be meaningful.
  2578.  
  2579. See also ElapsedTime, the FUNCTION version of this routine.
  2580.  
  2581.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  2582.  
  2583. TimeStart$   starting time
  2584. TimeStop$    ending time
  2585. -------
  2586. TimeDiff$    elapsed time
  2587.  
  2588. Name  : ElapsedTime$         (Elapsed time)
  2589. Class : Time
  2590. Level : Any
  2591.  
  2592. This routine tells you the amount of time elapsed between a given starting
  2593. time and ending time.  The difference between the times must be less than 24
  2594. hours for the results to be meaningful.
  2595.  
  2596. See also Elapsed, the SUB version of this routine.
  2597.  
  2598.    TimeDiff$ = ElapsedTime$(TimeStart$, TimeStop$)
  2599.  
  2600. TimeStart$   starting time
  2601. TimeStop$    ending time
  2602. -------
  2603. TimeDiff$    elapsed time
  2604.  
  2605. Name  : EMSBuffer            (EMS Buffer size)
  2606. Class : Memory
  2607. Level : BIOS
  2608.  
  2609. EMSBuffer tells you how many bytes are needed to save the state of the EMS
  2610. array routines.  Used in conjunction with EMSSave and EMSRest, it allows you
  2611. to preserve EMS arrays across a CHAIN to another part of your program.
  2612.  
  2613.    EMSBuffer Bytes%
  2614.    EMSState$ = SPACE$(Bytes%)
  2615.    EMSSave EMSState$
  2616.  
  2617. -------
  2618. Bytes%       bytes needed to save EMS array state
  2619.  
  2620. Name  : EMSClose             (EMS Close)
  2621. Class : Memory
  2622. Level : BIOS
  2623.  
  2624. The EMSClose routine is used when you are finished with an EMS array.  It
  2625. frees the array handle and EMS memory for other uses.  If you don't close all
  2626. EMS arrays before your program ends, the memory will be lost until the system
  2627. is rebooted, so it is important to remember EMSClose.
  2628.  
  2629.    EMSClose ArrayHandle%
  2630.  
  2631. ArrayHandle%    handle of an EMS array
  2632.  
  2633. Name  : EMSGet               (EMS Get)
  2634. Class : Memory
  2635. Level : BIOS
  2636.  
  2637. This routine gets an element from an EMS array created by EMSOpen.  Element
  2638. numbers start at 0.  Be sure to use the right numeric type for the array--
  2639. for instance, if you opened the array for SINGLE precision, use "Value!".
  2640.  
  2641.    EMSGet ArrayHandle%, ElementNr&, Value
  2642.  
  2643. ArrayHandle%    handle of an EMS array
  2644. ElementNr&      element number to get
  2645. -------
  2646. Value           value to get element into (must be correct type for array)
  2647.  
  2648. Name  : EMSOpen              (EMS Open)
  2649. Class : Memory
  2650. Level : BIOS
  2651.  
  2652. This routine allows you to open a block of EMS (expanded) memory which can
  2653. then be accessed like a numeric array.  The array size is limited only by
  2654. available EMS memory (use GetLIMM to find out how much is available).  You
  2655. may specify any numeric type:
  2656.  
  2657.     1   INTEGER
  2658.     2   LONG or SINGLE
  2659.     3   DOUBLE
  2660.  
  2661. When the array is opened, you are returned an "array handle" which is used to
  2662. access that array.  Access to the array is done via EMSGet and EMSPut.  When
  2663. you are finished with the array, you must close it with EMSClose.
  2664.  
  2665. As many as 25 EMS arrays can be in use at one time, subject to limitations
  2666. which may be imposed by your EMS driver (each array requires one EMS handle).
  2667.  
  2668.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  2669.  
  2670. Elements&       number of elements in array (like DIM size)
  2671. ElementType%    numeric type of array (see above)
  2672. -------
  2673. ArrayHandle%    handle of an EMS array
  2674. ErrCode%        whether an error occurred (0 no)
  2675.  
  2676. Name  : EMSPut               (EMS Put)
  2677. Class : Memory
  2678. Level : BIOS
  2679.  
  2680. This routine puts an element into an EMS array created by EMSOpen.  Element
  2681. numbers start at 0.  Be sure to use the right numeric type for the array--
  2682. for instance, if you opened the array for SINGLE precision, use "Value!".
  2683.  
  2684.    EMSPut ArrayHandle%, ElementNr&, Value
  2685.  
  2686. ArrayHandle%    handle of an EMS array
  2687. ElementNr&      element number to set
  2688. Value           value to set element to (must be correct type for array)
  2689.  
  2690. Name  : EMSRest              (EMS Restore state)
  2691. Class : Memory
  2692. Level : BIOS
  2693.  
  2694. This routine allows you to restore the state of the EMS array handler.  Used
  2695. in conjunction with EMSBuffer and EMSSave, it allows you to preserve EMS
  2696. arrays across a CHAIN to another part of your program.
  2697.  
  2698.    EMSRest EMSState$
  2699.  
  2700. EMSState$    saved EMS array state
  2701.  
  2702. Name  : EMSSave              (EMS Save state)
  2703. Class : Memory
  2704. Level : BIOS
  2705.  
  2706. This routine allows you to save the state of the EMS array handler.  Used in
  2707. conjunction with EMSBuffer and EMSRest, it allows you to preserve EMS arrays
  2708. across a CHAIN to another part of your program.
  2709.  
  2710.    EMSBuffer Bytes%
  2711.    EMSState$ = SPACE$(Bytes%)
  2712.    EMSSave EMSState$
  2713.  
  2714. -------
  2715. EMSState$    saved EMS array state
  2716.  
  2717. Name  : EnhKbd               (Enhanced Keyboard)
  2718. Class : Input
  2719. Level : BIOS
  2720.  
  2721. By default, the PBClone routines assume an old-style keyboard is in use, for
  2722. greatest compatibility.  EnhKbd allows you to turn on enhanced keyboard
  2723. handling for the current generation of (usually) 101-key keyboards.  This
  2724. allows access to the F11 and F12 function keys as well as codes for key
  2725. combinations that used to be ignored, among other things.
  2726.  
  2727. The KbdType or KbdType2% routine can be used to determine if an enhanced
  2728. keyboard is available (recommended).
  2729.  
  2730. Note that EnhKbd works by intercepting the BIOS keyboard handler.  All calls
  2731. to the BIOS keyboard interrupt are converted from the old keyboard functions
  2732. to the new ones.  YOU MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can
  2733. restore the old setup.  Otherwise, the computer will most probably crash.
  2734.  
  2735. A list of the new key codes is given in PBClone.DOC.
  2736.  
  2737.    EnhKbd Enable%
  2738.  
  2739. Enable%     turn on enhanced keyboard support (0 disable, else enable)
  2740.  
  2741. Name  : EuropeDate           (European Date format)
  2742. Class : Time
  2743. Level : Any
  2744.  
  2745. This routine takes a date in one of the American formats ("MM/DD/YY" or
  2746. "MM-DD-YYYY") and converts it to the European convention ("DD.MM.YY" or
  2747. "DD.MM.YYYY").  The date is formatted according to a format string which
  2748. provides the desired delimiter and year length, e.g. "##-##-##" specifies a
  2749. delimiter of "-" and a year length of two digits.
  2750.  
  2751. An error code is returned if the date is not valid.
  2752.  
  2753.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  2754.  
  2755. DateSt$     date to format (month, day, year order)
  2756. Format$     format for the date
  2757. -------
  2758. Result$     resulting date (day, month, year order)
  2759. ErrCode     whether the date is valid (0 ok)
  2760.  
  2761. Name  : Equipment            (Equipment information)
  2762. Class : Equipment
  2763. Level : BIOS
  2764.  
  2765. This routine gives you some information about the basic equipment in your
  2766. computer.  Note that the "game port" information is not reliable, due to
  2767. changes in the meaning of this particular area of the BIOS over many years.
  2768.  
  2769.    Equipment Memory%, Parallel%, Serial%, Game%
  2770.  
  2771. -------
  2772. Memory%    kilobytes of conventional memory installed (16 - 640)
  2773. Parallel%  parallel (printer) ports installed (0-4)
  2774. Serial%    serial (communications) ports installed (0-4)
  2775. Game%      game (joystick) ports installed (0-1).  See remarks, above.
  2776.  
  2777. Name  : EWindowManagerC      (EGA Window Manager with Character coordinates)
  2778. Class : Display
  2779. Level : Clone
  2780.  
  2781. EWindowManagerC displays a pop-up window according to your specifications.
  2782. The window may have any of a variety of frames, a title, or a shadow, and it
  2783. may appear instantly or "grow" onto the screen.  EGA and VGA graphics modes
  2784. (SCREEN 7 through SCREEN 12) are supported.
  2785.  
  2786. These are the available frame types:
  2787.     0   no frame
  2788.     1   single lines
  2789.     2   double lines
  2790.     3   single horizontal, double vertical lines
  2791.     4   double horizontal, single vertical lines
  2792.     5   block graphic lines
  2793.  
  2794. These are the available shadows:
  2795.     0   no shadow
  2796.    1+   shadow attribute (use CalcAttr) for a colored shadow
  2797.  
  2798. Options for growing windows are as follows:
  2799.    -1   grow as fast as possible
  2800.     0   pop onto the screen
  2801.    1+   grow with a specified delay in milliseconds (not recommended)
  2802.  
  2803. The differences between this routine and its ProBas equivalent are the same
  2804. as mentioned in the description for WindowManager.  In addition, growing
  2805. windows are supported, but are not recommended (too slow).  Colored shadows
  2806. work as in WindowManager.  "True" shadows are not yet supported.
  2807.  
  2808.    EWindowManagerC TopRow%, LeftCol%, BottomRow%, RightCol%, Frame%,
  2809.       Fore%, Back%, Grow%, Shade%, S1%, S2%, TFore%, Title$
  2810.  
  2811. TopRow%     top row of window
  2812. LeftCol%    left column of window
  2813. BottomRow%  bottom row of window
  2814. RightCol%   right column of window
  2815. Frame%      frame type (see above)
  2816. Fore%       frame foreground color
  2817. Back%       frame background color
  2818. Grow%       window growing option (see above)
  2819. Shade%      window shadow option (see above)
  2820. S1%         unused
  2821. S2%         unused
  2822. TFore%      title foreground color
  2823. Title$      window title ("" if none)
  2824.  
  2825. Name  : Exist                (file Existence)
  2826. Class : Disk
  2827. Level : DOS
  2828.  
  2829. Most versions of BASIC give you no way of seeing if a file exists before you
  2830. try to OPEN it, so you end up taking your chances.  The Exist routine allows
  2831. you to test to see if the file exists beforehand.  It isn't really necessary
  2832. for the PBClone file routines, which will return an appropriate error code,
  2833. but it's an important safeguard when using the BASIC OPEN statement.
  2834.  
  2835. The Exist routine does not support wildcards.  If you need that feature, try
  2836. the FindFirstFx and FindNextFx routines instead.
  2837.  
  2838. See also Exist2, the FUNCTION version of this routine.
  2839.  
  2840.    Exist FileName$, Found%
  2841.  
  2842. FileName$   name of the file to look for
  2843. -------
  2844. Found%      whether the file was found (0 if no)
  2845.  
  2846. Name  : Exist2%              (file Existence)
  2847. Class : Disk
  2848. Level : DOS
  2849.  
  2850. Most versions of BASIC give you no way of seeing if a file exists before you
  2851. try to OPEN it, so you end up taking your chances.  The Exist2% function
  2852. allows you to test to see if the file exists beforehand.  It isn't really
  2853. necessary for the PBClone file routines, which will return an appropriate
  2854. error code, but it's an important safeguard when using the OPEN statement.
  2855.  
  2856. The Exist2% routine does not support wildcards.  If you need that feature,
  2857. try the FindFirstFx and FindNextFx routines instead.
  2858.  
  2859. See also Exist, the SUB version of this routine.
  2860.  
  2861.    Found% = Exist2%(FileName$)
  2862.  
  2863. FileName$   name of the file to look for
  2864. -------
  2865. Found%      whether the file was found (0 if no)
  2866.  
  2867. Name  : EXQPrintC            (EGA Extended Quick Print, Character coords)
  2868. Class : Display
  2869. Level : Clone
  2870.  
  2871. This routine provides a rather crude, but very fast, display capability.  It
  2872. works like the PRINT statement in BASIC, except that it doesn't move the
  2873. cursor or process control codes.  It works in EGA and VGA graphics modes
  2874. (SCREEN 7 through SCREEN 12).
  2875.  
  2876.    EXQPrintC St$, Row%, Column%, Fore%, Back%
  2877.  
  2878. St$       string to display
  2879. Row%      starting row
  2880. Column%   starting column
  2881. Fore%     foreground color
  2882. Back%     background color
  2883.  
  2884. Name  : ExtendFSpec          (Extend File Specification)
  2885. Class : Disk
  2886. Level : DOS
  2887.  
  2888. The ExtendFSpec routine combines a number of handy services together.  It is
  2889. intended for processing user-entered file specifications.  It does the
  2890. following:
  2891.  
  2892.    1) Makes sure the filespec is valid
  2893.    2) Formats the filespec to normal DOS standards
  2894.    3) Tells you whether the drive and subdirectories specified exist
  2895.    4) Fills out any drive or subdirectory information that was left out
  2896.       (optionally includes adding an extension to files which lack one)
  2897.  
  2898. The error codes returned are as follows:
  2899.    -1    Invalid file specification
  2900.     0    No error
  2901.     1    Specified drive does not exist (warning only)
  2902.     2    Specified subdirectory does not exist (warning only)
  2903.  
  2904. The ExtendFSpec routine mimics DOS filename handling exactly, to the best of
  2905. my knowledge.
  2906.  
  2907.    ExtendFSpec File$, Ext$, FullFile$, ErrCode%
  2908.  
  2909. File$      file specification to process
  2910. Ext$       extension to add to files that don't have extensions
  2911. -------
  2912. FullFile$  processed file specification
  2913. ErrCode%   error code
  2914.  
  2915. Name  : ExtGet               (Extended memory Get)
  2916. Class : Memory
  2917. Level : BIOS (AT)
  2918.  
  2919. This routine allows you to get information from extended memory.  It should
  2920. only be used on AT-class computers, since older PCs do not support extended
  2921. memory.
  2922.  
  2923. You may get up to 32,766 words (just under 64 kilobytes) at a time from a
  2924. specified location in extended memory.  The location is specified as the
  2925. distance from the start of extended memory, starting at 1 for the first
  2926. location.  One word is equivalent to one integer.
  2927.  
  2928. See ExtMem for information on extended memory constraints.
  2929.  
  2930.    ExtGet DSeg%, DOfs%, Posn&, Words%, ErrCode%
  2931.  
  2932. DSeg%       segment of array in which to place data from extended memory
  2933. DOfs%       offset of array in which to place data from extended memory
  2934. Posn&       location of data in extended memory (starting at 1)
  2935. Words%      number of words to transfer (1 integer = 1 word = 2 bytes)
  2936. -------
  2937. ErrCode%    error code (0 if no error)
  2938.  
  2939. Name  : ExtMem               (Extended Memory)
  2940. Class : Memory / Equipment
  2941. Level : BIOS (AT)
  2942.  
  2943. This routine allows you to find out how much extended memory is available.
  2944. It should only be used on AT-class computers, since older PCs do not support
  2945. extended memory.
  2946.  
  2947. The amount of memory returned may be either the total amount of extended
  2948. memory installed or just the amount available at this time, depending on how
  2949. previously-installed programs (if any) make use of extended memory.
  2950. Unfortunately, there is no standard which defines how a program should use
  2951. extended memory as there is with EMS (expanded memory), so there is no way
  2952. for a program to determine whether or how another program is using extended
  2953. memory.  Microsoft is trying to clear up this situation with its HIMEM driver
  2954. (available at your local BBS, or [last I looked] free from Microsoft), but
  2955. this approach hasn't really become standard yet.
  2956.  
  2957.    ExtMem KBytes%
  2958.  
  2959. -------
  2960. KBytes%     the number of kilobytes of extended memory
  2961.  
  2962. Name  : ExtPut               (Extended memory Put)
  2963. Class : Memory
  2964. Level : BIOS (AT)
  2965.  
  2966. This routine allows you to put information into extended memory.  It should
  2967. only be used on AT-class computers, since older PCs do not support extended
  2968. memory.
  2969.  
  2970. You may put up to 32,766 words (just under 64 kilobytes) at a time into a
  2971. specified location in extended memory.  The location is specified as the
  2972. distance from the start of extended memory, starting at 1 for the first
  2973. location.  One word is equivalent to one integer.
  2974.  
  2975. Note that you can't rely on extended memory being available just because it
  2976. exists.  There is no automatic way to determine if another program is also
  2977. trying to use the same extended memory.  If in doubt, allow a user-installed
  2978. option to enable/disable the use of extended memory by your program.
  2979.  
  2980.    ExtPut DSeg%, DOfs%, Posn&, Words%, ErrCode%
  2981.  
  2982. DSeg%       segment of data to store in extended memory
  2983. DOfs%       offset of data to store in extended memory
  2984. Posn&       location to place data in extended memory (starting at 1)
  2985. Words%      number of words to transfer (1 integer = 1 word = 2 bytes)
  2986. -------
  2987. ErrCode%    error code (0 if no error)
  2988.  
  2989. Name  : Extract              (Extract delimited substring)
  2990. Class : String
  2991. Level : Any
  2992.  
  2993. Extract allows you to remove any one of a list of delimited substrings in a
  2994. string.  It's useful for input parsing and database work.  You pass it the
  2995. string, delimiter, and the number of the desired substring (numbers start at
  2996. one).  It returns the starting position of the substring within the string
  2997. and the length of the substring (0 if not found).
  2998.  
  2999. Just for example, let's assume we have a string as follows:
  3000.    St$ = "Thomas G. Hanlin III=3544 E. Southern Ave #104=Mesa, AZ 85204"
  3001.  
  3002. If we selected a delimiter of "=" and substring number three, the results
  3003. would be "Mesa, AZ 85204".
  3004.  
  3005. Delimiters of more than one character are fine.  This can be handy for
  3006. locating carriage return/linefeed pairs, among other things.
  3007.  
  3008.    Extract St$, Delimiter$, SubStrNr%, StartPosn%, SLen%
  3009.    SubSt$ = MID$(St$, StartPosn%, SLen%)
  3010.  
  3011. St$         string from which to extract
  3012. Delimiter$  delimiter between substrings
  3013. SubStrNr%   number of the desired substring
  3014. -------
  3015. StartPosn%  starting position of the substring within the string
  3016. SLen%       length of the substring (0 if none)
  3017.  
  3018. Name  : FadeOut              (Fade Out)
  3019. Class : Display
  3020. Level : Clone
  3021.  
  3022. Like CLS, but a bit more fancy, this routine provides an interesting way to
  3023. clear the screen.  See also Dissolve.
  3024.  
  3025.    FadeOut Attr%
  3026.  
  3027. Attr%   color/attribute to which to clear (see CalcAttr)
  3028.  
  3029. Name  : FarPeek%             (Far memory Peek)
  3030. Class : Memory
  3031. Level : Clone
  3032.  
  3033. This is like the BASIC PEEK function, but expects both a segment and an
  3034. offset, thus doing away with the need for DEF SEG.  This is especially handy
  3035. for use in subprograms which might otherwise inadvertently change the DEF SEG
  3036. value expected by the main program.
  3037.  
  3038.    Value% = FarPeek%(DSeg%, DOfs%)
  3039.  
  3040. DSeg%    segment of the location to look at
  3041. DOfs%    offset of the location to look at
  3042. -------
  3043. Value%   value at the specified memory location (byte: 0-255)
  3044.  
  3045. Name  : FarPoke              (Far memory Poke)
  3046. Class : Memory
  3047. Level : Clone
  3048.  
  3049. This is like the BASIC POKE statement, but expects both a segment and an
  3050. offset, thus doing away with the need for DEF SEG.  This is especially handy
  3051. for use in subprograms which might otherwise inadvertently change the DEF SEG
  3052. value expected by the main program.
  3053.  
  3054.    FarPoke DSeg%, DOfs%, Value%
  3055.  
  3056. DSeg%    segment of the location to look at
  3057. DOfs%    offset of the location to look at
  3058. Value%   value to store in the specified memory location (byte: 0-255)
  3059.  
  3060. Name  : FClose               (File Close)
  3061. Class : Disk
  3062. Level : DOS
  3063.  
  3064. This routine closes a file that was opened by FOpen or FCreate.  It can also
  3065. be used to close any of the predefined device handles.
  3066.  
  3067. These are the predefined device handles that are always available:
  3068.  
  3069.    0    CON     stdin     standard input, normally the keyboard
  3070.    1    CON     stdout    standard output, normally the display
  3071.    2    CON     stderr    standard error, almost always the display
  3072.    3    AUX     stdaux    auxiliary device, generally COM1
  3073.    4    PRN     stdprn    standard printer, generally LPT1
  3074.  
  3075. If you are running short of handles, you can always close stdaux to free up a
  3076. handle.  The stdprn device can also be closed as long as you don't use the
  3077. printer or if you only access the printer through LPRINT.  It is not a good
  3078. idea to close stdin, stdout, or stderr under normal circumstances.
  3079.  
  3080.    FClose Handle%
  3081.  
  3082. Handle%    handle of the file to close
  3083.  
  3084. Name  : FCreate              (File Create)
  3085. Class : Disk
  3086. Level : DOS
  3087.  
  3088. This routine creates a file and opens it for use by the PBClone file handling
  3089. routines.  If the file already existed, it will be wiped out, so you may want
  3090. to check beforehand if this is a problem.  Try the Exist routine.
  3091.  
  3092. The file is opened in read/write mode, allowing both input and output.
  3093.  
  3094. You may create the file using any of the following attributes:
  3095.  
  3096.    Normal          0      (nothing special)
  3097.    Read Only       1      file can be read, but not written to
  3098.    Hidden          2      file is "invisible"
  3099.    System          4      special DOS system file
  3100.  
  3101. The attributes can be combined by adding them together.  Don't use the System
  3102. attribute unless you know what you're doing!
  3103.  
  3104. Note that this routine does not support file sharing.  If that is a problem,
  3105. close the file just after it is created and reopen it using FOpen.
  3106.  
  3107.    FCreate FileName$, Attr%, Handle%, ErrCode%
  3108.  
  3109. FileName$  name of the file to create
  3110. Attr%      attribute(s) of the file
  3111. -------
  3112. Handle%    handle by which to access the file (if there was no error)
  3113. ErrCode%   error code: 0 if no error, else DOS Error
  3114.  
  3115. Name  : FGetLoc              (File Get Location)
  3116. Class : Disk
  3117. Level : DOS
  3118.  
  3119. This routine tells you the position of the file pointer of a file that was
  3120. opened using FOpen or FCreate.  This pointer is used to specify where the
  3121. next item should be read from or written to the file.  The first location of
  3122. the file is numbered 1.
  3123.  
  3124. See also FGetLoc2, the FUNCTION version of this routine.
  3125.  
  3126.    FGetLoc Handle%, Posn&
  3127.  
  3128. Handle%    handle of the file
  3129. -------
  3130. Posn&      location of the file pointer
  3131.  
  3132. Name  : FGetLoc2&            (File Get Location)
  3133. Class : Disk
  3134. Level : DOS
  3135.  
  3136. This routine tells you the position of the file pointer of a file that was
  3137. opened using FOpen or FCreate.  This pointer is used to specify where the
  3138. next item should be read from or written to the file.  The first location of
  3139. the file is numbered 1.
  3140.  
  3141. See also FGetLoc, the SUB version of this routine.
  3142.  
  3143.    Posn& = FGetLoc2&(Handle%)
  3144.  
  3145. Handle%    handle of the file
  3146. -------
  3147. Posn&      location of the file pointer
  3148.  
  3149. Name  : FileCopy             (File Copy)
  3150. Class : Disk
  3151. Level : DOS
  3152.  
  3153. This routine copies one or more files, just like the DOS command "COPY".
  3154.  
  3155. FileCopy works exactly like the DOS COPY command, except it won't append
  3156. files.  You may use wildcards in both source and destination file
  3157. specifications.  In the event of an error, normal DOS error codes are
  3158. returned, with two exceptions:
  3159.  
  3160.   -2  attempt to copy files over themselves
  3161.   -1  attempt to copy multiple source files to a single destination file
  3162.  
  3163. See also CopyFile, a simpler routine which doesn't support wildcards.
  3164.  
  3165.    FileCopy SrcFile$, DestFile$, FileCount%, ByteCount&, ErrCode%
  3166.  
  3167. SrcFile$    source file name(s)
  3168. DestFile$   destination file name(s)
  3169. -------
  3170. FileCount%  number of files copied
  3171. ByteCount&  number of bytes copied
  3172. ErrCode%    error code (0 if no error)
  3173.  
  3174. Name  : FileCRC              (File CRC)
  3175. Class : Disk
  3176. Level : DOS
  3177.  
  3178. This routine calculates a 32-bit CRC for a file.  This CRC is derived by a
  3179. formula which takes each character of the file into consideration.  It
  3180. provides a powerful (although not 100% foolproof) way to verify that a file
  3181. hasn't changed since you last checked.
  3182.  
  3183.    FileCRC FileName$, Result&, ErrCode%
  3184.  
  3185. FileName$   source file name(s)
  3186. -------
  3187. Result&     32-bit CRC of the file
  3188. ErrCode%    error code (0 if no error)
  3189.  
  3190. Name  : FindFirstA           (Find First file in an Archive)
  3191. Class : Disk
  3192. Level : DOS
  3193.  
  3194. The FindFirstA routine is used to find the first file that matches search
  3195. parameters which you specify.  Various information about the file that
  3196. matches (if any) can be retrieved by other routines.
  3197.  
  3198. Rather than working on a directory, this routine works on files in an
  3199. archive.  Supported archives include ARC, ARJ, LZH, PAK, ZIP and ZOO
  3200. formats.  If no extension is given, a search will be made through each valid
  3201. archive extension, and the first matching archive will be used for the file
  3202. search.
  3203.  
  3204. Archive names may contain drive and subdirectory specifications, but not
  3205. wildcards.  File names may contain wildcards, but not drive/subdir specs.
  3206.  
  3207. When you are done searching, be sure to use CloseA to terminate the search.
  3208.  
  3209. Routines in this series include:
  3210.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  3211.    GetSizeAL, GetStoreA
  3212.  
  3213.    FindFirstA ArcName$, FileName$, ErrCode%
  3214.  
  3215. ArcName$    name of archive to search through
  3216. FileName$   name of file(s) for which to search
  3217. -------
  3218. ErrCode%    error code (0 if no error, else no matching files)
  3219.  
  3220. Name  : FindFirstF           (Find First File)
  3221. Class : Disk
  3222. Level : DOS
  3223.  
  3224. This is part of a set of routines included for compatibility with ADVBAS and
  3225. ProBas.  A better solution may be found in FindFirstFx.
  3226.  
  3227. The FindFirstF routine is used to find the first file that matches search
  3228. parameters which you specify.  Various information about the file that
  3229. matches (if any) can be retrieved by other routines.  See also FindNextF.
  3230.  
  3231. The file name specified may contain a drive and subdirectory specification.
  3232. Wildcards are also allowed.
  3233.  
  3234. Possible search attributes are as follows:
  3235.  
  3236.    Normal          0      (nothing special)
  3237.    Hidden          2      file is "invisible"
  3238.    System          4      special DOS system file
  3239.    Subdirectory   16      subdirectory
  3240.  
  3241. You can combine the attributes by adding them together.  All searches will
  3242. match if any of the specified attributes are found, so if you're looking only
  3243. for a specific attribute, you will need to test the results using GetAttrF.
  3244.  
  3245. Routines in this series include:
  3246.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  3247.  
  3248.    FindFirstF FileName$, Attr%, ErrCode%
  3249.  
  3250. FileName$   name of file(s) for which to search
  3251. Attr%       file attribute(s) to seek
  3252. -------
  3253. ErrCode%    error code (0 if no error, else no matching files)
  3254.  
  3255. Name  : FindFirstFx          (Find First File, Extended)
  3256. Class : Disk
  3257. Level : DOS
  3258.  
  3259. The FindFirstFx routine is used to find the first file that matches search
  3260. parameters which you specify.  Various information about the file that
  3261. matches (if any) can be retrieved by other routines.
  3262.  
  3263. The file name specified may contain a drive and subdirectory specification.
  3264. Wildcards are also allowed.
  3265.  
  3266. Possible search attributes are as follows:
  3267.  
  3268.    Normal          0      (nothing special)
  3269.    Read Only       1      file can be read, but not written to
  3270.    Hidden          2      file is "invisible"
  3271.    System          4      special DOS system file
  3272.    Subdirectory   16      subdirectory
  3273.  
  3274. You can combine the attributes by adding them together.  All searches will
  3275. match if any of the specified attributes are found, so if you're looking only
  3276. for a specific attribute, you will need to test the results using GetAttrFx.
  3277.  
  3278. Routines in this series include:
  3279.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$, GetTimeFx$,
  3280.    GetSizeFx&
  3281.  
  3282. These routines differ from the older FindFirstF-based series in two major
  3283. respects.  They include a Buffer$ parameter, which allows you to have more
  3284. than one search going on at a time.  This makes it safe to use these routines
  3285. in subprograms without conflict with the main program.  It also allows you to
  3286. search entire subdirectory trees recursively.  The other major difference is
  3287. that many of these routines are coded as functions for greater convenience.
  3288.  
  3289.    Buffer$ = SPACE$(64)
  3290.    FindFirstFx Buffer$, FileName$, Attr%, ErrCode%
  3291.  
  3292. FileName$   name of file(s) for which to search
  3293. Attr%       file attribute(s) to seek
  3294. -------
  3295. Buffer$     buffer used in search (init to 64 characters)
  3296. ErrCode%    error code (0 if no error, else no matching files)
  3297.  
  3298. Name  : FindNextA            (Find Next file in an Archive)
  3299. Class : Disk
  3300. Level : DOS
  3301.  
  3302. This routine is for use after FindFirstA, to find any additional archived
  3303. files which may match your search specifications.
  3304.  
  3305. Routines in this series include:
  3306.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  3307.    GetSizeAL, GetStoreA
  3308.  
  3309.    FindNextA ErrCode%
  3310.  
  3311. -------
  3312. ErrCode%    error code (0 if no error, else no matching files)
  3313.  
  3314. Name  : FindNextF            (Find Next File)
  3315. Class : Disk
  3316. Level : DOS
  3317.  
  3318. This routine is for use after FindFirstF, to find any additional files which
  3319. may match your search specifications.
  3320.  
  3321. Routines in this series include:
  3322.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  3323.  
  3324.    FindNextF ErrCode%
  3325.  
  3326. -------
  3327. ErrCode%    error code (0 if no error, else no matching files)
  3328.  
  3329. Name  : FindNextFx           (Find Next File, Extended)
  3330. Class : Disk
  3331. Level : DOS
  3332.  
  3333. This routine is for use after FindFirstFx, to find any additional files which
  3334. may match your search specifications.
  3335.  
  3336. Routines in this series include:
  3337.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$, GetTimeFx$,
  3338.    GetSizeFx&
  3339.  
  3340.    FindNextFx Buffer$, ErrCode%
  3341.  
  3342. Buffer$     buffer used in search
  3343. -------
  3344. Buffer$     updated buffer
  3345. ErrCode%    error code (0 if no error, else no matching files)
  3346.  
  3347. Name  : FindPatch            (Find Patch location)
  3348. Class : Disk
  3349. Level : DOS
  3350.  
  3351. This is one of a set of routines that allow you to write self-modifying code.
  3352. Your program can patch DATA statements in itself or in another program,
  3353. allowing you to save configuration information (for example) without having
  3354. to create additional data files.
  3355.  
  3356. In order for this routine to work, you must have a series of DATA statements
  3357. containing quoted strings of the maximum desired length.  The first DATA
  3358. statement must contain a unique string, as FindPatch will use it to locate
  3359. the data block.  Note that if your program is patching itself, you must READ
  3360. the unique string rather than assigning it directly, to make sure it's
  3361. unique.  The string must exist at only one place in the program.
  3362.  
  3363. See the PDEMO.BAS file if you would like clarification.  This little demo
  3364. program, when compiled, will patch itself with whatever you enter on the
  3365. command line.  For instance, if you type PDEMO Banana, it will store "Banana"
  3366. in its DATA statement.  PDEMO will not work in the QuickBASIC environment, of
  3367. course.  You must compile it to an .EXE file.
  3368.  
  3369. A precompiled version of PDEMO has been included.  It was compiled with
  3370. Crescent's PDQ library in addition to PBClone, which makes the .EXE file much
  3371. smaller.  It also doesn't capitalize COMMAND$.  You can recompile PDEMO using
  3372. the PCREATE.BAT program (PDQ is not required).
  3373.  
  3374. You may compile the program using any switches.  You may not use the /EXEPACK
  3375. switch for LINK, though, as this may alter the program DATA area.  Likewise,
  3376. you must not use compression utilities such as PKLite on the program.
  3377.  
  3378. Routines in this set include FindPatch, SetPatch, and PatchDone.
  3379.  
  3380.    FindPatch FileName$, SearchSt$, ErrCode%
  3381.  
  3382. FileName$     name of the file to patch
  3383. SearchSt$     value of the first DATA statement
  3384. MoveBack%     not used
  3385. -------
  3386. ErrCode%      whether the search was successful (0 yes, <0 no, >0 Disk Error)
  3387.  
  3388. Name  : Floppies             (Floppies installed)
  3389. Class : Equipment / Disk
  3390. Level : BIOS
  3391.  
  3392. The Floppies routine tells you how many floppy drives are installed (0-4).
  3393. See also Floppies2, a function version of this routine.
  3394.  
  3395.    Floppies Drives%
  3396.  
  3397. -------
  3398. Drives%  number of floppy disk drives installed
  3399.  
  3400. Name  : Floppies2%           (Floppies installed)
  3401. Class : Equipment / Disk
  3402. Level : BIOS
  3403.  
  3404. The Floppies2 routine tells you how many floppy drives are installed (0-4).
  3405.  
  3406.    Drives% = Floppies2%
  3407.  
  3408. -------
  3409. Drives%  number of floppy disk drives installed
  3410.  
  3411. Name  : FloppyType           (Floppy drive Type)
  3412. Class : Equipment / Disk
  3413. Level : Clone (AT)
  3414.  
  3415. This routine tells you what kinds of floppy drives are installed, if any.  A
  3416. code is returned for each drive, as follows:
  3417.  
  3418.    0    no drive
  3419.    1    5 1/4"    360K
  3420.    2    5 1/4"    1.2M
  3421.    3    3 1/2"    720K
  3422.    4    3 1/2"    1.44M
  3423.  
  3424. Result codes of 5-7 are available, but not yet defined.  One might guess that
  3425. the 2.88M drive supported by DOS 5.0 will be drive type 5.
  3426.  
  3427. Note that this routine supports a maximum of only two drives.  It is possible
  3428. for a machine to have up to four drives, but there is not currently any good
  3429. way to find out about them.
  3430.  
  3431. FloppyType should only be used on AT-class machines.  It will not work on
  3432. PC/XT computers and may cause unusual results if used on such machines.  It
  3433. will also not work on some of the earliest AT machines, which didn't adhere
  3434. to the standard CMOS format.
  3435.  
  3436.    FloppyType DriveA%, DriveB%
  3437.  
  3438. -------
  3439. DriveA%    drive type of first floppy drive
  3440. DriveB%    drive type of second floppy drive
  3441.  
  3442. Name  : FlushToDisk          (Flush file buffers To Disk)
  3443. Class : Disk
  3444. Level : DOS
  3445.  
  3446. This is a "file safety" routine for use with files opened by FOpen or
  3447. FCreate.  Files are normally buffered by DOS, which makes file handling
  3448. faster but creates the danger of losing the file if there is a crash or power
  3449. outage.  By flushing the file to disk, you insure that it is updated to the
  3450. current moment.
  3451.  
  3452. Note: this routine will need to temporarily create a new file handle if DOS
  3453. versions before 4.0 are used.
  3454.  
  3455.    FlushToDisk Handle%, ErrCode%
  3456.  
  3457. Handle%    handle of the file to flush
  3458. -------
  3459. ErrCode%   error code: 0 if none, else DOS Error
  3460.  
  3461. Name  : FOpen                (File Open)
  3462. Class : Disk
  3463. Level : DOS
  3464.  
  3465. This routine opens an existing file for use with the PBClone file handling
  3466. routines.  If you need to create a file that doesn't already exist, use the
  3467. FCreate routine instead.
  3468.  
  3469. The file may be opened for reading, writing, or both:
  3470.  
  3471.    0   Read
  3472.    1   Write
  3473.    2   Read/Write
  3474.  
  3475. You may specify a file sharing mode for use with networks and multitaskers.
  3476. This will only take effect if the DOS version is 3.0 or later and if the DOS
  3477. SHARE utility has been executed.  Otherwise, it will be ignored.
  3478.  
  3479.    0   Normal       compatibility mode: no file sharing permitted
  3480.    1   Exclusive    no one else may access the file
  3481.    2   Deny Write   no one else may write to the file
  3482.    3   Deny Read    no one else may read from the file
  3483.    4   Deny None    anyone else may read from or write to the file
  3484.  
  3485. Most of the time, "Deny Write" will be appropriate.  This allows others to
  3486. read the file, but not to modify the file on you unexpectedly.
  3487.  
  3488. See the discussion of predefined device handles at FClose.
  3489.  
  3490.    FOpen FileName$, ReadWrite%, Sharing%, Handle%, ErrCode%
  3491.  
  3492. FileName$   name of the file to open
  3493. ReadWrite%  whether to want to do input, output, or both (see above)
  3494. Sharing%    file sharing mode (see above)
  3495. -------
  3496. Handle%    handle by which to access the file (if there was no error)
  3497. ErrCode%   error code: 0 if no error, else DOS Error
  3498.  
  3499. Name  : ForceMatch$          (Force Match of file to wildcard)
  3500. Class : Disk
  3501. Level : Any
  3502.  
  3503. The ForceMatch$ function allows you to mimic DOS commands that operate on
  3504. source file(s) and destination file(s).  It forces a source file name to
  3505. match a specified pattern (which may contain wildcards), producing an
  3506. appropriate destination file name.
  3507.  
  3508. For example, if the source is "TESTNAME.BAS" and the pattern is "?RUE*.*",
  3509. the result would be "TRUENAME.BAS".
  3510.  
  3511. Consider the DOS command "COPY *.BAS A:*.BAK".  The "*.BAK" part is the
  3512. desired pattern.  The "*.BAS" part specifies which files to copy to the new
  3513. pattern.  Each filename that matches "*.BAS" is translated through the
  3514. "*.BAK" pattern to give the destination filename.  The ForceMatch$ function
  3515. is designed to do this sort of translation for you.
  3516.  
  3517.    DestFile$ = ForceMatch$(Pattern$, SrcFile$)
  3518.  
  3519. Pattern$   pattern of desired file name (may contain wildcards)
  3520. SrcFile$   file name to force through the pattern
  3521. -------
  3522. DestFile$  resulting file name
  3523.  
  3524. Name  : FormatDate           (Format Date)
  3525. Class : Time
  3526. Level : Any
  3527.  
  3528. This is a highly flexible date formatting routine.  It accepts a date in one
  3529. of the usual American formats ("03-22-1990", "03/22/90", or even "3/22/90")
  3530. and converts it according to a format string.  This format string allows you
  3531. to normalize the date, select a new delimiter, choose between two-digit and
  3532. four-digit years, and even change the order from month/day/year to anything
  3533. else.  An error code will be returned if the date is not valid.
  3534.  
  3535. The format string can be as simple as "##/##/##", which specifies that the
  3536. usual month/day/year order be used, with a delimiter of "/" and a two-digit
  3537. year.  If you want to change the date order, you would need a format like
  3538. "DD.MM.YYYY" instead.  For sorting or storage, you might want to convert the
  3539. date to a plain number, using a format string like "YYYYMMDD".  The result
  3540. could then be converted to a LONG with the BASIC VAL function.
  3541.  
  3542.    FormatDate DateSt$, Format$, Result$, ErrCode%
  3543.  
  3544. DateSt$     date to format (month, day, year order)
  3545. Format$     format for the date
  3546. -------
  3547. Result$     resulting date
  3548. ErrCode     whether the date is valid (0 ok)
  3549.  
  3550. Name  : FSetEnd              (File Set to End)
  3551. Class : Disk
  3552. Level : DOS
  3553.  
  3554. This moves the file pointer to the end of the file.  It is for use with files
  3555. opened by FOpen or FCreate.  The usual purpose for this is to append
  3556. information to an existing file.
  3557.  
  3558. Note that some text files may have a Control-Z or CHR$(26) on the end.  For
  3559. historical reasons, this character is sometimes used as an "end of file"
  3560. marker.  When dealing with text files, you may want to examine the last
  3561. character of the file to make sure it isn't a Control-Z.
  3562.  
  3563. QuickBASIC is among the programs which, unfortunately, put a Control-Z at the
  3564. end of a file (if you OPEN for OUTPUT).  This is a bad habit at best.
  3565.  
  3566.    FSetEnd Handle%
  3567.  
  3568. Handle%    handle of the file
  3569.  
  3570. Name  : FSetLoc              (File Set Location to byte)
  3571. Class : Disk
  3572. Level : DOS
  3573.  
  3574. This moves the file pointer to a specified position in the file.  It is for
  3575. use with files opened by FOpen or FCreate.  File positions are considered to
  3576. start at 1.
  3577.  
  3578.    FSetLoc Handle%, Posn&
  3579.  
  3580. Handle%    handle of the file
  3581. Posn&      location to which to move
  3582.  
  3583. Name  : FSetOfs              (File Set location by Offset)
  3584. Class : Disk
  3585. Level : DOS
  3586.  
  3587. This moves the file pointer backwards or forwards in the file.  It is for
  3588. use with files opened by FOpen or FCreate.
  3589.  
  3590.    FSetOfs Handle%, Offset&
  3591.  
  3592. Handle%    handle of the file
  3593. Offset&    number of bytes by which to move
  3594.  
  3595. Name  : FSetRec              (File Set location to Record)
  3596. Class : Disk
  3597. Level : DOS
  3598.  
  3599. This sets the file pointer to a specific record in the file.  It is for use
  3600. with files opened by FOpen or FCreate.
  3601.  
  3602. This routine provides the same function as FSetLoc, but is a bit more
  3603. convenient for dealing with files composed of fixed-length records.
  3604.  
  3605.    FSetRec Handle%, RecSize%, RecNr%
  3606.  
  3607. Handle%    handle of the file
  3608. RecSize%   number of bytes per record
  3609. RecNr%     number of record (starting at 1)
  3610.  
  3611. Name  : FSetSize             (File Set Size)
  3612. Class : Disk
  3613. Level : DOS
  3614.  
  3615. Many people have asked how to delete information from a file.  Well, there's
  3616. no straightforward way to do it most of the time, but if the record is at the
  3617. end of the file, you can chop it right off.
  3618.  
  3619. This routine can also be used to make a file larger, perhaps pre-allocating
  3620. space that will be used later (for better speed).
  3621.  
  3622. The file in question must have been opened by FCreate or FOpen.
  3623.  
  3624.    FSetSize Handle%, Bytes&
  3625.  
  3626. Handle%    handle of the file
  3627. Bytes&     desired file size, in bytes
  3628.  
  3629. Name  : FSize                (File get Size)
  3630. Class : Disk
  3631. Level : DOS
  3632.  
  3633. This routine allows you to get the size of a file that was opened by FOpen or
  3634. FCreate.
  3635.  
  3636. See also FSize2, the FUNCTION version of this routine.
  3637.  
  3638.    FSize Handle%, Bytes&
  3639.  
  3640. Handle%    handle of the file
  3641. -------
  3642. Bytes&     file size, in bytes
  3643.  
  3644. Name  : FSize2&              (File get Size)
  3645. Class : Disk
  3646. Level : DOS
  3647.  
  3648. This routine allows you to get the size of a file that was opened by FOpen or
  3649. FCreate.
  3650.  
  3651. See also FSize, the Sub version of this routine.
  3652.  
  3653.    Bytes& = FSize2&(Handle%)
  3654.  
  3655. Handle%    handle of the file
  3656. -------
  3657. Bytes&     file size, in bytes
  3658.  
  3659.