home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / PBC23A.ZIP / PBCLONE.MAN < prev    next >
Text File  |  1994-03-14  |  431KB  |  13,095 lines

  1.        PBClone 2.3  (c) 1990-1994  Thomas G. Hanlin III
  2.  
  3. Name  : AddMatI              (Add Matrix Integer)
  4. Class : Array management
  5. Level : Any
  6.  
  7. This routine adds an integer to as many elements of an integer
  8. array as you like, starting at a specified place in the array.
  9. It can also be used to subtract (just specify a negative value).
  10. If there was a numeric overflow at any point in the operation,
  11. an error code will be returned.
  12.  
  13.    AddMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  14.  
  15. DSeg%      segment of the first array element to add
  16. DOfs%      offset of the first array element to add
  17. Elements%  number of array elements to which to add
  18. Value%     value to add to each array element
  19. -------
  20. ErrCode%   error code: 0 if no error
  21.  
  22. Name  : AddMatL              (Add Matrix Long integer)
  23. Class : Array management
  24. Level : Any
  25.  
  26. This routine adds a long integer to as many elements of an long
  27. integer array as you like, starting at a specified place in the
  28. array. It can also be used to subtract (just specify a negative
  29. value). If there was a numeric overflow at any point in the
  30. operation, an error code will be returned.
  31.  
  32.    AddMatL DSeg%, DOfs%, Elements%, Value&, ErrCode%
  33.  
  34. DSeg%      segment of the first array element to add
  35. DOfs%      offset of the first array element to add
  36. Elements%  number of array elements to which to add
  37. Value&     value to add to each array element
  38. -------
  39. ErrCode%   error code: 0 if no error
  40.  
  41. Name  : AllExtMem&           (All Extended Memory)
  42. Class : Equipment
  43. Level : Clone (AT)
  44.  
  45. This routine returns the amount of extended memory installed in
  46. the system, as reported by the power-on self-test (POST) routine
  47. at boot time. This does not tell you how much extended memory is
  48. actually available, since extended memory may be carved up by
  49. users of BIOS-level extended memory or XMS memory, converted to
  50. expanded memory, etc. It only tells you the amount of physical
  51. extended memory that is installed.
  52.  
  53. Do not use this routine on PC/XT machines. It is only for
  54. AT-class computers.
  55.  
  56.    TotalKb& = AllExtMem&
  57.  
  58. -------
  59. TotalKb&      kilobytes of extended memory installed
  60.  
  61. Name  : AltKey               (Alt Key)
  62. Class : Input
  63. Level : Any
  64.  
  65. This routine works in conjunction with a key input routine, such
  66. as INKEY$ or the CheckKey and GetKey routines. Given the ASCII
  67. code and scan code of a key, AltKey returns the associated key
  68. letter, if any. For instance, it returns "A" if you pass it
  69. ASCII code 0 and scan code 30, because those codes represent
  70. Alt-A.
  71.  
  72.    AltKey ASCIICode%, ScanCode%, Ky$
  73.  
  74. ASCIICode%   ASCII code of the key
  75. ScanCode%    scan code of the key
  76. -------
  77. Ky$          associated key letter ("" if none)
  78.  
  79. Name  : AndSt                (AND String)
  80. Class : String
  81. Level : Any
  82.  
  83. This routine ANDs each byte in one string with the corresponding
  84. byte in a second string. The strings must be the same length.
  85.  
  86.    AndSt St1$, St2$
  87.  
  88. St1$      string to AND
  89. St2$      string to AND with
  90. -------
  91. St1$      result
  92.  
  93. Name  : Any2Dec              (Any to Decimal)
  94. Class : Numeric
  95. Level : Any
  96.  
  97. This routine converts a number in any base to a normal (base 10)
  98. integer. It works like the &H and &O prefixes in BASIC, but
  99. rather than working only in hexadecimal (base 16) and octal
  100. (base 8), it can be used for binary, octal, or almost anything
  101. else. The base may range from 2-35.
  102.  
  103. The input number may be in either signed or unsigned integer
  104. form, and will be converted to a signed integer. For example,
  105. the base 16 (hexadecimal) number FFFF would be converted to -1,
  106. as would the base 10 (decimal) number 65535. This may not seem
  107. to make sense if you're not familiar with the internal format
  108. for integers, but is the standard approach to converting
  109. unsigned numbers (0-65535) to signed numbers (-32768 to 32767).
  110. BASIC always uses signed integers, so the numbers will always be
  111. what you expect so long as they are kept in the range -32768 to
  112. 32767. They "wrap around" for 32768 to 65535.
  113.  
  114. The most common bases used on computers are base 2 (binary),
  115. base 8 (octal), base 10 (decimal), and base 16 (hexadecimal).
  116.  
  117.    Any2Dec Number$, NrBase%, DecNr%, ErrCode%
  118.  
  119. Number$   any-base number to convert to an integer
  120. NrBase%   number base to convert from
  121. -------
  122. DecNr%    resulting integer
  123. ErrCode%  error code: 0 if no error
  124.  
  125. Name  : AscI%                (ASC Integer)
  126. Class : String
  127. Level : Any
  128.  
  129. This is a replacement for the ASC function provided by BASIC. It
  130. is smaller than ASC, however, and also somewhat faster.
  131.  
  132. Unlike BASIC or ProBas, the PBClone AscI function returns -1 as
  133. an error condition if you try to use it on a null string. This
  134. convention owes its origin to the similar routine in Crescent's
  135. libraries.
  136.  
  137. See also AscM%, which returns the ASCII code of a character at a
  138. specific location within a string.
  139.  
  140.    Value% = AscI%(St$)
  141.  
  142. St$        string for which to return ASCII code
  143. -------
  144. Value%     code of the first string char or -1 if null string
  145.  
  146. Name  : AscM%                (ASC MID$)
  147. Class : String
  148. Level : Any
  149.  
  150. This function works like a combination of the BASIC functions
  151. ASC and MID$. It returns the ASCII code of a character at a
  152. specified position in a string. If the specified position is
  153. outside the string, -1 will be returned.
  154.  
  155. See also AscI%, which returns the ASCII code of the character at
  156. the beginning of a string.
  157.  
  158.    Value% = AscM%(St$, Posn%)
  159.  
  160. St$        string to examine
  161. Posn%      character position to examine
  162. -------
  163. Value%     code of the specified character or -1 if error
  164.  
  165. Name  : BarMenu              (Bar Menu)
  166. Class : Input
  167. Level : Clone
  168.  
  169. This is a bar menu routine. It allows the user to select one of
  170. a list of items given on a single menu row or "bar". The current
  171. item is highlighted in your choice of colors; user selection can
  172. be done either by moving this highlight and pressing return or
  173. by entering the letter associated with the desired item. Only
  174. text mode is supported.
  175.  
  176. The highlight may be moved with the left and right arrow keys,
  177. tab and backtab, or space and backspace. Selection is done with
  178. <CR>, the enter key.
  179.  
  180. The letter used to select an item is the first character of the
  181. item that is not lowercase or a space. If the item is all
  182. lowercase, the first character of the item will be used. For
  183. example, suppose you want the user to select one of "list" or
  184. "log". By passing the options to BarMenu as "List" and "lOg",
  185. you allow the user to press "L" for "List" and "O" for "lOg".
  186.  
  187. The user's choice will be returned to you as a number, with the
  188. first choice being numbered 1. If <ESC> was pressed, 0 will be
  189. returned.
  190.  
  191.    BarMenu Pick$(), Row%, LCol%, RCol%, VAttr%, HiAttr%, Prompt$
  192.  
  193. Pick$()       list of items to choose from
  194. Row%          row on which to display the bar
  195. LCol%         leftmost column of the bar
  196. RCol%         rightmost column of the bar (use -1 for autosize)
  197. VAttr%        bar color/attribute (see CalcAttr)
  198. HiAttr%       bar highlight color/attribute (see CalcAttr)
  199. Prompt$       prompt text (displayed at left side of the bar)
  200. -------
  201. Row%          # of the chosen item (1-items, or 0 if <ESC>)
  202.  
  203. Name  : BarMenuM             (Bar Menu with Mouse)
  204. Class : Input, Mouse
  205. Level : Clone
  206.  
  207. This is a bar menu routine. It functions just like BarMenu, but
  208. supports the use of a mouse as well as the keyboard. Make sure
  209. the mouse cursor is visible before calling this routine!
  210.  
  211.    BarMenuM PickList$(), Row%, LeftCol%, RightCol%, VAttr%, _
  212.       HiAttr%, Prompt$, Mouse%, ShowCursor%
  213.  
  214. PickList$()   list of items to choose from
  215. Row%          row on which to display the bar
  216. LeftCol%      leftmost column of the bar
  217. RightCol%     rightmost column of the bar (use -1 for auto-sizing)
  218. VAttr%        bar color/attribute (see CalcAttr)
  219. HiAttr%       bar highlight color/attribute (see CalcAttr)
  220. Prompt$       prompt text (displayed at the left side of the bar)
  221. Mouse%        whether a mouse is available (0 no)
  222. ShowCursor%   not used
  223. -------
  224. Row%          number of the chosen item (1-items, or 0 if <ESC>)
  225.  
  226. Name  : Bickel               (Bickel comparison)
  227. Class : String
  228. Level : Any
  229.  
  230. A string comparison routine, Bickel allows you to see how
  231. closely two strings match. The better the match, the larger the
  232. returned value will be. Since there is no constant minimum or
  233. maximum value, this routine is best used for applications
  234. involving dictionary searches. You would scan the dictionary and
  235. make a list of the best matches. This is appropriate for a
  236. spelling checker, for instance.
  237.  
  238. See also Bickel2%, the function version of this routine.
  239.  
  240.    Bickel St1$, St2$, Result%
  241.  
  242. St1$      first string to compare
  243. St2$      second string to compare
  244. -------
  245. Result%   resulting "match magnitude" value
  246.  
  247. Name  : Bickel2%             (Bickel comparison)
  248. Class : String
  249. Level : Any
  250.  
  251. A string comparison function, Bickel2% allows you to see how
  252. closely two strings match. The better the match, the larger the
  253. returned value will be. Since there is no constant minimum or
  254. maximum value, this routine is best used for applications
  255. involving dictionary searches. You would scan the dictionary and
  256. make a list of the best matches. This is appropriate for a
  257. spelling checker, for instance.
  258.  
  259. See also Bickel, the subprogram version of this routine.
  260.  
  261.    Result% = Bickel2%(St1$, St2$)
  262.  
  263. St1$      first string to compare
  264. St2$      second string to compare
  265. -------
  266. Result%   resulting "match magnitude" value
  267.  
  268. Name  : BigPrint             (Big Print)
  269. Class : Display
  270. Level : BIOS
  271.  
  272. As the name suggests, this routine displays text in large
  273. characters. How large? Eight times as high and as wide as
  274. normal! Each "big character" will be composed of many
  275. normal-sized characters. You may choose the normal character
  276. used to create the big characters (the default is a CHR$(219)
  277. solid block character, if you pass a null string here).
  278.  
  279. You should avoid using CHR$(128) to CHR$(255) when in either of
  280. the CGA graphics modes, as many CGAs are unable to display these
  281. characters when in graphics mode.
  282.  
  283.    BigPrint St$, FormCh$, Row%, Column%, VAttr%
  284.  
  285. St$       string to display in big characters
  286. FormCh$   character used to compose the big characters
  287. Row%      starting row
  288. Column%   starting column
  289. VAttr%    color/attribute of big characters (see CalcAttr)
  290.  
  291. Name  : BinSeekD             (Binary Seek Double precision)
  292. Class : Array management
  293. Level : Any
  294.  
  295. This routine uses binary search techniques to locate a specific
  296. number in a sorted double-precision array. Each number in the
  297. array must be unique (no duplicates) for this to work. This is a
  298. very, very fast routine and is especially handy for look-up
  299. tables.
  300.  
  301. The array is expected to begin at element 1. You may specify the
  302. maximum element to search, allowing use of only part of an
  303. array.
  304.  
  305. A single number is returned in Posn%. If Posn% is greater than
  306. zero, the target number was found and Posn% is the position in
  307. the array where it was found. If Posn% is negative, the target
  308. number was not found, but it could be inserted into the array at
  309. the -Posn% element. If the number is zero, the target number was
  310. not found and there is no room in the array to add any more
  311. values.
  312.  
  313.    BinSeekD Array#(), Elements%, Target#, Posn%
  314.  
  315. Array#()    array of sorted, unique values to search
  316. Elements%   maximum array element to search
  317. Target#     value to look for
  318. -------
  319. Posn%       whether and where the target was found (see above)
  320.  
  321. Name  : BinSeekI             (Binary Seek Integer)
  322. Class : Array management
  323. Level : Any
  324.  
  325. This routine uses binary search techniques to locate a specific
  326. number in a sorted integer array. Each number in the array must
  327. be unique (no duplicates) for this to work. This is a very, very
  328. fast routine and is especially handy for look-up tables.
  329.  
  330. The array is expected to begin at element 1. You may specify the
  331. maximum element to search, allowing use of only part of an
  332. array.
  333.  
  334. A single number is returned in Posn%. If Posn% is greater than
  335. zero, the target number was found and Posn% is the position in
  336. the array where it was found. If Posn% is negative, the target
  337. number was not found, but it could be inserted into the array at
  338. the -Posn% element. If the number is zero, the target number was
  339. not found and there is no room in the array to add any more
  340. values.
  341.  
  342.    BinSeekI Array%(), Elements%, Target%, Posn%
  343.  
  344. Array%()    array of sorted, unique values to search
  345. Elements%   maximum array element to search
  346. Target%     value to look for
  347. -------
  348. Posn%       whether and where the target was found (see above)
  349.  
  350. Name  : BinSeekL             (Binary Seek Long integer)
  351. Class : Array management
  352. Level : Any
  353.  
  354. This routine uses binary search techniques to locate a specific
  355. number in a sorted long integer array. Each number in the array
  356. must be unique (no duplicates) for this to work. This is a very,
  357. very fast routine and is especially handy for look-up tables.
  358.  
  359. The array is expected to begin at element 1. You may specify the
  360. maximum element to search, allowing use of only part of an
  361. array.
  362.  
  363. A single number is returned in Posn%. If Posn% is greater than
  364. zero, the target number was found and Posn% is the position in
  365. the array where it was found. If Posn% is negative, the target
  366. number was not found, but it could be inserted into the array at
  367. the -Posn% element. If the number is zero, the target number was
  368. not found and there is no room in the array to add any more
  369. values.
  370.  
  371.    BinSeekL Array&(), Elements%, Target&, Posn%
  372.  
  373. Array&()    array of sorted, unique values to search
  374. Elements%   maximum array element to search
  375. Target&     value to look for
  376. -------
  377. Posn%       whether and where the target was found (see above)
  378.  
  379. Name  : BinSeekS             (Binary Seek Single precision)
  380. Class : Array management
  381. Level : Any
  382.  
  383. This routine uses binary search techniques to locate a specific
  384. number in a sorted single-precision array. Each number in the
  385. array must be unique (no duplicates) for this to work. This is a
  386. very, very fast routine and is especially handy for look-up
  387. tables.
  388.  
  389. The array is expected to begin at element 1. You may specify the
  390. maximum element to search, allowing use of only part of an
  391. array.
  392.  
  393. A single number is returned in Posn%. If Posn% is greater than
  394. zero, the target number was found and Posn% is the position in
  395. the array where it was found. If Posn% is negative, the target
  396. number was not found, but it could be inserted into the array at
  397. the -Posn% element. If the number is zero, the target number was
  398. not found and there is no room in the array to add any more
  399. values.
  400.  
  401.    BinSeekS Array!(), Elements%, Target!, Posn%
  402.  
  403. Array!()    array of sorted, unique values to search
  404. Elements%   maximum array element to search
  405. Target!     value to look for
  406. -------
  407. Posn%       whether and where the target was found (see above)
  408.  
  409. Name  : BinSeekSt            (Binary Seek String)
  410. Class : Array management
  411. Level : Any
  412.  
  413. This routine uses binary search techniques to locate a specific
  414. string in a sorted string array. Each string in the array must
  415. be unique (no duplicates) for this to work. This is a very, very
  416. fast routine and is especially handy for look-up tables.
  417.  
  418. The string array is expected to begin at element 1. You may
  419. specify the maximum element to search, allowing use of only part
  420. of an array. You must specify whether capitalization matters--
  421. set CapsCount% to 0 if it doesn't.
  422.  
  423. A single number is returned in Posn%. If the number is greater
  424. than zero, the target string was found, and the number is the
  425. position in the array where it was found. If the number is
  426. negative, the target string was not found, but it could be
  427. inserted into the array at the -Posn% element. If the number is
  428. zero, the target string was not found and there is no room in
  429. the array to add any more values.
  430.  
  431.    BinSeekSt Array$(), Elements%, Target$, CapsCount%, Posn%
  432.  
  433. Array$()    array of sorted, unique values to search
  434. Elements%   maximum array element to search
  435. Target$     string to look for
  436. CapsCount%  0 if capitalization doesn't matter
  437. -------
  438. Posn%       whether and where the target was found (see above)
  439.  
  440. Name  : BIOSInkey            (BIOS INKEY$)
  441. Class : Input
  442. Level : BIOS
  443.  
  444. BIOSInkey works like INKEY$, but it gets its key directly by
  445. asking the BIOS. The primary advantage of this is that you get
  446. the "scan" code as well as the ASCII code of the key. The scan
  447. code is independent of the shift status-- for instance, the scan
  448. code for "A" is the same as the scan code for "a" or Control-A
  449. or Alt-A. This can be very handy.
  450.  
  451. If there is no key available, both the scan code and ASCII code
  452. will be zero.
  453.  
  454.    BIOSInkey AscCode%, ScanCode%
  455.  
  456. -------
  457. AscCode%    ASCII code of the key, if any
  458. ScanCode%   scan code of the key, if any
  459.  
  460. Name  : BkScroll             (Backward Scroll)
  461. Class : Display
  462. Level : BIOS
  463.  
  464. This routine scrolls any selected part of the display down-- it
  465. does a backwards scroll. You may scroll as many times as you
  466. like, or scroll "zero" times to totally clear the selected part
  467. of the display.
  468.  
  469. Note that BIOS-level scrolling can cause the screen to flicker
  470. on some CGAs due to a combination of unfortunate design factors.
  471.  
  472.    BkScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  473.  
  474. TopRow%      top row of the area to scroll
  475. LeftCol%     left column of the area to scroll
  476. BottomRow%   top row of the area to scroll
  477. RightCol%    left column of the area to scroll
  478. Times%       number of times (or rows) to scroll
  479.  
  480. Name  : BkSpace              (Backspace)
  481. Class : Display
  482. Level : BIOS
  483.  
  484. Although CHR$(8) is supposed to mean "backspace", it shows up as
  485. a graphics character when BASIC prints it. This routine does an
  486. actual backspace with full wrap-- if it's at the beginning of
  487. the line, it will move back to the previous line (if there is
  488. one). It backspaces destructively (erasing the previous
  489. character) from the current cursor position. The new cursor is
  490. returned to you, since QuickBASIC may ignore the new status.
  491.  
  492.    BkSpace Row%, Column%       ' do the backspace
  493.    LOCATE Row%, Column%        ' inform QuickBASIC
  494.  
  495. -------
  496. Row%      new row
  497. Column%   new column
  498.  
  499. Name  : Blink                (Blink toggle)
  500. Class : Display
  501. Level : BIOS / Clone (see text)
  502.  
  503. It is possible to make characters in text mode blink by giving
  504. them an appropriate "color". I wouldn't mention something so
  505. obvious but for another possibility which is less widely known:
  506. blinking can be turned off, in which case the characters that
  507. would have otherwise blinked will instead have a bright
  508. background. In other words, turn off blinking, and you double
  509. the possible number of background colors.
  510.  
  511. This technique will always work with EGA and VGA displays. It
  512. can also be used with MDA/Hercules and CGA displays, on which it
  513. will almost always work... unfortunately, on some
  514. less-than-perfect PC clones, it will cause the computer to lock
  515. up instead. So, be careful with this one!
  516.  
  517.    Blink SetBlink%
  518.  
  519. SetBlink%    use blink (-1) or intense backgrounds (0)
  520.  
  521. Name  : BlockMove            (Block memory Move)
  522. Class : Memory
  523. Level : Clone
  524.  
  525. This routine allows you to copy or "move" a block of data from
  526. one memory location to another. It isn't very bright, so if the
  527. memory areas overlap, you will have to tell the routine to "move
  528. backwards" instead of forwards. In that case, you will also have
  529. to change the offsets to point to the ends of the memory areas
  530. instead of the beginnings.
  531.  
  532. Normally, you can use forward moves. In that case, the offsets
  533. you specify are those of the beginning of the memory areas. If
  534. backward moves are required, the offsets specified are those of
  535. the end of the memory areas.
  536.  
  537. If you are familiar with assembly language, you may recognize
  538. this as a straightforward implementation of the "REP MOVSB"
  539. instruction.
  540.  
  541. You may move up to 65,520 bytes at a time, provided that the
  542. addresses are in normalized form (if you don't know what this
  543. means, you probably don't need to worry about it).
  544.  
  545. This routine can be used to copy information to an array from
  546. any area of memory (the BIOS data area, the screen, another
  547. array, etc), or vice versa. It can also be used to do things
  548. like insert/delete elements from an array, scroll the screen,
  549. fill the screen with a specified character, and so on.
  550.  
  551.    BlockMove FromSeg%, FromOfs%, ToSeg%, ToOfs%, Bytes&, Dirn%
  552.  
  553. FromSeg%    segment of the area from which to copy
  554. FromOfs%    offset of the area from which to copy
  555. ToSeg%      segment of the area to which to copy
  556. ToOfs%      offset of the area to which to copy
  557. Bytes&      number of bytes to copy (0-65,520)
  558. Dirn%       direction to copy (0 if forward, else backward)
  559.  
  560. Name  : BootDrive            (get Boot Drive)
  561. Class : Disk
  562. Level : DOS
  563.  
  564. This routine tells you which drive was used to boot the system.
  565. See also BootDrive2, a function version of this routine.
  566.  
  567. One use for BootDrive would be in installation programs, to
  568. determine the most likely destination drive for your software.
  569.  
  570.    Drive$ = "x"
  571.    BootDrive Drive$
  572.  
  573. -------
  574. Drive$   boot drive-- set it to at least one char beforehand!
  575.  
  576. Name  : BootDrive2$          (get Boot Drive)
  577. Class : Disk
  578. Level : DOS
  579.  
  580. This routine tells you which drive was used to boot the system.
  581.  
  582. One use for BootDrive2 would be in installation programs, to
  583. determine the most likely destination drive for your software.
  584.  
  585.    Drive$ = BootDrive2$
  586.  
  587. -------
  588. Drive$   boot drive (null if wrong DOS version)
  589.  
  590. Name  : BoxMenu              (Box Menu)
  591. Class : Input
  592. Level : Clone
  593.  
  594. This routine displays a list of items you pass it as a string
  595. array. The list is displayed in a window in a single column. If
  596. there are more items than will fit in the window, the items may
  597. be scrolled as necessary. The user may pick a single item from
  598. the list.
  599.  
  600. Many of the usual WindowManager parameters are used here-- top
  601. row, left column, and bottom row (right column is calculated for
  602. you), window frame color and frame type, growth, shadow, title
  603. string and title color-- see the WindowManager routine for
  604. details.
  605.  
  606. If you allow using the mouse, be sure the mouse is initialized
  607. (MMCheck or MMCheck2%) and the mouse cursor is visible
  608. (MMCursorOn) before calling this routine.
  609.  
  610. This routine automatically saves and restores the underlying
  611. screen.
  612.  
  613. See CalcAttr if you're not familiar with color/attributes. See
  614. also BoxMenu1 if you need to allow multiple selections.
  615.  
  616.    BoxMenu Mouse%, PickList$(), TopRow%, LeftCol%, _
  617.       BottomRow%, Frame%, FrameAttr%, ItemListAttr%, _
  618.       HiliteAttr%, TitleFore%, Title$, Grow%, Shade%, Result%
  619.  
  620. Mouse%          whether to support the mouse (0 no, -1 yes)
  621. PickList$()     items to pick from (starting at PickList$(1))
  622. TopRow%         top row of pick window
  623. LeftCol%        left column of pick window
  624. BottomRow%      bottom row of pick window
  625. Frame%          frame type
  626. FrameAttr%      frame color/attribute
  627. ItemListAttr%   item list color/attribute
  628. HiliteAttr%     highlight bar color/attribute
  629. TitleFore%      title foreground color (backgnd is frame color)
  630. Title$          title (use "" for no title)
  631. Grow%           window growth
  632. Shade%          window shadow
  633. -------
  634. Result%         number of item picked (0 if none)
  635.  
  636. Name  : BoxMenu1             (Box Menu variant 1)
  637. Class : Input
  638. Level : Clone
  639.  
  640. This routine displays a list of items you pass it as a string
  641. array. The list is displayed in a window in a single column. If
  642. there are more items than will fit in the window, the items may
  643. be scrolled as necessary. The user may pick multiple items from
  644. the list, using the space bar to toggle selection. All items may
  645. be selected with Ctrl-Enter, or deselected with Ctrl-Backspace.
  646.  
  647. Many of the usual WindowManager parameters are used here-- top
  648. row, left column, and bottom row (right column is calculated for
  649. you), window frame color and frame type, growth, shadow, title
  650. string and title color-- see the WindowManager routine for
  651. details.
  652.  
  653. If you allow using the mouse, be sure the mouse is initialized
  654. (MMCheck or MMCheck2%) and the mouse cursor is visible
  655. (MMCursorOn) before calling this routine.
  656.  
  657. BoxMenu1 automatically saves and restores the underlying screen.
  658.  
  659. See CalcAttr if you're not familiar with color/attributes. See
  660. also BoxMenu if you only need single-item selection.
  661.  
  662. You must pass an integer array corresponding to the pick list
  663. array. Each of the integers flags whether the corresponding item
  664. is picked-- 0 if no, -1 if yes. You may initialize this array
  665. according to the selection defaults you prefer.
  666.  
  667. The Marker$ value is two characters which specify the left and
  668. right characters to use to mark an item as selected. If you
  669. leave Marker$ = "", the default will be "<>".
  670.  
  671.    BoxMenu1 Mouse%, PickList$(), Picked%(), Marker$, TopRow%, _
  672.       LeftCol%, BottomRow%, Frame%, FrameAttr%, _
  673.       ItemListAttr%, HiliteAttr%, TitleFore%, Title$, Grow%, _
  674.       Shade%, Picks%
  675.  
  676. Mouse%          whether to support the mouse (0 no, -1 yes)
  677. PickList$()     items to pick from (starting at PickList$(1))
  678. Picked%()       if corresponding PickList$() item is picked
  679. Marker$         left and right pick markers ("" for default)
  680. TopRow%         top row of pick window
  681. LeftCol%        left column of pick window
  682. BottomRow%      bottom row of pick window
  683. Frame%          frame type
  684. FrameAttr%      frame color/attribute
  685. ItemListAttr%   item list color/attribute
  686. HiliteAttr%     highlight bar color/attribute
  687. TitleFore%      title foreground color (backgnd is frame color)
  688. Title$          title (use "" for no title)
  689. Grow%           window growth
  690. Shade%          window shadow
  691. -------
  692. Picked%()       if corresponding PickList$() item is picked
  693. Picks%          number of items picked (0 if none)
  694.  
  695. Name  : BRead                (Byte Read)
  696. Class : Disk
  697. Level : DOS
  698.  
  699. This routine reads a byte from a file into an integer. The byte
  700. is zero-extended into the integer, providing a value that may
  701. range from 0-255.
  702.  
  703. The file must have been opened using FCreate or FOpen1.
  704.  
  705.    BRead Handle%, Value%, ErrCode%
  706.  
  707. Handle%    file handle
  708. -------
  709. Value%     byte read from file
  710. ErrCode%   DOS error code (0 if no error)
  711.  
  712. Name  : BreakCheck%          (Break key Check)
  713. Class : Input
  714. Level : BIOS
  715.  
  716. This routine is for use after BreakOff. It allows you to see
  717. whether the Break key has been pressed since you last checked.
  718. The Break status is cleared after the value is returned.
  719.  
  720.    Brk% = BreakCheck%
  721.    IF Brk% THEN
  722.       PRINT "** Break key pressed **"
  723.       GOTO EndProgram
  724.    END IF
  725.  
  726. -------
  727. Brk%    whether Break was pressed (0 no, -1 yes)
  728.  
  729. Name  : BreakOff             (Break key Off)
  730. Class : Input
  731. Level : BIOS
  732.  
  733. This routine disables the Break key. It is not effective in the
  734. QB or QBX environments, as these use their own keyboard handler.
  735. It is also not effective if your program was compiled with
  736. Debugging on (/D switch).
  737.  
  738. Note that BreakOff installs a routine to intercept some
  739. interrupt vectors. You MUST use the BreakOffDone routine to
  740. reverse this process before your program ends, or the computer
  741. will be left in an indeterminate state and will probably crash
  742. the next time Break is pressed!
  743.  
  744.    BreakOff
  745.  
  746. Name  : BreakOffDone         (Break key Off routine Done)
  747. Class : Input
  748. Level : BIOS
  749.  
  750. This routine is used after BreakOff to restore the original
  751. interrupt vectors. If you use BreakOff, you MUST call
  752. BreakOffDone before your program ends! Otherwise, the computer
  753. will probably crash the next time someone presses Break.
  754.  
  755.    BreakOffDone
  756.  
  757. Name  : BSq                  (Blank Squeeze)
  758. Class : String
  759. Level : Any
  760.  
  761. A simple compression routine, BSq "squeezes" the blank spaces in
  762. a string. It is designed expressly for use with text data. The
  763. text may not contain more than 131 spaces in a row, or CHR$(128)
  764. through CHR$(255), which are used in the compression.
  765.  
  766. Average text files are liable to be compressed by around 16%.
  767. Files that contain more spaces, such as structured programs,
  768. will benefit more. The compression algorithm is simple but
  769. extremely fast, adding no noticeable overhead to string
  770. processing.
  771.  
  772. See also BUsq, BUsqLen.
  773.  
  774.    BSq St$, StLen%
  775.    St$ = LEFT$(St$, StLen%)
  776.  
  777. St$     string to compress
  778. -------
  779. St$     compressed string
  780. StLen%  length of the compressed string
  781.  
  782. Name  : BUsq                 (Blank Unsqueeze)
  783. Class : String
  784. Level : Any
  785.  
  786. This routine is used to uncompress strings that were processed
  787. by BSq. Before uncompression, the BUsqLen routine must be used
  788. to find out how long the resulting string will be.
  789.  
  790. See also BSq, BUsqLen.
  791.  
  792.    BUsqLen St$, StLen%
  793.    IF StLen% < 0 THEN
  794.       PRINT "Error in compressed string"
  795.    ELSE
  796.       Result$ = SPACE$(StLen%)
  797.       BUsq St$, Result$
  798.    END IF
  799.  
  800. St$      string to uncompress
  801. -------
  802. Result$  uncompressed string
  803.  
  804. Name  : BUsqLen              (Blank Unsqueeze Length)
  805. Class : String
  806. Level : Any
  807.  
  808. This routine is used in coordination with BUsq to uncompress
  809. strings that were processed by BSq. It determines what the
  810. length of the uncompressed string will be, which is necessary to
  811. initialize the string for BUsq.
  812.  
  813. See also BSq, BUsq.
  814.  
  815.    BUsqLen St$, StLen%
  816.    IF StLen% < 0 THEN
  817.       PRINT "Error in compressed string"
  818.    ELSE
  819.       Result$ = SPACE$(StLen%)
  820.       BUsq St$, Result$
  821.    END IF
  822.  
  823. St$      string to uncompress
  824. -------
  825. StLen%   length of the uncompressed string
  826.  
  827. Name  : BWrite               (Byte Write)
  828. Class : Disk
  829. Level : DOS
  830.  
  831. This routine writes a byte to a file from an integer. The least
  832. significant byte of the integer is written.
  833.  
  834. The file must have been opened using FCreate or FOpen1.
  835.  
  836.    BWrite Handle%, Value%, ErrCode%
  837.  
  838. Handle%    file handle
  839. Value%     byte to write to file
  840. -------
  841. ErrCode%   DOS error code (0 if no error)
  842.  
  843. Name  : CalcAttr             (Calculate Attribute)
  844. Class : Display
  845. Level : Any
  846.  
  847. Many of the display routines in this library require an
  848. "attribute" rather than foreground and background colors. An
  849. attribute is a combination of the foreground and background
  850. colors in a format which is used by all types of displays when
  851. in text mode.
  852.  
  853. Foreground colors are usually specified as 0-31, with
  854. backgrounds as 0-7. If you turn blinking off (see Blink), it may
  855. be more convenient to express the same thing as foreground 0-15,
  856. background 0-15. The CalcAttr routine will accept either way of
  857. expressing it.
  858.  
  859. Note, however, that UnCalcAttr will always return the former
  860. pair of results, since it has no way of knowing whether Blink
  861. has been used (foreground 0-31, background 0-15). See UnCalcAttr
  862. for more details and a solution.
  863.  
  864. See also CalcAttr2, the FUNCTION version of this routine.
  865.  
  866.    CalcAttr Foreground%, Background%, VAttr%
  867.  
  868. Foreground%  foreground color
  869. Background%  background color
  870. -------
  871. VAttr%       color "attribute"
  872.  
  873. Name  : CalcAttr2%           (Calculate Attribute)
  874. Class : Display
  875. Level : Any
  876.  
  877. Many of the display routines in this library require an
  878. "attribute" rather than foreground and background colors. An
  879. attribute is a combination of the foreground and background
  880. colors in a format which is used by all types of displays when
  881. in text mode.
  882.  
  883. Foreground colors are usually specified as 0-31, with
  884. backgrounds as 0-7. If you turn blinking off (see Blink), it may
  885. be more convenient to express the same thing as foreground 0-15,
  886. background 0-15. The CalcAttr2 routine will accept either way of
  887. expressing it.
  888.  
  889. Note, however, that UnCalcAttr will always return the former
  890. pair of results, since it has no way of knowing whether Blink
  891. has been used (foreground 0-31, background 0-15). See UnCalcAttr
  892. for more details and a solution.
  893.  
  894. See also CalcAttr, the SUB version of this routine.
  895.  
  896.    VAttr% = CalcAttr2%(Foreground%, Background%)
  897.  
  898. Foreground%  foreground color
  899. Background%  background color
  900. -------
  901. VAttr%       color "attribute"
  902.  
  903. Name  : CalcDate             (Calculate Date)
  904. Class : Time
  905. Level : Any
  906.  
  907. This routine calculates what the date will be a given number of
  908. days from now, either in the past or the future. Actually, you
  909. may use any starting date, not just the current date. An error
  910. code is returned if the starting date or resulting date are not
  911. valid. Dates may not preceed January 1, 1900.
  912.  
  913. CalcDate accepts the date in any standard form ("01/30/91" or
  914. "01-30-1991", for example) and returns its results in the same
  915. format.
  916.  
  917.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  918.  
  919. StartDate$   starting date
  920. Days&        number of days from the current date (0 or more)
  921. Direction%   return future result (0) or past (nonzero)
  922. -------
  923. NewDate$     resulting date
  924. ErrCode%     whether the dates are valid (0 yes)
  925.  
  926. Name  : CalcSize             (Calculate array Size)
  927. Class : Display
  928. Level : Any
  929.  
  930. This routine calculates the necessary DIM size for an integer
  931. array, assuming that you intend to store display data in the
  932. array. This is most useful in conjunction with DGetScreen and
  933. GetScreen.
  934.  
  935.    CalcSize TopRow%, LeftCol%, BottomRow%, RightCol%, Elements%
  936.    DIM Array%(1 TO Elements%)
  937.  
  938. TopRow%      top row of the display area
  939. LeftCol%     left column of the display area
  940. BottomRow%   top row of the display area
  941. RightCol%    left column of the display area
  942. -------
  943. Elements%    required size of the integer array
  944.  
  945. Name  : CalcVGAColor         (Calculate VGA palette Color)
  946. Class : Display
  947. Level : Any
  948.  
  949. The QuickBASIC manual gives a cumbersome formula for calculating
  950. VGA palette colors. This routine does it faster and with less
  951. fuss. All you need to do is pass it the appropriate intensity
  952. values (0-63) and you get back a long integer, just the way
  953. BASIC wants it.
  954.  
  955.    CalcVGAColor Red%, Green%, Blue%, Colour&
  956.  
  957. Red%      red   intensity
  958. Green%    green intensity
  959. Blue%     blue  intensity
  960. -------
  961. Colour&   color value for use in the PALETTE statement
  962.  
  963. Name  : Carrier              (detect Carrier)
  964. Class : Serial
  965. Level : Clone
  966.  
  967. If you write communications programs, particularly things like
  968. doors and BBSes, you probably want to keep an eye on the
  969. carrier. BASIC won't do it, but we will!
  970.  
  971.    Carrier CommPort%, CarrierHigh%
  972.  
  973. CommPort%     serial port (1-4, though BASIC only handles 1-2)
  974. -------
  975. CarrierHigh%  zero if no carrier
  976.  
  977. Name  : CatchError           (Catch Error from SHELL)
  978. Class : Miscellaneous
  979. Level : Clone
  980.  
  981. NOTE: You should use the GetError2% function in preference to
  982. this set of routines.
  983.  
  984. The CatchError routine is used in conjunction with GetError. It
  985. lets you get the exit code (error level) returned by a program
  986. to which you have SHELLed. Since CatchError hooks an interrupt
  987. to do its work, you must always make sure to use GetError
  988. afterwards to "clean up". See also GetError.
  989.  
  990. Note that differences in DOS mean that this routine will not
  991. always work. In some versions of DOS, you can only get the error
  992. level if a batch file was executed; in others, you can't get the
  993. error level from a batch file at all. Sorry about that. I don't
  994. know of any way to work around it.
  995.  
  996.    CatchError
  997.    SHELL ProgramName$
  998.    GetError ExitCode%
  999.  
  1000. Name  : CDROM                (check for CD-ROM)
  1001. Class : Disk / Equipment
  1002. Level : DOS
  1003.  
  1004. This routine tells you whether the Microsoft CD-ROM Extensions
  1005. are installed. If so, it tells you what the letter of the first
  1006. CD-ROM logical drive is and how many logical drives exist.
  1007.  
  1008. Note: The CD-ROM installation check conflicts with the
  1009. GRAPHICS.COM installation check for DOS 4.0, due to some
  1010. screw-up at IBM or Microsoft. This may cause unexpected results.
  1011.  
  1012.    FirstDrive$ = "x"
  1013.    CDROM FirstDrive$, Drives%
  1014.  
  1015. -------
  1016. FirstDrive$   letter of first logical drive (init to >= 1 char)
  1017. Drives%       number of logical drives (0 if no CD-ROM)
  1018.  
  1019. Name  : CDROM2%              (check for CD-ROM)
  1020. Class : Disk / Equipment
  1021. Level : DOS
  1022.  
  1023. This routine tells you whether the Microsoft CD-ROM Extensions
  1024. are installed. If so, it tells you how many logical drives
  1025. exist.
  1026.  
  1027. Note: The CD-ROM installation check conflicts with the
  1028. GRAPHICS.COM installation check for DOS 4.0, due to some
  1029. screw-up at IBM or Microsoft. This may cause unexpected results.
  1030.  
  1031.    Drives% = CDROM2%
  1032.  
  1033. -------
  1034. Drives%       number of logical drives (0 if no CD-ROM)
  1035.  
  1036. Name  : CeilD#               (Ceiling, Double-precision)
  1037. Class : String
  1038. Level : Any
  1039.  
  1040. This function returns the smallest integer greater than or equal
  1041. to the number you give it. This is most often used for rounding.
  1042.  
  1043.    Result# = CeilD#(Nr#)
  1044.  
  1045. Nr#          number to process
  1046. -------
  1047. Result#      result
  1048.  
  1049. Name  : CeilS!               (Ceiling, Single-precision)
  1050. Class : String
  1051. Level : Any
  1052.  
  1053. This function returns the smallest integer greater than or equal
  1054. to the number you give it. This is most often used for rounding.
  1055.  
  1056.    Result! = CeilS!(Nr!)
  1057.  
  1058. Nr!          number to process
  1059. -------
  1060. Result!      result
  1061.  
  1062. Name  : CenterSt$            (Center String)
  1063. Class : String
  1064. Level : Any
  1065.  
  1066. This function returns a string centered in a field of spaces.
  1067.  
  1068.    Result$ = CenterSt$(StToCenter$, Columns%)
  1069.  
  1070. StToCenter$   string to center
  1071. Columns%      width of field in which to center string
  1072. -------
  1073. Result$       field of spaces with string centered in it
  1074.  
  1075. Name  : CheckCAS%            (Check CAS driver)
  1076. Class : Serial
  1077. Level : BIOS
  1078.  
  1079. This function tells you whether a CAS driver is installed. CAS
  1080. is the DCA/Intel "Communicating Applications Specification"
  1081. (apparently named by someone whose prolonged wearing of ties cut
  1082. off the flow of blood to his brain) used by a number of
  1083. faxmodems. CheckCAS% returns -1 if CAS is available, 0 if not.
  1084.  
  1085.    CAS% = CheckCAS%
  1086.  
  1087. -------
  1088. CAS%        whether a CAS driver is installed (0 no, -1 yes)
  1089.  
  1090. Name  : CheckDate            (Check Date validity)
  1091. Class : Time
  1092. Level : Any
  1093.  
  1094. This routine checks a date to see if it is valid.
  1095.  
  1096.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  1097.  
  1098. MonthNr%     month number (1-12)
  1099. DayNr%       day number (1-31)
  1100. YearNr%      year number (1900 on; years <100 assumed 1900s)
  1101. -------
  1102. ErrCode%     whether the date is valid (0 yes)
  1103.  
  1104. Name  : CheckDisk            (Check Disk readiness)
  1105. Class : Disk
  1106. Level : DOS
  1107.  
  1108. The CheckDisk routine determines whether a disk is ready. About
  1109. the only thing it won't tell you is if a disk is write-protected
  1110. or out of space. Since the PBClone disk routines all contain
  1111. critical error handling, which reports back an appropriate error
  1112. code for all such problems, this routine isn't really needed any
  1113. more. It's included for compatibility with old ProBas programs.
  1114.  
  1115. Results will normally be returned as one of the following,
  1116. although not all DOS versions report the exact cause of the
  1117. error, in which case the error number may not mean what you
  1118. expect.
  1119.  
  1120.    0   no error
  1121.    1   unformatted disk
  1122.    2   open drive door
  1123.    3   bad drive spec
  1124.  
  1125.    CheckDisk Drive$, ErrCode%
  1126.  
  1127. Drive$    letter of the drive to check
  1128. -------
  1129. ErrCode%  0 if no error, nonzero for error (see above)
  1130.  
  1131. Name  : CheckDsk%            (Check Disk readiness)
  1132. Class : Disk
  1133. Level : DOS
  1134.  
  1135. The CheckDsk% function determines whether a disk is ready. About
  1136. the only thing it won't tell you is if a disk is write-protected
  1137. or out of space. Since the PBClone disk routines all contain
  1138. critical error handling, which reports back an appropriate error
  1139. code for all such problems, this routine isn't really needed any
  1140. more. It's included for compatibility with old ProBas programs.
  1141.  
  1142. Note that DOS versions before 3.0 do not return as useful error
  1143. codes as later versions. Under such circumstances, both
  1144. "unformatted disk" and "open drive door" will be returned as
  1145. "open drive door".
  1146.  
  1147.    ErrCode% = CheckDsk%(Drive$)
  1148.  
  1149. Drive$    letter of the drive to check
  1150.  
  1151. Name  : CheckKey             (Check for Key or mouse)
  1152. Class : Input, Mouse
  1153. Level : BIOS
  1154.  
  1155. This routine is kind of an extended version of INKEY$. It checks
  1156. the keyboard to see if any key is available and gets the key if
  1157. it is. At your option, it can also check the mouse to see if a
  1158. button has been pressed.
  1159.  
  1160.    CheckKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  1161.  
  1162. Mouse%        whether to check the mouse (0: no)
  1163. -------
  1164. ASCIIcode%    ASCII code of the key pressed
  1165. ScanCode%     scan code of the key pressed (0 if none)
  1166. LButton%      whether the left  mouse button was pressed
  1167. RButton%      whether the right mouse button was pressed
  1168.  
  1169. Name  : CheckKey3            (Check for Key or 3-button mouse)
  1170. Class : Input, Mouse
  1171. Level : BIOS
  1172.  
  1173. This routine is kind of an extended version of INKEY$. It checks
  1174. the keyboard to see if any key is available and gets the key if
  1175. it is. At your option, it can also check the mouse to see if a
  1176. button has been pressed.
  1177.  
  1178.    CheckKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  1179.       MButton%, RButton%
  1180.  
  1181. Mouse%        whether to check the mouse (0: no)
  1182. -------
  1183. ASCIIcode%    ASCII code of the key pressed
  1184. ScanCode%     scan code of the key pressed (0 if none)
  1185. LButton%      whether the left   mouse button was pressed
  1186. MButton%      whether the middle mouse button was pressed
  1187. RButton%      whether the right  mouse button was pressed
  1188.  
  1189. Name  : CheckShare           (Check for SHARE)
  1190. Class : Disk
  1191. Level : DOS
  1192.  
  1193. The CheckShare routine determines whether SHARE.EXE is active.
  1194. This is particularly helpful before using the BASIC OPEN
  1195. statement, which will fail if you request file sharing when it's
  1196. not available. The PBClone file routines handle such situations
  1197. automatically, so CheckShare is not needed for them.
  1198.  
  1199.    CheckShare ShareActive%
  1200.  
  1201. -------
  1202. ShareActive%   whether SHARE is active (0 if no)
  1203.  
  1204. Name  : CheckShare2%         (Check for SHARE)
  1205. Class : Disk
  1206. Level : DOS
  1207.  
  1208. The CheckShare2% function determines whether SHARE.EXE is
  1209. active. This is particularly helpful before using the BASIC OPEN
  1210. statement, which will fail if you request file sharing when it's
  1211. not available. The PBClone file routines handle such situations
  1212. automatically, so CheckShare2% is not needed for them.
  1213.  
  1214.    ShareActive% = CheckShare2%
  1215.  
  1216. -------
  1217. ShareActive%   whether SHARE is active (0 if no)
  1218.  
  1219. Name  : Checksum             (calculate Checksum)
  1220. Class : Serial
  1221. Level : Any
  1222.  
  1223. The Checksum routine calculates a checksum on a string. The
  1224. resulting number is compatible with Xmodem and Ymodem checksum
  1225. routines and will vary from 0-255. This checksum provides a
  1226. minimal, but fast, check of what characters are contained in the
  1227. string. See also Checksum2%, the function version of this
  1228. routine, and CRC1.
  1229.  
  1230.    Checksum St$, ChkSum%
  1231.  
  1232. St$       string to process
  1233. -------
  1234. ChkSum%   checksum of the characters in the string
  1235.  
  1236. Name  : Checksum2%           (calculate Checksum)
  1237. Class : Serial
  1238. Level : Any
  1239.  
  1240. The Checksum2% function calculates a checksum on a string. The
  1241. resulting number is compatible with Xmodem and Ymodem checksum
  1242. routines and will vary from 0-255. This checksum provides a
  1243. minimal, but fast, check of what characters are contained in the
  1244. string. See also Checksum, the sub version of this function, and
  1245. CRC1.
  1246.  
  1247.    ChkSum% = Checksum2% (St$)
  1248.  
  1249. St$       string to process
  1250. -------
  1251. ChkSum%   checksum of the characters in the string
  1252.  
  1253. Name  : Cipher               (Cipher)
  1254. Class : String
  1255. Level : Any
  1256.  
  1257. This is a very simple text encryption routine. It isn't
  1258. particularly hard to crack, but will provide a basic level of
  1259. security for undemanding applications. The same routine can be
  1260. used either to encrypt or decrypt text. The original text may
  1261. contain any character; likewise, the resulting text. This is not
  1262. well suited for use with sequential files-- if such is required,
  1263. see CipherP.
  1264.  
  1265. I'd suggest using a long password composed of an unlikely string
  1266. of characters, e.g. "#*@@!A^%x{.'".
  1267.  
  1268.    Cipher St$, Password$
  1269.  
  1270. St$        string to encrypt or decrypt
  1271. Password$  password
  1272. -------
  1273. St$        encrypted or decrypted string
  1274.  
  1275. Name  : CipherP              (Cipher Printable)
  1276. Class : String
  1277. Level : Any
  1278.  
  1279. This is a very simple text encryption routine. It isn't
  1280. particularly hard to crack, but will provide a basic level of
  1281. security for undemanding applications. The same routine can be
  1282. used either to encrypt or decrypt text. The original text may
  1283. contain any character below CHR$(128), as may the password. The
  1284. resulting text will be printable, if bizarre (all characters
  1285. will be above CHR$(127)), and may be used with sequential files.
  1286.  
  1287. This routine is potentially less secure than the Cipher routine
  1288. (see).
  1289.  
  1290. I'd suggest using a long password composed of an unlikely string
  1291. of characters, e.g. "#*@@!A^%x{.'".
  1292.  
  1293.    CipherP St$, Password$
  1294.  
  1295. St$        string to encrypt or decrypt
  1296. Password$  password
  1297. -------
  1298. St$        encrypted or decrypted string
  1299.  
  1300. Name  : ClearArea            (Clear a screen Area)
  1301. Class : Display
  1302. Level : Clone
  1303.  
  1304. This routine clears an area of the screen to a specified color.
  1305. The clearing is done by removing random characters until the
  1306. area is totally clear.
  1307.  
  1308.    ClearArea TRow%, LCol%, BRow%, RCol%, VAttr%, Fast%
  1309.  
  1310. TRow%       top row of area to clear
  1311. LCol%       left column of area to clear
  1312. BRow%       bottom row of area to clear
  1313. RCol%       right column of area to clear
  1314. VAttr%      color/attribute to clear to
  1315. Fast%       whether to use fast displays (0 no)
  1316.  
  1317. Name  : Clock                (Clock)
  1318. Class : Display / Time
  1319. Level : Clone
  1320.  
  1321. This routine allows you to turn a visible time display on or
  1322. off. When on, the time will be continuously displayed at a
  1323. selected location while your program continues processing. The
  1324. clock is managed as a background process, in effect doing some
  1325. simple multitasking.
  1326.  
  1327. You should turn the clock off before you terminate your program,
  1328. including any time you execute another program with RUN. The
  1329. clock can be safely kept on when you SHELL to another program,
  1330. however, as long as you can be sure that control will return to
  1331. your program when the other is done.
  1332.  
  1333. The clock must also be turned off if you change any of its
  1334. parameters with the ClockSet routine (see).
  1335.  
  1336. The clock will only be visible when the display is in text mode.
  1337. The use of PLAY or SOUND statements may shut off the clock,
  1338. depending on your version of the BASIC compiler.
  1339.  
  1340.    Clock DisplayOn%
  1341.  
  1342. DisplayOn%   whether to display the clock (0 if no)
  1343.  
  1344. Name  : ClockSet             (Clock Settings)
  1345. Class : Display / Time
  1346. Level : Clone
  1347.  
  1348. The ClockSet routine is used in conjunction with Clock (see). It
  1349. should only be used when the clock is turned off.
  1350.  
  1351. This routine allows you to set 12-hour or 24-hour time, whether
  1352. to display the seconds or not, how often to update the clock
  1353. display (in 1/18th seconds; 9 is usually the best choice), where
  1354. to display the clock and in what color, and whether to use
  1355. flicker-free displays (needed for cheap CGAs only). The defaults
  1356. are 12-hour time, display seconds, put the time (in white on
  1357. black) in the upper right corner, and display quickly (may
  1358. flicker on some CGAs).
  1359.  
  1360.    ClockSet Hours24%, Seconds%, Updates%, Row%, Column%, _
  1361.       VAttr%, Fast%
  1362.  
  1363. Hours24%   whether to display 24-hour time (0 if no)
  1364. Seconds%   whether to display seconds (0 if no)
  1365. Updates%   display update frequency in 1/18th seconds
  1366. Row%       row on which to display the clock
  1367. Col%       column at which to display the clock
  1368. VAttr%     color/attribute to use (see CalcAttr)
  1369. Fast%      whether to use fast mode (0 no)
  1370.  
  1371. Name  : CloseA               (Close Archive)
  1372. Class : Disk / Time
  1373. Level : DOS
  1374.  
  1375. This routine closes an archive opened by FindFirstA or
  1376. FindNextA. It must be used when you are done searching the
  1377. archive.
  1378.  
  1379. Routines in this series include:
  1380.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  1381.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  1382.  
  1383.    CloseA
  1384.  
  1385. Name  : ClrCols              (Clear Columns)
  1386. Class : Display
  1387. Level : BIOS
  1388.  
  1389. This routine clears the current row between the specified
  1390. columns, inclusive. It does not affect the cursor position.
  1391.  
  1392.    ClrCols StartCol%, EndCol%
  1393.  
  1394. StartCol%  starting column
  1395. EndCol%    ending column
  1396.  
  1397. Name  : ClrEOL               (Clear to End Of Line)
  1398. Class : Display
  1399. Level : BIOS
  1400.  
  1401. This routine clears from the cursor to the end of the line,
  1402. inclusive. It does not affect the current cursor position.
  1403.  
  1404.    ClrEOL
  1405.  
  1406. Name  : ClrEOP               (Clear to End Of Page)
  1407. Class : Display
  1408. Level : BIOS
  1409.  
  1410. This routine clears from the cursor to the end of the display,
  1411. inclusive. It does not affect the current cursor position.
  1412.  
  1413.    ClrEOP
  1414.  
  1415. Name  : ClrKbd               (Clear Keyboard buffer)
  1416. Class : Input
  1417. Level : DOS
  1418.  
  1419. ClrKbd clears the keyboard buffer, discarding any keys that may
  1420. be waiting. This is a good idea for situations where an
  1421. unexpected input is made and you don't want to chance it being
  1422. answered accidentally by keys that were typed beforehand-- for
  1423. instance, in the event of an error or other condition where it
  1424. is important that the user see a message or take an action
  1425. before pressing a key.
  1426.  
  1427.    ClrKbd
  1428.  
  1429. Name  : ClrSOL               (Clear to Start Of Line)
  1430. Class : Display
  1431. Level : BIOS
  1432.  
  1433. This routine clears from the start of the line to the cursor,
  1434. inclusive. It does not affect the current cursor position.
  1435.  
  1436.    ClrSOL
  1437.  
  1438. Name  : ClrSOP               (Clear to Start Of Page)
  1439. Class : Display
  1440. Level : BIOS
  1441.  
  1442. This routine clears from the start of the display to the cursor,
  1443. inclusive. It does not affect the current cursor position.
  1444.  
  1445.    ClrSOP
  1446.  
  1447. Name  : Command2$            (Command line)
  1448. Class : Miscellaneous
  1449. Level : DOS
  1450.  
  1451. This function returns the original DOS command line. It works
  1452. like COMMAND$, but does not trim or capitalize the command line.
  1453.  
  1454. The area in which the command line is stored may be recycled for
  1455. other purposes, so you should use Command2$ as near to the start
  1456. of your program as possible.
  1457.  
  1458. NOTE that this function returns the actual command line. If you
  1459. use it in the editor/environment, it will return the command
  1460. line you used to start QB/QBX/VB-DOS, rather than any imitation
  1461. command line you installed while in the editor. The BASIC
  1462. editor/environment does not set the actual command line with
  1463. your choice, unfortunately-- it fakes out COMMAND$ instead. It
  1464. is not able to fool Command2$ in the same way.
  1465.  
  1466.    CmdLine$ = Command2$
  1467.  
  1468. -------
  1469. CmdLine$    original DOS command line
  1470.  
  1471. Name  : CopyFile             (Copy a File)
  1472. Class : Disk
  1473. Level : DOS
  1474.  
  1475. This works like the DOS COPY command, although it does not allow
  1476. wildcards. One file is copied to another, retaining the same
  1477. date and time. Full path specifications are supported, including
  1478. drive and subdirectory specs.
  1479.  
  1480. See also FileCopy, which supports wildcards.
  1481.  
  1482.    CopyFile FromFile$, ToFile$, ErrCode%
  1483.  
  1484. FromFile$   name of file to copy
  1485. ToFile$     name of new file to create
  1486. -------
  1487. ErrCode%    0 if no error, else DOS Error
  1488.  
  1489. Name  : CPrintScreen1        (CGA Print Screen [SCREEN 1])
  1490. Class : Display / Printer
  1491. Level : Clone
  1492.  
  1493. This routine dumps a SCREEN 1 display (CGA 320x200) to the
  1494. printer. It uses the stdprn device (normally PRN or LPT1) by
  1495. default, although this can be altered with the PrtSwap routine.
  1496.  
  1497.    CPrintScreen1
  1498.  
  1499. Name  : CPrintScreen2        (CGA Print Screen [SCREEN 2])
  1500. Class : Display / Printer
  1501. Level : Clone
  1502.  
  1503. This routine dumps a SCREEN 2 display (CGA 640x200) to the
  1504. printer. It uses the stdprn device (normally PRN or LPT1) by
  1505. default, although this can be altered with the PrtSwap routine.
  1506.  
  1507.    CPrintScreen2
  1508.  
  1509. Name  : CPUSpeed%            (CPU Speed)
  1510. Class : Equipment
  1511. Level : Clone
  1512.  
  1513. This function returns the approximate CPU speed in MHz. It may
  1514. take several seconds to find the speed of slower processors, so
  1515. don't expect an immediate response. Results can be skewed by
  1516. multitasking and background processing.
  1517.  
  1518.    MHz% = CPUSpeed%
  1519.  
  1520. -------
  1521. MHz%       approximate CPU speed
  1522.  
  1523. Name  : CRC                  (calculate CRC)
  1524. Class : String / Serial
  1525. Level : Any
  1526.  
  1527. This routine has become obsolete; the CRC1 routine is much
  1528. faster. However, CRC is still included for backwards
  1529. compatibility.
  1530.  
  1531. This routine calculates a complex 16-bit checksum, called a
  1532. Cyclical Redundancy Check (or CRC) on a string. The results are
  1533. compatible with Xmodem and Ymodem CRC routines. The CRC provides
  1534. a fairly reliable check of what characters are contained in the
  1535. string. See also Checksum.
  1536.  
  1537. If you are using this routine for Xmodem or Ymodem, note that
  1538. the string should be padded with two null characters before
  1539. calculating a "send" CRC: St$ = St$ + STRING$(2, 0). On receive,
  1540. you should calculate the CRC on the entire data block, plus the
  1541. received CRC; if the block was received correctly, the
  1542. calculated CRC will be zero in both lsb and msb.
  1543.  
  1544. Although Intel notation uses "lsb, msb" order, the Xmodem/Ymodem
  1545. CRC uses the opposite format, which is why the parameters are
  1546. ordered in this fashion.
  1547.  
  1548.    CRC St$, CRCmsb%, CRClsb%
  1549.  
  1550. St$       string to process
  1551. -------
  1552. CRCmsb%   most significant byte of CRC
  1553. CRClsb%   least significant byte of CRC
  1554.  
  1555. Name  : CRC1                 (calculate CRC)
  1556. Class : String / Serial
  1557. Level : Any
  1558.  
  1559. This routine calculates a complex 16-bit checksum, called a
  1560. Cyclical Redundancy Check (or CRC) on a string. The results are
  1561. compatible with Xmodem and Ymodem CRC routines. The CRC provides
  1562. a fairly reliable check of what characters are contained in the
  1563. string. See also Checksum.
  1564.  
  1565. Note that CRC1 does not work like the older CRC routine. You
  1566. should not pad outgoing strings with a STRING$(2, 0) sequence.
  1567.  
  1568. Although Intel notation uses "lsb, msb" order, the Xmodem/Ymodem
  1569. CRC uses the opposite format, which is why the parameters are
  1570. ordered in this fashion.
  1571.  
  1572.    CRC1 St$, CRCmsb%, CRClsb%
  1573.  
  1574. St$       string to process
  1575. -------
  1576. CRCmsb%   most significant byte of CRC
  1577. CRClsb%   least significant byte of CRC
  1578.  
  1579. Name  : CRC32Calc            (CRC 32-bit Calculation)
  1580. Class : String / Serial
  1581. Level : Any
  1582.  
  1583. This routine calculates a complex 32-bit checksum, called a
  1584. Cyclical Redundancy Check (or CRC) on a string. The results are
  1585. compatible with Zmodem CRC routines as well as those used by
  1586. popular archive utilities. The CRC provides a fairly reliable
  1587. check of what characters are contained in the string.
  1588.  
  1589. This routine must be used with two others. Before starting a CRC
  1590. calculation, call CRC32Init. You can then use CRC32Calc on one
  1591. or more strings for which you desire a CRC calculation. When
  1592. you're done, you call CRC32Done&, which returns the final
  1593. result. This approach allows you to calculate CRCs for data
  1594. which may be stored in more than one string.
  1595.  
  1596.    CRC32Calc St$
  1597.  
  1598. St$       string to process
  1599. -------
  1600.  
  1601. Name  : CRC32Done&           (CRC 32-bit Done)
  1602. Class : String / Serial
  1603. Level : Any
  1604.  
  1605. This routine returns the result of a 32-bit CRC calculation for
  1606. a string. See also CRC32Init and CRC32Calc.
  1607.  
  1608.    Result& = CRC32Done&
  1609.  
  1610. -------
  1611. Result&     32-bit CRC
  1612.  
  1613. Name  : CRC32Init            (CRC 32-bit Initialize)
  1614. Class : String / Serial
  1615. Level : Any
  1616.  
  1617. This routine initializes a 32-bit CRC calculation for a string.
  1618. See also CRC32Done& and CRC32Calc.
  1619.  
  1620.    CRC32Init
  1621.  
  1622. Name  : CreditCard$          (Credit Card validation)
  1623. Class : Miscellaneous
  1624. Level : Any
  1625.  
  1626. USE AT YOUR OWN RISK. This function has worked in my tests, but
  1627. I can't guarantee it will work for you. This is true of all
  1628. PBClone routines, but I feel it important to re-emphasize this
  1629. for this particular function. If you're not comfortable with
  1630. this lack of warranty, DON'T USE PBCLONE.
  1631.  
  1632. This function checks a credit card number for consistency, to
  1633. see if it is possibly valid. If the number seems reasonable, the
  1634. card type is returned as a four-character code:
  1635.  
  1636.    AMEX    American Express
  1637.    DINE    Diner's Club
  1638.    DISC    Discover
  1639.    MCAR    MasterCard
  1640.    VISA    Visa
  1641.  
  1642. Otherwise, a null string ("") is returned. The number is checked
  1643. according to length and self-consistency according to a
  1644. validation formula. Non-numeric characters are ignored.
  1645.  
  1646. NOTE that this function cannot ensure that a credit card number
  1647. -is- really valid. It can only tell you whether a card number is
  1648. -not- valid, to the best of its understanding. Its intended use
  1649. is in data-entry routines and similar operations which may
  1650. benefit from a "sanity check". *** USE AT YOUR OWN RISK ***
  1651.  
  1652.    CardName$ = CreditCard$(CardNumber$)
  1653.    IF LEN(CardName$) = 0 THEN PRINT "Error in card number"
  1654.  
  1655. CardNumber$    credit card number
  1656. -------
  1657. CardName$      type of credit card ("" if invalid)
  1658.  
  1659. Name  : Crunch               (Crunch repeated characters)
  1660. Class : String
  1661. Level : Any
  1662.  
  1663. It was hard to decide on a name for this routine, and I don't
  1664. know if I've done the best job. What Crunch does is to eliminate
  1665. repeated sequences of the same character. For instance, if you
  1666. gave it "This is a test" and asked it to crunch spaces, it would
  1667. return "This is a test". I use this to filter information from
  1668. the COMMAND$ function, but it's a good general purpose input
  1669. filter.
  1670.  
  1671.    Crunch St$, Ch$, StLen%
  1672.    St$ = LEFT$(St$, StLen%)
  1673.  
  1674. St$       string to be processed
  1675. Ch$       character to crunch out of the string
  1676. -------
  1677. St$       crunched string
  1678. StLen%    length of the crunched string
  1679.  
  1680. Name  : CtrlKey              (Control Key)
  1681. Class : Input
  1682. Level : Any
  1683.  
  1684. This routine works in conjunction with a key input routine, such
  1685. as INKEY$ or the CheckKey and GetKey routines. Given the ASCII
  1686. code of a key, CtrlKey returns the associated key letter, if
  1687. any. For instance, it returns "A" if you pass it ASCII code 1,
  1688. because that code represents Ctrl-A.
  1689.  
  1690.    CtrlKey ASCIICode%, Ky$
  1691.  
  1692. ASCIICode%   ASCII code of the key
  1693. -------
  1694. Ky$          associated key letter ("" if none)
  1695.  
  1696. Name  : CursorInfo           (Cursor Information)
  1697. Class : Input
  1698. Level : Clone
  1699.  
  1700. While BASIC allows you to set the size and shape of the cursor
  1701. with LOCATE, it's fairly hazardous to do so. There is no way to
  1702. find out the maximum size of the cursor, so your cursor may end
  1703. up a peculiar shape on some adapters. If you change the cursor
  1704. size or visibility in a subprogram, you may be screwing up the
  1705. main program.
  1706.  
  1707. CursorInfo offers a solution to these problems. It returns the
  1708. current cursor visibility and size, plus the maximum size
  1709. possible with the current video adapter. The minimum size will
  1710. always be zero, so it is not reported.
  1711.  
  1712.    CursorInfo Visible%, StartLine%, EndLine%, MaxLine%
  1713.  
  1714. -------
  1715. Visible%      whether the cursor is visible (0 no, 1 yes)
  1716. StartLine%    starting scan line of cursor
  1717. EndLine%      ending scan line of cursor
  1718. MaxLine%      maximum possible scan line for cursor
  1719.  
  1720. Name  : CWindowManager       (CGA Window Manager)
  1721. Class : Display
  1722. Level : Clone
  1723.  
  1724. CWindowManager displays a pop-up window on a CGA graphics
  1725. screen. It is intended for SCREEN 1, although it can be used on
  1726. SCREEN 2 as well (it will still have 40 columns and will display
  1727. shades rather than colors). The window may have any of a variety
  1728. of frames, a title, or a shadow, and it may appear instantly or
  1729. "grow" onto the screen.
  1730.  
  1731. These are the available frame types:
  1732.     0   no frame
  1733.     1   single lines
  1734.     2   double lines
  1735.     3   single horizontal, double vertical lines
  1736.     4   double horizontal, single vertical lines
  1737.     5   block graphic lines
  1738.  
  1739. Options for growing windows are as follows:
  1740.    -1   grow as fast as possible
  1741.     0   pop onto the screen
  1742.    1+   grow with delay given in milliseconds (15 works for me)
  1743.  
  1744. Note that this routine is different from its ProBas equivalent
  1745. in a number of respects. The grow delay time is different.
  1746. Growing is done more smoothly. The shadow and title parameters
  1747. are not changed by this routine. A new frame type (5) was added.
  1748. If a title is too long, it is truncated instead of being ignored
  1749. completely. Using a -1 as the title foreground color will not
  1750. turn off the title; instead, use a null title string.
  1751.  
  1752.    CWindowManager TRow%, LCol%, BRow%, RCol%, Frame%,
  1753.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Fast%
  1754.  
  1755. TRow%       top row of window
  1756. LCol%       left column of window
  1757. BRow%       bottom row of window
  1758. RCol%       right column of window
  1759. Frame%      frame type (see above)
  1760. Fore%       frame foreground color
  1761. Back%       frame background color
  1762. Grow%       window growing option (see above)
  1763. Shade%      window shadow option (0 for none)
  1764. TFore%      title foreground color
  1765. Title$      window title ("" if none)
  1766. Fast%       whether to use fast mode (0 no)
  1767.  
  1768. Name  : Cylinders%           (Cylinders)
  1769. Class : Disk
  1770. Level : DOS 3.3+
  1771.  
  1772. This function returns the number of cylinders for a given disk
  1773. drive. If the drive does not exist or is not a physical drive,
  1774. -1 will be returned. Note that the number of cylinders may be a
  1775. virtual number in some cases (such as drives compressed by the
  1776. DBLSPACE driver included with MS-DOS 6.0).
  1777.  
  1778. You may use "" to denote the current drive.
  1779.  
  1780.    Cyls% = Cylinders% (Drive$)
  1781.  
  1782. Drive$    drive for which to return cylinders
  1783. -------
  1784. Cyls%     number of cylinders (-1 if error)
  1785.  
  1786. Name  : DataSeg              (Data Segment)
  1787. Class : Memory
  1788. Level : Any
  1789.  
  1790. It's rare that you need to know the data segment used by BASIC,
  1791. but it does happen. DataSeg tells you that value. This is the
  1792. segment used by (near) strings, static arrays (except in the
  1793. QuickBASIC environment), some COMMON data, BASIC internal
  1794. variables and so forth. It is also the area specified by a plain
  1795. "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1796.  
  1797. There is also a function version of this routine, DataSeg2%.
  1798.  
  1799.    DataSeg DSeg%
  1800.  
  1801. -------
  1802. DSeg%     data segment for BASIC
  1803.  
  1804. Name  : DataSeg2%            (Data Segment)
  1805. Class : Memory
  1806. Level : Any
  1807.  
  1808. It's rare that you need to know the data segment used by BASIC,
  1809. but it does happen. DataSeg2% tells you that value. This is the
  1810. segment used by (near) strings, static arrays (except in the
  1811. QuickBASIC environment), some COMMON data, BASIC internal
  1812. variables and so forth. It is also the area specified by a plain
  1813. "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1814.  
  1815. There is also a sub version of this routine, DataSeg.
  1816.  
  1817.    DSeg% = DataSeg2%
  1818.  
  1819. -------
  1820. DSeg%     data segment for BASIC
  1821.  
  1822. Name  : Date2Int             (Date to Integer)
  1823. Class : Time
  1824. Level : Any
  1825.  
  1826. This routine compresses a date into a single integer. Note that
  1827. this integer is not in a format that lends itself to simple
  1828. computation-- you cannot subtract one from another to find out
  1829. the length of time between them. However, as long as the year is
  1830. in the range 1980-2042, you can compare the two integers to see
  1831. if one date is before or after another.
  1832.  
  1833. You may express the year as either a two-digit or four-digit
  1834. number.
  1835.  
  1836. The ProBas and PBClone versions of this routine do not work the
  1837. same way in regards to the year. ProBas assumed that any
  1838. two-digit year was in the 1900s. In contrast, PBClone assumes
  1839. that years 80-99 should be converted to 1980-1999 and that 0-79
  1840. should be converted to 2000-2079. I consider the PBClone method
  1841. more appropriate, with the turn of the century moving closer.
  1842. The date format used does not allow dates before 1980 anyway, so
  1843. nothing is being lost by this change.
  1844.  
  1845.    Date2Int MonthNr%, DayNr%, YearNr%, IntDate%
  1846.  
  1847. MonthNr%     month number (1-12)
  1848. DayNr%       day (1-31)
  1849. YearNr%      year (1980-2079; see above for two-digit years)
  1850. -------
  1851. IntDate%     date compressed into an integer
  1852.  
  1853. Name  : DateA2R              (Date Actual to Relative)
  1854. Class : Time
  1855. Level : Any
  1856.  
  1857. This routine converts an actual date to a relative date,
  1858. expressed as a number of days. This allows you to compare dates,
  1859. find out what the date will be in a given number of days (or
  1860. what it was a given number of days ago), see how many days
  1861. passed between two dates, and so forth.
  1862.  
  1863. I've frequently seen routines of this nature called "Julian
  1864. date" routines. I'm not sure where that nomenclature originated,
  1865. as it has nothing to do with the Julian calendar. Most of these
  1866. routines rely on approximations through floating point math, and
  1867. may or may not handle leap years and centuries appropriately.
  1868. The DateA2R routine takes no such shortcuts and may be relied
  1869. upon to return accurate results.
  1870.  
  1871.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  1872.  
  1873. MonthNr%     month number (1-12)
  1874. DayNr%       day number (1-31)
  1875. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  1876. -------
  1877. RelDate&     relative date
  1878.  
  1879. Name  : DateN2S              (Date Numbers to String)
  1880. Class : Time
  1881. Level : Any / DOS
  1882.  
  1883. Many of the PBClone routines return the date as a set of
  1884. numbers. This routine provides an easy way to convert those
  1885. numbers into string form. The date format used (year length and
  1886. delimiter) will be based on the string which you pass to the
  1887. routine. For instance, "xx-xx-xxxx" will return a date like
  1888. "11-26-1990", whereas "xx.xx.xxxx" would return "11.26.1990",
  1889. and "xx/xx/xx" would return "11/26/90".
  1890.  
  1891. If you pass zeroes for the MonthNr%, DayNr%, and YearNr% values,
  1892. the current date will be returned in the format that you
  1893. specified.
  1894.  
  1895. The ProBas and PBClone versions of this routine do not work the
  1896. same way in regards to the year. ProBas assumed that any
  1897. two-digit year was in the 1900s. In contrast, PBClone assumes
  1898. that years 80-99 should be converted to 1980-1999 and that 0-79
  1899. should be converted to 2000-2079.
  1900.  
  1901.    DateSt$ = "xx-xx-xxxx"
  1902.    DateN2S MonthNr%, DayNr%, YearNr%, DateSt$
  1903.  
  1904. MonthNr%  month
  1905. DayNr%    day
  1906. YearNr%   year
  1907. -------
  1908. DateSt$   date string.  Init to 8 or 10 chars (see above).
  1909.  
  1910. Name  : DateR2A              (Date Relative to Actual)
  1911. Class : Time
  1912. Level : Any
  1913.  
  1914. This is the opposite of the DateA2R routine-- it takes a
  1915. "relative" date and converts it back to the usual form.
  1916.  
  1917.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  1918.  
  1919. RelDate&     relative date
  1920. -------
  1921. MonthNr%     month number (1-12)
  1922. DayNr%       day number (1-31)
  1923. YearNr%      year number (1900 on)
  1924.  
  1925. Name  : DateS2N              (Date String to Numbers)
  1926. Class : Time
  1927. Level : Any
  1928.  
  1929. Many of the PBClone routines need to be passed the date as a set
  1930. of numbers. This routine provides an easy way to convert a date
  1931. from string form into numbers. You may use either "xx/xx/xx" or
  1932. "xx-xx-xxxx" form to specify the date (the string length is
  1933. important, but the delimiter and contents of the string are
  1934. ignored).
  1935.  
  1936. The ProBas and PBClone versions of this routine do not work the
  1937. same way in regards to the year. ProBas assumed that any
  1938. two-digit year was in the 1900s. In contrast, PBClone assumes
  1939. that years 80-99 should be converted to 1980-1999 and that 0-79
  1940. should be converted to 2000-2079.
  1941.  
  1942.    DateS2N MonthNr%, DayNr%, YearNr%, DateSt$
  1943.  
  1944. DateSt$   date string.  Init to 8 or 10 characters (see above).
  1945. -------
  1946. MonthNr%  month
  1947. DayNr%    day
  1948. YearNr%   year
  1949.  
  1950. Name  : DblSpace%            (DBLSPACE check)
  1951. Class : Disk
  1952. Level : BIOS
  1953.  
  1954. This function returns whether DBLSPACE, the disk space doubler
  1955. that debuted in MS-DOS 6.0, is installed.
  1956.  
  1957.    Dbl% = DblSpace%
  1958.  
  1959. -------
  1960. Dbl%        whether DBLSPACE is installed (0 no, -1 yes)
  1961.  
  1962. Name  : DCal                 (Direct-to-memory Calendar)
  1963. Class : Time
  1964. Level : Any
  1965.  
  1966. This routine draws a calendar for a specific month and year. The
  1967. results are placed in an array which can be displayed using
  1968. ScrRest or the other PBClone routines to restore a screen image.
  1969.  
  1970. You must supply an integer array large enough to hold the image
  1971. generated by DCal, which expects a 25x80 screen. DIM Scrn%(1 TO
  1972. 2000) will do it. If you supply a null date, the current date
  1973. will be used.
  1974.  
  1975.    DCal Scrn%(), CalDate$
  1976.  
  1977. Scrn%()      array to hold screen image
  1978. CalDate$     date for the calendar
  1979. Page%        ignored
  1980. Fast%        ignored
  1981.  
  1982. Name  : DCalendar            (Direct-to-memory Calendar)
  1983. Class : Time
  1984. Level : Clone
  1985.  
  1986. This routine displays a calendar for a specific month and year.
  1987. It waits for input and acts accordingly, allowing the user to
  1988. move to different dates via the arrow keys or by entering the
  1989. date directly. The bottom row of the screen gives a list of the
  1990. available key commands.
  1991.  
  1992. Screen handling is largely done by writing to an array, then
  1993. dumping the entire array to the display with DScrRest. This
  1994. provides for very smooth displays. You must supply an integer
  1995. array large enough to hold the image generated by DCalendar,
  1996. which expects a 25x80 screen. DIM Scrn%(1 TO 2000) will do it.
  1997. Only text mode is supported by this routine.
  1998.  
  1999. If you supply a null date, the current date will be used.
  2000.  
  2001.    DCalendar Scrn%(), CalDate$, Page%, Fast%
  2002.  
  2003. Scrn%()      array to hold screen image
  2004. CalDate$     date for the calendar
  2005. Page%        page on which to display (normally zero)
  2006. Fast%        whether to use fast mode (0 no)
  2007.  
  2008. Name  : DClear               (Direct-to-memory Clear)
  2009. Class : Display
  2010. Level : Any
  2011.  
  2012. The DClear routine allows you to clear a text-mode display.
  2013.  
  2014. This routine does not necessarily work on the display itself.
  2015. Instead, it allows you to specify the memory location (segment
  2016. and offset) of the "screen", which may be an actual screen, a
  2017. saved screen in an array, a multitasker's virtual screen, etc.
  2018. Among other things, this makes it easy to work with two displays
  2019. at once: use a segment of &HB000 for the mono display and &HB800
  2020. for the color display (the offset in each case is zero).
  2021.  
  2022.    DClear DSeg%, DOfs%, VAttr%
  2023.  
  2024. DSeg%    segment of "screen" memory
  2025. DOfs%    offset of "screen" memory
  2026. VAttr%   color/attribute to use (see CalcAttr)
  2027.  
  2028. Name  : DClearSS             (Direct Clear for Specified Size)
  2029. Class : Display
  2030. Level : Any
  2031.  
  2032. Like the CLS statement, this routine allows you to clear a text
  2033. display. However, rather than clearing the actual screen,
  2034. DClearSS clears a screen that is stored in an array. This allows
  2035. you to design a screen in memory, then flash it onto the display
  2036. using PutScreen or a similar routine.
  2037.  
  2038. This routine is designed for a text screen of any specified
  2039. size.
  2040.  
  2041.    DClearSS DSeg%, DOfs%, VAttr%, Rows%, Columns%
  2042.  
  2043. DSeg%     segment of the array that holds the screen
  2044. DOfs%     offset of the array that holds the screen
  2045. VAttr%    color/attribute to use (see CalcAttr)
  2046. Rows%     length of the screen
  2047. Columns%  width of the screen
  2048.  
  2049. Name  : Dec2Any              (Decimal to Any base)
  2050. Class : Numeric
  2051. Level : Any
  2052.  
  2053. This routine converts a normal integer to a number in any base.
  2054. It works like the HEX$ function in BASIC, but rather than
  2055. working only in hexadecimal (base 16), it can be used for
  2056. binary, octal, or almost anything else.
  2057.  
  2058. The result will be right-justified in the string you provide. If
  2059. you use zeroes, this allows you to ignore the NumberLen% spec
  2060. and just trim the string to the desired length, leaving nothing
  2061. worse than possible leading zeroes.
  2062.  
  2063. The length needed by the return string will vary according to
  2064. the number, with a maximum length depending on the number base
  2065. chosen. For integers, this will be at most 16 characters (worst
  2066. case: base 2 or binary).
  2067.  
  2068.    Number$ = STRING$(16, "0")
  2069.    Dec2Any DecimalNr%, NrBase%, Number$, NumberLen%
  2070.    Number$ = RIGHT$(Number$, NumberLen%)
  2071.  
  2072. DecimalNr   integer to convert to another base
  2073. NrBase%     desired number base (2-31)
  2074. -------
  2075. Number$     resulting number in desired base (init >= 16 chars)
  2076. NumberLen%  length of the result (-1 if string too short)
  2077.  
  2078. Name  : Delay                (Delay for seconds)
  2079. Class : Time
  2080. Level : Clone
  2081.  
  2082. This routine delays for a given number of seconds. The timing
  2083. will be the same from an 8088 PC through an 80486 AT-- it's
  2084. entirely independent of the processor. See also Delay18th.
  2085.  
  2086.    Delay Seconds%
  2087.  
  2088. Seconds%   number of seconds for which to delay
  2089.  
  2090. Name  : Delay18th            (Delay for 1/18th seconds)
  2091. Class : Time
  2092. Level : Clone
  2093.  
  2094. This routine delays for a given number of 18ths of seconds. The
  2095. timing will be the same from an 8088 PC through an 80486 AT--
  2096. it's entirely independent of the processor. See also Delay.
  2097.  
  2098.    Delay WaitTime%
  2099.  
  2100. WaitTime%  number of 18ths of seconds for which to delay
  2101.  
  2102. Name  : DelayV               (Delay based on Video timing)
  2103. Class : Time
  2104. Level : Clone
  2105.  
  2106. This routine delays for a given number of milliseconds. The
  2107. timing is based on a signal from the video adapter and may vary
  2108. somewhat depending on the adapter. The delay is largely
  2109. independent of the cpu type and speed, however.
  2110.  
  2111. For anyone unfamiliar with the metric system: there are 1000
  2112. milliseconds in one second. Depending on the specific display
  2113. adapter, this routine may well be fairly inaccurate; it is
  2114. intended for providing small delays for animation and similar
  2115. purposes, not as a reliable timer.
  2116.  
  2117.    DelayV MilliSeconds%
  2118.  
  2119. MilliSeconds%   number of milliseconds for which to delay
  2120.  
  2121. Name  : DelChr               (Delete Character)
  2122. Class : Display
  2123. Level : Clone
  2124.  
  2125. The DelChr routine deletes the character at the specified screen
  2126. location.
  2127.  
  2128.    DelChr Row%, Column%
  2129.  
  2130. Row%      row of character
  2131. Column%   column of character
  2132.  
  2133. Name  : DelFile              (Delete File)
  2134. Class : Disk
  2135. Level : DOS
  2136.  
  2137. This works like the DOS DEL (or ERASE) command, although it does
  2138. not allow wildcards. The specified file is deleted. Full path
  2139. specifications are supported, including drive and subdirectory
  2140. specs.
  2141.  
  2142.    DelFile FileName$, ErrCode%
  2143.  
  2144. FileName$   name of the file to delete
  2145. -------
  2146. ErrCode%    0 if no error, else DOS Error
  2147.  
  2148. Name  : DelLine              (Delete Line)
  2149. Class : Display
  2150. Level : BIOS
  2151.  
  2152. This routine deletes the specified row from the screen.
  2153.  
  2154.    DelLine Row%, VAttr%
  2155.  
  2156. Row%      row to delete
  2157. VAttr%    color/attr to use on new bottom row (see CalcAttr)
  2158.  
  2159. Name  : DelSub               (Delete Subdirectory)
  2160. Class : Disk
  2161. Level : DOS
  2162.  
  2163. This works like the DOS RD (or RMDIR) command. It does not allow
  2164. wildcards. The specified subdirectory is deleted. Note that you
  2165. may not delete a subdirectory that you're located in, or a
  2166. subdirectory which contains files, or the root directory.
  2167.  
  2168.    DelSub SubDir$, ErrCode%
  2169.  
  2170. SubDir$     name of the subdirectory to delete
  2171. -------
  2172. ErrCode%    0 if no error, else DOS Error
  2173.  
  2174. Name  : DFRead               (Direct-to-memory File Read)
  2175. Class : Disk
  2176. Level : DOS
  2177.  
  2178. This routine reads data into an array from a file that was
  2179. opened by FOpen1 or FCreate. If it wasn't possible to read it
  2180. all from the file, an error code will be returned and the
  2181. BytesRead% value will tell you how many bytes were actually
  2182. read.
  2183.  
  2184.    DFRead Handle%, DSeg%, DOfs%, Bytes%, BytesRead%, ErrCode%
  2185.  
  2186. Handle%     handle of the file from which to read
  2187. DSeg%       segment of the array into which to read the file
  2188. DOfs%       offset of the array into which to read the file
  2189. Bytes%      number of bytes to read
  2190. -------
  2191. BytesWrit%  # of bytes actually read from the file (if error)
  2192. ErrCode%    error code: 0 if no error, else DOS Error
  2193.  
  2194. Name  : DFWrite              (Direct-from-memory File Write)
  2195. Class : Disk
  2196. Level : DOS
  2197.  
  2198. This routine writes data from an array to a file that was opened
  2199. by FOpen1 or FCreate. If it wasn't possible to write it all to
  2200. the file, an error code will be returned and the BytesWrit%
  2201. value will tell you how many bytes were actually written.
  2202.  
  2203.    DFWrite Handle%, DSeg%, DOfs%, Bytes%, BytesWrit%, ErrCode%
  2204.  
  2205. Handle%     handle of the file to which to write
  2206. DSeg%       segment of the data to write to the file
  2207. DOfs%       offset of the data to write to the file
  2208. Bytes%      number of bytes to write
  2209. -------
  2210. BytesWrit%  # of bytes actually written to the file (if error)
  2211. ErrCode%    error code: 0 if no error, else DOS Error
  2212.  
  2213. Name  : DGClear              (Direct-to-memory Graphics Clear)
  2214. Class : Display
  2215. Level : Any
  2216.  
  2217. This routine works like the CLS statement, clearing a CGA
  2218. graphics display. However, rather than clearing the actual
  2219. screen, DClearSS clears a screen that is stored in an array.
  2220. This allows you to design a screen in memory, then flash it onto
  2221. the display using GrafRest.
  2222.  
  2223. This routine is designed for use with SCREEN 1 or SCREEN 2 (CGA
  2224. graphics).
  2225.  
  2226.    DGClear DSeg%, DOfs%, Colour%
  2227.  
  2228. DSeg%     segment of the array that holds the screen
  2229. DOfs%     offset of the array that holds the screen
  2230. Colour%   color to use
  2231.  
  2232. Name  : DGetRec              (Direct-from-memory Get Record)
  2233. Class : String
  2234. Level : Clone
  2235.  
  2236. The DGetRec routine allows you to get a string from a specified
  2237. area of memory (numeric array, BIOS data area, display memory,
  2238. or whatever). The string should be initialized to the desired
  2239. record length in advance.
  2240.  
  2241. This works somewhat like an array of fixed length strings or a
  2242. random file, treating memory as a contiguous series of records
  2243. of a specified length.
  2244.  
  2245.    DGetRec DSeg%, DOfs%, RecNr%, St$
  2246.  
  2247. DSeg%      segment of the array to read from
  2248. DOfs%      offset of the array to read from
  2249. RecNr%     record number (starting at 1)
  2250. -------
  2251. St$        returned string.  Init to record length (see above).
  2252.  
  2253. Name  : DGetScreen           (Direct memory Get Screen image)
  2254. Class : Display
  2255. Level : Clone
  2256.  
  2257. This routine saves any portion of the display to an array. Only
  2258. text modes are supported. If your program uses multiple display
  2259. pages, you can get an image from any of those pages. A special
  2260. "slow" mode is supported for the CGA, to prevent flickering (a
  2261. problem only with some CGAs).
  2262.  
  2263. The size of the integer array needed to store a specific area of
  2264. the screen can be calculated using the CalcSize routine (see).
  2265.  
  2266. The GetScreen routine works the same way as this, but has a
  2267. simpler calling convention. Also, if you wish to save the entire
  2268. screen, you may find ScrSave easier.
  2269.  
  2270.    DGetScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2271.       Page%, Fast%
  2272.  
  2273. DSeg%      segment of the array in which to store the image
  2274. DOfs%      offset of the array in which to store the image
  2275. TRow%      top row of the desired screen area
  2276. LCol%      left column of the desired screen area
  2277. BRow%      bottom row of the desired screen area
  2278. RCol%      right column of the desired screen area
  2279. Page%      page from which to get the display area
  2280. Fast%      whether to use fast mode (0 no)
  2281.  
  2282. Name  : DGetSt               (Direct-from-memory Get String)
  2283. Class : String
  2284. Level : Clone
  2285.  
  2286. The DGetSt routine allows you to get a string from a specified
  2287. area of memory (numeric array, BIOS data area, display memory,
  2288. or whatever). The string should be initialized to the desired
  2289. length in advance.
  2290.  
  2291. You may specify an additional offset from the initial location,
  2292. which itself is specified as a segment and an offset. The second
  2293. offset begins with position 1. The combined total of the two
  2294. offsets must be under 65,536 at the moment. I'll remove that
  2295. restriction at a later time. With normalized segment and offset
  2296. specifications, which is usually the case, this allows you to
  2297. specify a number from 1-65,521 for the second offset.
  2298.  
  2299.    DGetSt DSeg%, DOfs%, Posn&, St$
  2300.  
  2301. DSeg%      segment of the array to read from
  2302. DOfs%      offset of the array to read from
  2303. Posn&      location relative to the start of the array
  2304. -------
  2305. St$        returned string.  Init to # of chars desired.
  2306.  
  2307. Name  : DGQPrint             (Direct Graphics Quick Print)
  2308. Class : Display
  2309. Level : Any
  2310.  
  2311. This is a simple high-speed replacement for the PRINT statement
  2312. which works on a CGA virtual graphics screen (SCREEN 2). It does
  2313. not interpret control codes or support graphics characters
  2314. (ASCII 128-255).
  2315.  
  2316. DGQPrint allows you to display to a CGA even if it isn't the
  2317. active display (use a segment of &HB800 and offset of 0). Its
  2318. intended use, however, is to display to a virtual screen kept in
  2319. an array or other memory area. The results can then be displayed
  2320. using GrafRest.
  2321.  
  2322.    DGQPrint DSeg%, DOfs%, St$, Row%, Column%
  2323.  
  2324. DSeg%    segment of CGA virtual screen
  2325. DOfs%    offset of CGA virtual screen
  2326. St$      string to display
  2327. Row%     row (1-25)
  2328. Column%  column (1-80)
  2329.  
  2330. Name  : DGXQPrint            (Direct Graphics Extended Q Print)
  2331. Class : Display
  2332. Level : Any
  2333.  
  2334. This is a simple high-speed replacement for the PRINT statement
  2335. which works on a CGA virtual graphics screen (SCREEN 1). It does
  2336. not interpret control codes or support graphics characters
  2337. (ASCII 128-255).
  2338.  
  2339. This routine can also be used on a SCREEN 2 display, where it
  2340. will display the string in shades instead of in color (using 40
  2341. columns/row).
  2342.  
  2343. DGXQPrint allows you to display to a CGA even if it isn't the
  2344. active display (use a segment of &HB800 and offset of 0). Its
  2345. intended use, however, is to display to a virtual screen kept in
  2346. an array or other memory area. The results can then be displayed
  2347. using GrafRest.
  2348.  
  2349. The results of this routine are not redirectable by DOS.
  2350.  
  2351.    DGXQPrint DSeg%, DOfs%, St$, Row%, Column%, Fore%
  2352.  
  2353. DSeg%    segment of CGA virtual screen
  2354. DOfs%    offset of CGA virtual screen
  2355. St$      string to display
  2356. Row%     row (1-25)
  2357. Column%  column (1-40)
  2358. Fore%    foreground color (0-3)
  2359.  
  2360. Name  : DGXQPrint1           (Direct Graphics Extended Q Print)
  2361. Class : Display
  2362. Level : Any
  2363.  
  2364. This is a high-speed replacement for the PRINT statement which
  2365. works on a CGA virtual graphics screen (SCREEN 1). It does not
  2366. interpret control codes.
  2367.  
  2368. This routine can also be used on a SCREEN 2 display, where it
  2369. will display the string in shades instead of in color (using 40
  2370. columns/row).
  2371.  
  2372. DGXQPrint1 allows you to display to a CGA even if it isn't the
  2373. active display (use a segment of &HB800 and offset of 0). Its
  2374. intended use, however, is to display to a virtual screen kept in
  2375. an array or other memory area. The results can then be displayed
  2376. using GrafRest.
  2377.  
  2378. The results of this routine are not redirectable by DOS.
  2379.  
  2380.    DGXQPrint1 DSeg%, DOfs%, St$, Row%, Column%, Fore%, Back%
  2381.  
  2382. DSeg%    segment of CGA virtual screen
  2383. DOfs%    offset of CGA virtual screen
  2384. St$      string to display
  2385. Row%     row (1-25)
  2386. Column%  column (1-40)
  2387. Fore%    foreground color (0-3)
  2388. Back%    background color (0-3)
  2389.  
  2390. Name  : DInput               (Dollar Input)
  2391. Class : Input
  2392. Level : Clone
  2393.  
  2394. This routine provides formatted input of a dollar amount. You
  2395. specify the format and an initial value (may be zero). You may
  2396. also specify whether to allow negation-- if so, the user may
  2397. press the "-" key to toggle the number between negative and
  2398. positive. The numeric keypad will automatically be locked into
  2399. the numeric state. Since the decimal point is implicit, the "."
  2400. key functions as a delete or backspace operation, for convenient
  2401. one-handed data entry and correction.
  2402.  
  2403. The dollar amount is kept in a long integer as a number of
  2404. pennies, to avoid the possibility of round-off errors which
  2405. might result from use of floating point math. The results are
  2406. returned to you both as a long integer and as a formatted
  2407. number.
  2408.  
  2409. The format string works just like a PRINT USING format string.
  2410. Editing is not as flexible as for SInput, but is quite adequate.
  2411. The SInputSet routines will work for DInput as well as SInput.
  2412. The ExitCode% returned is the same as for SInput, but left and
  2413. right arrows may also be returned.
  2414.  
  2415.    DInput Format$, St&, St$, MinusOk%, VAttr%, ExitCode%
  2416.  
  2417. Format$    numeric format (just like PRINT USING format)
  2418. St&        dollar amount (in pennies)
  2419. MinusOk%   whether negation is allowed (0 if no)
  2420. VAttr%     color/attribute to use (see CalcAttr)
  2421. -------
  2422. St&        dollar amount (in pennies)
  2423. St$        formatted dollar amount
  2424. ExitCode%  key used to exit (ASCII code if +, scan code if -)
  2425.  
  2426. Name  : DiskStat             (Disk Statistics)
  2427. Class : Disk
  2428. Level : DOS
  2429.  
  2430. DiskStat gives you statistics on the memory usage of a specified
  2431. disk drive: the total number of clusters, the number of
  2432. available or free clusters, the number of sectors per cluster,
  2433. and the number of bytes per sector.
  2434.  
  2435. From this information, you can determine how much total disk
  2436. space there is, how much space is left and how much is used, the
  2437. size of a cluster, et al.
  2438.  
  2439. A few formulas for you:
  2440.  
  2441.    ClusterSize% = BytesPerSec% * SecsPerClus%
  2442.    FreeSpace& = FreeClus& * ClusterSize%
  2443.    TotalSpace& = TotalClus& * ClusterSize%
  2444.    UsedSpace& = TotalSpace& - FreeSpace&
  2445.  
  2446. A "cluster" is the minimum amount of disk space that can be
  2447. allocated at a time. A typical cluster size for a medium-sized
  2448. hard drive is 2048 bytes, which means that any file from 1-2048
  2449. bytes in length is actually taking up a full 2048 bytes on the
  2450. disk. Large cluster sizes improve file access times but can
  2451. waste a lot of disk space.
  2452.  
  2453.    DiskStat Drive$, FreeClus&, TotalClus&, BytesPerSec%,
  2454.       SecsPerClus%
  2455.  
  2456. Drive$        letter of the drive to examine
  2457. -------
  2458. FreeClus&     number of free or available clusters
  2459. TotalClus&    total number of clusters
  2460. BytesPerSec%  bytes per sector
  2461. SecsPerClus%  sectors per cluster (-1 if bad drive, etc)
  2462.  
  2463. Name  : Dissolve             (Dissolve)
  2464. Class : Display
  2465. Level : Clone
  2466.  
  2467. Like CLS, but a bit more fancy, this routine provides an
  2468. interesting way to clear the screen. See also FadeOut.
  2469.  
  2470. This routine may cause heavy flickering on some CGA displays.
  2471.  
  2472.    Dissolve VAttr%
  2473.  
  2474. VAttr%   color/attribute to which to clear (see CalcAttr)
  2475.  
  2476. Name  : DMPrint              (DOS Message Print)
  2477. Class : Display
  2478. Level : DOS
  2479.  
  2480. This routine is similar to PRINT, but goes through DOS output
  2481. services, which allows your program to support output
  2482. redirection, filters, CTTY and other handy things. See DOSInkey
  2483. for a DOS input service.
  2484.  
  2485. Note that the use of DMPrint means that you should avoid using
  2486. BASIC display handling (CLS, INPUT, LINE INPUT, PRINT, LOCATE,
  2487. CSRLIN, POS, etc). Instead, you should use ANSI escape sequences
  2488. to control the display. This requires that an ANSI driver (like
  2489. ANSI.SYS, DVANSI.SYS, NANSI.SYS, or ZANSI.SYS) be installed on
  2490. your system. See your DOS manual for details on ANSI sequences,
  2491. or grab the documentation on ANSI from one of your friendly
  2492. local BBSes.
  2493.  
  2494. It is -possible- to use BASIC display handling in conjunction
  2495. with DMPrint, but that tends to defeat the purpose of using
  2496. DMPrint in the first place.
  2497.  
  2498. Note that the DMPrint routine does not add a carriage
  2499. return/linefeed to the end of a string. If you want that, add
  2500. CHR$(13) + CHR$(10) to the end of the string.
  2501.  
  2502.    DMPrint St$
  2503.  
  2504. St$    string to display
  2505.  
  2506. Name  : DOSClrEol            (DOS Clear to End Of Line)
  2507. Class : Display
  2508. Level : DOS
  2509.  
  2510. This routine clears from the cursor position to the end of the
  2511. row using DOS output functions. It requires that ANSI.SYS or
  2512. another ANSI driver be installed.
  2513.  
  2514.    DOSClrEol
  2515.  
  2516. Name  : DOSCls               (DOS Clear Screen)
  2517. Class : Display
  2518. Level : DOS
  2519.  
  2520. This routine clears the screen using DOS output functions. It
  2521. requires that ANSI.SYS or another ANSI driver be installed.
  2522.  
  2523.    DOSCls
  2524.  
  2525. Name  : DOSColor             (DOS Color)
  2526. Class : Display
  2527. Level : DOS
  2528.  
  2529. This routine sets the screen colors using DOS output functions.
  2530. It requires that ANSI.SYS or another ANSI driver be installed.
  2531.  
  2532.    DOSColor Fore%, Back%
  2533.  
  2534. Fore%    foreground color
  2535. Back%    background color
  2536.  
  2537. Name  : DOSErrM$             (DOS Error Message)
  2538. Class : Miscellaneous
  2539. Level : DOS
  2540.  
  2541. Of the many PBClone routines that return error codes, most
  2542. simply pass the code back from DOS without any processing. You
  2543. can see what the codes mean by checking the chart in
  2544. PBClone.DOC, or it may be more convenient to use DOSErrM$
  2545. instead. This routine returns a short text description of the
  2546. error in question.
  2547.  
  2548.    ErrMsg$ = DOSErrM$(ErrCode%)
  2549.  
  2550. ErrCode%     error code to translate
  2551. -------
  2552. ErrMsg$      brief explanation of the error
  2553.  
  2554. Name  : DOSInkey             (DOS INKEY$)
  2555. Class : Input
  2556. Level : DOS
  2557.  
  2558. This routine is similar to INKEY$, but goes through DOS input
  2559. services, which allows your program to support input
  2560. redirection, filters, CTTY and other handy things. See DMPrint
  2561. for a DOS output service. See also DOSInky$.
  2562.  
  2563.    DOSInkey CharCode%, CharType%
  2564.  
  2565. -------
  2566. CharType%    0 if no key, 1 if normal key, 2 if extended key
  2567. CharCode%    ASCII code if normal key, scan code if extended key
  2568.  
  2569. Name  : DOSInky$             (DOS INKEY$)
  2570. Class : Input
  2571. Level : DOS
  2572.  
  2573. This routine works just like INKEY$, but goes through DOS input
  2574. services, which allows your program to support input
  2575. redirection, filters, CTTY and other handy things. See DMPrint
  2576. for a DOS output service. See also DOSInkey.
  2577.  
  2578.    ky$ = DOSInky$
  2579.  
  2580. -------
  2581. ky$      key, if any was waiting (0-2 chars/key, like INKEY$)
  2582.  
  2583. Name  : DOSInt%              (DOS Interrupt)
  2584. Class : Miscellaneous
  2585. Level : DOS
  2586.  
  2587. This routine provides you with easy access to DOS functions via
  2588. INT 21H, the major DOS interrupt. It works like the CALL
  2589. INTERRUPT routines provided with QuickBASIC but is easier to
  2590. use, at the expense of some flexibility.
  2591.  
  2592. CAUTION: This routine works directly with DOS, bypassing most of
  2593. BASIC's safety precautions. Possible chaos may result if you
  2594. don't know what you're doing! A few specific caveats:
  2595.  
  2596.    1) Do Not use this routine to exit your program or execute
  2597.       another. BASIC needs to clean up after itself before these
  2598.       tasks, and bypassing its handling is liable to make the
  2599.       system unstable at best.
  2600.  
  2601.    2) If you expect to use a string or array as a buffer, make
  2602.       sure it is long enough to handle the maximum amount of
  2603.       information anticipated. Strings and arrays can move about
  2604.       in memory, so be sure to get their addresses Just Before
  2605.       using DOSInt%.
  2606.  
  2607. If you wish to specify BASIC's data segment for DS, you can find
  2608. out what that is using the DataSeg routine (q.v.).
  2609.  
  2610. Normally, the CarryFlag% will be set if there is an error, in
  2611. which case AX will return the error code.
  2612.  
  2613.    CarryFlag% = DOSInt%(AX%, BX%, CX%, DX%, DS%)
  2614.  
  2615. AX%         desired setting of the AX register
  2616. BX%         desired setting of the BX register
  2617. CX%         desired setting of the CX register
  2618. DX%         desired setting of the DX register
  2619. DS%         desired setting of the DS and ES registers
  2620. -------
  2621. AX%         returned setting of the AX register
  2622. BX%         returned setting of the BX register
  2623. CX%         returned setting of the CX register
  2624. DX%         returned setting of the DX register
  2625. DS%         returned setting of the DS and ES registers
  2626. CarryFlag%  returned carry flag (0 no error, else code in AX)
  2627.  
  2628. Name  : DOSLocate            (DOS Locate)
  2629. Class : Display
  2630. Level : DOS
  2631.  
  2632. This routine sets the cursor position using DOS output
  2633. functions. It requires that ANSI.SYS or another ANSI driver be
  2634. installed.
  2635.  
  2636. Note that many ANSI drivers do not fully support EGA or VGA
  2637. modes in that they are limited to a maximum of 25 rows.
  2638.  
  2639.    DOSLocate Row%, Column%
  2640.  
  2641. Row%      row
  2642. Column%   column
  2643.  
  2644. Name  : DPutRec              (Direct-to-memory Put Record)
  2645. Class : String
  2646. Level : Clone
  2647.  
  2648. The DPutRec routine allows you to put a string into a specified
  2649. area of memory (numeric array, BIOS data area, display memory,
  2650. or whatever). The string should be initialized to the desired
  2651. record length in advance.
  2652.  
  2653. This works somewhat like an array of fixed length strings or a
  2654. random file, treating memory as a contiguous series of records
  2655. of a specified length.
  2656.  
  2657.    DPutRec DSeg%, DOfs%, RecNr%, St$
  2658.  
  2659. DSeg%      segment of the array to write into
  2660. DOfs%      offset of the array to write into
  2661. RecNr%     record number (starting at 1)
  2662. St$        string to write.  Init to record length (see above).
  2663.  
  2664. Name  : DPutScreen           (Direct-from-memory Put Screen)
  2665. Class : Display
  2666. Level : Clone
  2667.  
  2668. This routine restores a portion of the display (which was saved
  2669. to an array by DGetScreen or GetScreen) to the screen. Only text
  2670. modes are supported. If your program uses multiple display
  2671. pages, you can put the image onto any of those pages. A special
  2672. "slow" mode is supported for the CGA, to prevent flickering (a
  2673. problem only with some CGAs).
  2674.  
  2675. The PutScreen routine works the same way as this, but has a
  2676. simpler calling convention. Also, if you wish to restore the
  2677. entire screen, you may find ScrRest easier (see).
  2678.  
  2679.    DPutScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2680.       Page%, Fast%
  2681.  
  2682. DSeg%      segment of the array from which to restore the image
  2683. DOfs%      offset of the array from which to restore the image
  2684. TRow%      top row of the desired screen area
  2685. LCol%      left column of the desired screen area
  2686. BRow%      bottom row of the desired screen area
  2687. RCol%      right column of the desired screen area
  2688. Page%      page on which to restore the display
  2689. Fast%      whether to use fast mode (0 no)
  2690.  
  2691. Name  : DPutSt               (Direct-to-memory Put String)
  2692. Class : String
  2693. Level : Clone
  2694.  
  2695. The DPutSt routine allows you to put a string into a specified
  2696. area of memory (numeric array, BIOS data area, display memory,
  2697. or whatever).
  2698.  
  2699. You may specify an additional offset from the initial location,
  2700. which itself is specified as a segment and an offset. The second
  2701. offset begins with position 1. The combined total of the two
  2702. offsets must be under 65,536 at the moment. I'll remove that
  2703. restriction at a later time. With normalized segment and offset
  2704. specifications, which is usually the case, this allows you to
  2705. specify a number from 1-65,521 for the second offset.
  2706.  
  2707.    DPutSt DSeg%, DOfs%, Posn&, St$
  2708.  
  2709. DSeg%      segment of the array to write to
  2710. DOfs%      offset of the array to write to
  2711. Posn&      location relative to the start of the array
  2712. St$        string to write into memory
  2713.  
  2714. Name  : DReadAbs             (Disk Read Absolute)
  2715. Class : Disk
  2716. Level : DOS
  2717.  
  2718. This routine reads an absolute disk sector. This is about as
  2719. low-level as you can get-- the disk is read directly at the byte
  2720. level, bypassing higher-level notions like filenames and
  2721. directories.
  2722.  
  2723. The DReadAbs routine works with any version of DOS, but will not
  2724. work properly with disk partitions of over 32 megabytes. If you
  2725. need to work with large disks, see the DReadAbsBig routine.
  2726.  
  2727. The results from the read will be stored in an array or other
  2728. memory area you specify. Be sure to make the area large enough
  2729. to hold everything! A sector is usually 512 bytes, but you can
  2730. use the DiskStat routine to make sure. Logical sector numbering
  2731. is used, with sector numbers beginning at zero.
  2732.  
  2733.    DReadAbs Drive$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  2734.  
  2735. Drive$     drive letter
  2736. Sector&    starting sector (0-65534 [or less on most disks])
  2737. DSeg%      segment of the array
  2738. DOfs%      offset of the array
  2739. Sectors%   number of sectors to read
  2740. -------
  2741. ErrCode%   error code (0 if no error, else DOS error code)
  2742.  
  2743. Name  : DReadAbsBig          (Disk Read Absolute, Big)
  2744. Class : Disk
  2745. Level : DOS
  2746.  
  2747. This routine reads an absolute disk sector. This is about as
  2748. low-level as you can get-- the disk is read directly at the byte
  2749. level, bypassing higher-level notions like filenames and
  2750. directories.
  2751.  
  2752. The DReadAbsBig routine works with DOS 3.31 and later. It will
  2753. work on disks of any size. If a limit of 32M is sufficient, you
  2754. might prefer the DReadAbs routine, which works with any DOS
  2755. version.
  2756.  
  2757. The results from the read will be stored in an array or other
  2758. memory area you specify. Be sure to make the area large enough
  2759. to hold everything! A sector is usually 512 bytes, but you can
  2760. use the DiskStat routine to make sure. Logical sector numbering
  2761. is used, with sector numbers beginning at zero.
  2762.  
  2763.    DReadAbsBig Driv$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  2764.  
  2765. Driv$      drive letter
  2766. Sector&    starting sector (0-65534 [or less on most disks])
  2767. DSeg%      segment of the array
  2768. DOfs%      offset of the array
  2769. Sectors%   number of sectors to read
  2770. -------
  2771. ErrCode%   error code (0 if no error, else DOS error code)
  2772.  
  2773. Name  : DRecDel              (Direct-to-memory Record Deletion)
  2774. Class : Array management
  2775. Level : Any
  2776.  
  2777. This routine allows you to delete an item from an array. The
  2778. item may consist of one or more array elements. The size of the
  2779. array isn't actually changed, but the array elements are moved
  2780. as if a deletion took place.
  2781.  
  2782.    DRecDel DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2783.  
  2784. DSeg%      segment of the array
  2785. DOfs%      offset of the array
  2786. RecNr%     record/element number (starting at 1)
  2787. RecLen%    record/element length in bytes
  2788. Records%   total number of records/elements in the array
  2789.  
  2790. Name  : DRecIns              (Direct-to-mem Record Insertion)
  2791. Class : Array management
  2792. Level : Any
  2793.  
  2794. This routine allows you to insert an item into an array. The
  2795. item may consist of one or more array elements. The size of the
  2796. array isn't actually changed, but the array elements are moved
  2797. as if an insertion took place. You must of course make sure that
  2798. the array is DIMed large enough to handle this.
  2799.  
  2800.    DRecIns DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2801.  
  2802. DSeg%      segment of the array
  2803. DOfs%      offset of the array
  2804. RecNr%     record/element number (starting at 1)
  2805. RecLen%    record/element length in bytes
  2806. Records%   total number of records/elements in the array
  2807.  
  2808. Name  : DRecolor             (Direct-to-memory Recolor)
  2809. Class : Display
  2810. Level : Any
  2811.  
  2812. The DRecolor routine changes all text in one color to another
  2813. color. It works only in text modes. The colors are specified as
  2814. attributes (see CalcAttr).
  2815.  
  2816. This routine does not necessarily work on the display itself.
  2817. Instead, it allows you to specify the memory location (segment
  2818. and offset) of the "screen", which may be an actual screen, a
  2819. saved screen in an array, a multitasker's virtual screen, etc.
  2820. Among other things, this makes it easy to work with two displays
  2821. at once: use a segment of &HB000 for the mono display and &HB800
  2822. for the color display (the offset in each case is zero).
  2823.  
  2824.    DRecolor DSeg%, DOfs%, OldAttr%, NewAttr%
  2825.  
  2826. DSeg%      segment of "screen" memory
  2827. DOfs%      offset of "screen" memory
  2828. OldAttr%   color to be changed
  2829. NewAttr%   color to which to change
  2830.  
  2831. Name  : DRecolorArea         (Direct-to-memory Recolor Area)
  2832. Class : Display
  2833. Level : Clone
  2834.  
  2835. The DRecolorArea routine changes a specified area of the screen
  2836. to a specified color. It works only in text modes. The color is
  2837. specified as an attribute (see CalcAttr).
  2838.  
  2839. One of the more common applications for this routine is marking
  2840. an area of the screen, e.g. menu highlight bars.
  2841.  
  2842.    DRecolorArea DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  2843.      VAttr%
  2844.  
  2845. This routine does not necessarily work on the display itself.
  2846. Instead, it allows you to specify the memory location (segment
  2847. and offset) of the "screen", which may be an actual screen, a
  2848. saved screen in an array, a multitasker's virtual screen, etc.
  2849. Among other things, this makes it easy to work with two displays
  2850. at once: use a segment of &HB000 for the mono display and &HB800
  2851. for the color display (the offset in each case is zero).
  2852.  
  2853. DSeg%       segment of "screen" memory
  2854. DOfs%       offset of "screen" memory
  2855. TRow%       top row of area to recolor
  2856. LCol%       left column of area to recolor
  2857. BRow%       bottom row of area to recolor
  2858. RCol%       right column of area to recolor
  2859. VAttr%      desired color
  2860.  
  2861. Name  : DriveSpace&          (Drive Space free)
  2862. Class : Disk
  2863. Level : DOS
  2864.  
  2865. This routine tells you how many bytes are free on a specified
  2866. disk drive.
  2867.  
  2868.    BytesFree& = DriveSpace&(Drive$)
  2869.  
  2870. Drive$      letter of the drive to examine
  2871. -------
  2872. BytesFree&  free bytes on the specified drive, or -1 if error
  2873.  
  2874. Name  : DrvSpaceL            (Drive Space free as Long integer)
  2875. Class : Disk
  2876. Level : DOS
  2877.  
  2878. This routine tells you how many bytes are free on a specified
  2879. disk drive. See also DriveSpace, a function-type version of this
  2880. routine.
  2881.  
  2882.    DrvSpaceL Drive$, BytesFree&
  2883.  
  2884. Drive$      letter of the drive to examine
  2885. -------
  2886. BytesFree&  free bytes on the specified drive, or -1 if error
  2887.  
  2888. Name  : DrvType              (Drive Type)
  2889. Class : Disk
  2890. Level : DOS 3.1+
  2891.  
  2892. The DrvType routine tells you whether a specified drive is fixed
  2893. or removable, and whether it is local or a remote (network)
  2894. drive. Since NetWare doesn't intercept the appropriate DOS call,
  2895. DrvType now tests for NetWare and uses its calls for the local
  2896. vs remote info if possible. The local/remote info may not be
  2897. accurate with networks other than NetWare and Microsoft.
  2898.  
  2899. Microsoft's ubiquitous MSCDEX driver for CD-ROM drives presents
  2900. some intriguing anomalies. It pretends that CD-ROMs are fixed,
  2901. remote devices. Some MSCDEX versions also return an error flag
  2902. for CD-ROM drives for no apparent reason. I've revised error
  2903. checking accordingly, so this should not present a problem with
  2904. the current DrvType routine.
  2905.  
  2906.    DrvType Drive$, Removable%, Remote%, ErrCode%
  2907.  
  2908. Drive$       letter of the drive to examine
  2909. -------
  2910. Removable%   whether the disk can be removed (0 if no)
  2911. Remote%      whether this is a remote drive (0 if no)
  2912. ErrCode%     error code: 0 if none, else DOS error
  2913.  
  2914. Name  : DScrRest             (Direct-from-mem Screen Restore)
  2915. Class : Display
  2916. Level : Clone
  2917.  
  2918. The DScrRest routine restores a display that was saved using
  2919. ScrSave or a similar routine. It only works in text modes. See
  2920. also ScrRest.
  2921.  
  2922.    DScrRest DSeg%, DOfs%, Page%, Fast%
  2923.  
  2924. DSeg%      segment of info to restore to the screen
  2925. DOfs%      offset of info to restore to the screen
  2926. Page%      page on which to restore the display
  2927. Fast%      whether to use fast mode (0 no)
  2928.  
  2929. Name  : DScrSave             (Direct-from-memory Screen Save)
  2930. Class : Display
  2931. Level : Clone
  2932.  
  2933. The DScrSave routine saves the display to an array or other
  2934. storage area. Only text modes are supported. For an 80x25
  2935. display, the array must hold 4,000 bytes (4,000 string
  2936. characters or 2,000 integers). See also ScrSave.
  2937.  
  2938.    DScrSave DSeg%, DOfs%, Page%, Fast%
  2939.  
  2940. DSeg%      segment of place to store the display
  2941. DOfs%      offset of place to store the display
  2942. Page%      page from which to get the display
  2943. Fast%      whether to use fast mode (0 no)
  2944.  
  2945. Name  : DTR                  (Data Terminal Ready signal)
  2946. Class : Serial
  2947. Level : Clone
  2948.  
  2949. Just as IBM provided the standard for personal computers, Hayes
  2950. provided the standard for modem commands. Unfortunately, the
  2951. command method of dropping carrier (hanging up the phone) was
  2952. badly designed, and all Hayes-compatible modems have a hard time
  2953. recognizing that command under certain line conditions.
  2954.  
  2955. Fortunately, there's a more reliable way of hanging up: the DTR
  2956. serial signal. Turning this signal off will cause the modem to
  2957. hang up very quickly. Most Hayes-compatible modems are
  2958. factory-set to pay attention to the DTR; those that aren't can
  2959. be made to do so either by flipping a hardware switch or with a
  2960. special initialization command. See your modem manual for
  2961. details.
  2962.  
  2963. BASIC will drop the DTR when you CLOSE the comm port, but this
  2964. isn't always a convenient way to do it. As a matter of fact,
  2965. this can be a decided nuisance, so many people have patched
  2966. their version of BASIC to avoid it. If you would like to do so,
  2967. check your local BBS for the method! With the PBClone DTR
  2968. routine, you can get full control over the DTR without having to
  2969. CLOSE the comm port.
  2970.  
  2971. Note: it may be wise to include a brief delay after dropping the
  2972. DTR, to give the modem a chance to react. Try Delay18th (see)
  2973. with a wait of around 4.
  2974.  
  2975.    DTR CommPort%, TurnOn%
  2976.  
  2977. CommPort%    serial port (1-4, though BASIC only handles 1-2)
  2978. TurnOn%      whether to raise (turn on) the DTR (0 if no)
  2979.  
  2980. Name  : DupeVar              (Duplicate Variable)
  2981. Class : Miscellaneous
  2982. Level : Any
  2983.  
  2984. This routine allows you to copy the contents of one variable
  2985. into another, even if the variables are not of the same type.
  2986. You may specify any variable type EXCEPT variable-length
  2987. strings: integer, long integer, single, double, fixed-length
  2988. string, TYPEd variable, etc.
  2989.  
  2990. Most languages that provide TYPEd variables also provide for
  2991. variant records, that is, more than one way of looking at the
  2992. same information. Curiously, BASIC doesn't. This routine allows
  2993. you to map one variable into another, essentially providing the
  2994. lacking capability.
  2995.  
  2996. The only caveat for DupeVar is that both variables must be the
  2997. same length in bytes.
  2998.  
  2999.    DupeVar FromVar, ToVar
  3000.  
  3001. FromVar     variable from which to copy
  3002. -------
  3003. ToVar       variable to which to copy
  3004.  
  3005. Name  : DWindowMan2          (Direct-to-memory Window Manager)
  3006. Class : Display
  3007. Level : Any
  3008.  
  3009. This routine is identical to DWindowManager but for the fact
  3010. that it allows you to design your own custom window frames.
  3011. Please see the description of DWindowManager for general
  3012. information.
  3013.  
  3014. These are the additional frame types:
  3015.     6   custom frame composed of a single character
  3016.     7   custom frame composed of the specified 7-character list:
  3017.         top left corner, top middle, top right corner,
  3018.         left middle, right middle,
  3019.         bottom left corner, bottom middle, bottom right corner
  3020.  
  3021.  /------------------------------------------------------------\
  3022.  | A custom frame like this would be defined as frame type 7, |
  3023.  | with a frame string of "/-\||\-/", for instance.           |
  3024.  \------------------------------------------------------------/
  3025.  
  3026.  *************************************************
  3027.  * On the other hand, a frame like this would be *
  3028.  * frame type 6, with a frame string of "*".     *
  3029.  *************************************************
  3030.  
  3031. Note that this routine differs from the ProBas equivalent in
  3032. that it supports full frame definitions through frame type 7.
  3033. Differences mentioned under WindowManager are also relevant.
  3034.  
  3035.    DWindowMan2 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  3036.       Frame%, FSt$, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  3037.  
  3038. DSeg%       segment of "screen" memory
  3039. DOfs%       offset of "screen" memory
  3040. TRow%       top row of window
  3041. LCol%       left column of window
  3042. BRow%       bottom row of window
  3043. RCol%       right column of window
  3044. Frame%      frame type (see above)
  3045. FSt$        frame definition string (see above)
  3046. Fore%       frame foreground color
  3047. Back%       frame background color
  3048. Grow%       window growing option (see above)
  3049. Shade%      window shadow option (see above)
  3050. TFore%      title foreground color
  3051. Title$      window title ("" if none)
  3052.  
  3053. Name  : DWindowMan3          (Direct-to-memory Window Manager)
  3054. Class : Display
  3055. Level : Any
  3056.  
  3057. This routine is identical in function to DWindowManager. The
  3058. parameters are mostly passed as an array, however, instead of
  3059. one by one. Please see the description of DWindowManager for
  3060. general information.
  3061.  
  3062.    DWindowMan3 Parm%(), Title$
  3063.  
  3064. DSeg%       segment of "screen" memory
  3065. DOfs%       offset of "screen" memory
  3066. Parm%(1)    top row of window
  3067. Parm%(2)    left column of window
  3068. Parm%(3)    bottom row of window
  3069. Parm%(4)    right column of window
  3070. Parm%(5)    frame type (see above)
  3071. Parm%(6)    frame foreground color
  3072. Parm%(7)    frame background color
  3073. Parm%(8)    window growing option (see above)
  3074. Parm%(9)    window shadow option (see above)
  3075. Parm%(10)   title foreground color
  3076. Title$      window title ("" if none)
  3077.  
  3078. Name  : DWindowMan4          (Direct-to-memory Window Manager)
  3079. Class : Display
  3080. Level : Any
  3081.  
  3082. This is an extremely cut-down version of DWindowManager,
  3083. providing no more than a simple frame generator.
  3084.  
  3085. These are the available frame types:
  3086.     0   no frame
  3087.     1   single lines
  3088.     2   double lines
  3089.     3   single horizontal, double vertical lines
  3090.     4   double horizontal, single vertical lines
  3091.     5   block graphic lines
  3092.  
  3093.    DWindowMan4 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  3094.       Frame%, VAttr%
  3095.  
  3096. DSeg%       segment of "screen" memory
  3097. DOfs%       offset of "screen" memory
  3098. TRow%       top row of window
  3099. LCol%       left column of window
  3100. BRow%       bottom row of window
  3101. RCol%       right column of window
  3102. Frame%      frame type (see above)
  3103. VAttr%      frame color/attribute (use CalcAttr)
  3104.  
  3105. Name  : DWindowManager       (Direct-to-memory Window Manager)
  3106. Class : Display
  3107. Level : Any
  3108.  
  3109. DWindowManager displays a pop-up window according to your
  3110. specifications. The window may have any of a variety of frames,
  3111. a title, or a shadow, and it may appear instantly or "grow" onto
  3112. the screen.
  3113.  
  3114. These are the available frame types:
  3115.     0   no frame
  3116.     1   single lines
  3117.     2   double lines
  3118.     3   single horizontal, double vertical lines
  3119.     4   double horizontal, single vertical lines
  3120.     5   block graphic lines
  3121.  
  3122. These are the available shadows:
  3123.    -3   transparent shadow on the right
  3124.    -2   transparent shadow on the left
  3125.    -1   solid black shadow on the left
  3126.     0   no shadow
  3127.    1+   shadow attribute (use CalcAttr) for a colored shadow
  3128.  
  3129. Options for growing windows are as follows:
  3130.    -1   grow as fast as possible
  3131.     0   pop onto the screen
  3132.    1+   grow with delay given in milliseconds (15 works for me)
  3133.  
  3134. Note that this routine is different from its ProBas equivalent
  3135. in a number of respects. The grow delay time is different.
  3136. Growing is done more smoothly. The shadow and title parameters
  3137. are not changed by this routine. A new frame type (5) was added.
  3138. If a title is too long, it is truncated instead of being ignored
  3139. completely. Using a -1 as the title foreground color will not
  3140. turn off the title; instead, use a null title string.
  3141.  
  3142.    DWindowManager DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  3143.       Frame%, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  3144.  
  3145. This routine does not necessarily work on the display itself.
  3146. Instead, it allows you to specify the memory location (segment
  3147. and offset) of the "screen", which may be an actual screen, a
  3148. saved screen in an array, a multitasker's virtual screen, etc.
  3149. Among other things, this makes it easy to work with two displays
  3150. at once: use a segment of &HB000 for the mono display and &HB800
  3151. for the color display (the offset in each case is zero).
  3152.  
  3153. DSeg%       segment of "screen" memory
  3154. DOfs%       offset of "screen" memory
  3155. TRow%       top row of window
  3156. LCol%       left column of window
  3157. BRow%       bottom row of window
  3158. RCol%       right column of window
  3159. Frame%      frame type (see above)
  3160. Fore%       frame foreground color
  3161. Back%       frame background color
  3162. Grow%       window growing option (see above)
  3163. Shade%      window shadow option (see above)
  3164. TFore%      title foreground color
  3165. Title$      window title ("" if none)
  3166.  
  3167. Name  : DWriteAbs             (Disk Write Absolute)
  3168. Class : Disk
  3169. Level : DOS
  3170.  
  3171. This routine writes an absolute disk sector. This is about as
  3172. low-level as you can get-- the disk is written directly at the
  3173. byte level, bypassing higher-level notions like filenames and
  3174. directories. This is DANGEROUS! If you screw up, DOS may not be
  3175. able to read the disk any more, and it may need to be
  3176. reformatted. Back up your data before trying this routine!
  3177.  
  3178. The DWriteAbs routine works with any version of DOS, but will
  3179. not work properly with disk partitions of over 32 megabytes. If
  3180. you need to work with large disks, see the DWriteAbsBig routine.
  3181.  
  3182. The write will be done from an array or other memory area you
  3183. specify. Be sure to make the area the right size! A sector is
  3184. usually 512 bytes, but you can use the DiskStat routine to make
  3185. sure. Logical sector numbering is used, with sector numbers
  3186. beginning at zero.
  3187.  
  3188.    DWriteAbs Drive$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  3189.  
  3190. Drive$     drive letter
  3191. Sector&    starting sector (0-65534 [or less on most disks])
  3192. DSeg%      segment of the array
  3193. DOfs%      offset of the array
  3194. Sectors%   number of sectors to write
  3195. -------
  3196. ErrCode%   error code (0 if no error, else DOS error code)
  3197.  
  3198. Name  : DWriteAbsBig          (Disk Write Absolute, Big)
  3199. Class : Disk
  3200. Level : DOS
  3201.  
  3202. This routine writes an absolute disk sector. This is about as
  3203. low-level as you can get-- the disk is written directly at the
  3204. byte level, bypassing higher-level notions like filenames and
  3205. directories. This is DANGEROUS! If you screw up, DOS may not be
  3206. able to read the disk any more, and it may need to be
  3207. reformatted. Back up your data before trying this routine!
  3208.  
  3209. The DWriteAbsBig routine works with DOS 3.31 and later. It will
  3210. work on disks of any size. If a limit of 32M is sufficient, you
  3211. might prefer the DWriteAbs routine, which works with any DOS
  3212. version.
  3213.  
  3214. The write will be done from an array or other memory area you
  3215. specify. Be sure to make the area the right size! A sector is
  3216. usually 512 bytes, but you can use the DiskStat routine to make
  3217. sure. Logical sector numbering is used, with sector numbers
  3218. beginning at zero.
  3219.  
  3220.    DWriteAbsBig Drv$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  3221.  
  3222. Drv$       drive letter
  3223. Sector&    starting sector (0-65534 [or less on most disks])
  3224. DSeg%      segment of the array
  3225. DOfs%      offset of the array
  3226. Sectors%   number of sectors to write
  3227. -------
  3228. ErrCode%   error code (0 if no error, else DOS error code)
  3229.  
  3230. Name  : DXQPrint             (Direct Extended Quick Print)
  3231. Class : Display
  3232. Level : Any
  3233.  
  3234. This routine provides a rather crude, but very fast, display
  3235. capability. It works like the PRINT statement in BASIC, except
  3236. that it doesn't move the cursor or process control codes. It
  3237. works only in text modes.
  3238.  
  3239. This routine does not necessarily work on the display itself.
  3240. Instead, it allows you to specify the memory location (segment
  3241. and offset) of the "screen", which may be an actual screen, a
  3242. saved screen in an array, a multitasker's virtual screen, etc.
  3243. Among other things, this makes it easy to work with two displays
  3244. at once: use a segment of &HB000 for the mono display and &HB800
  3245. for the color display (the offset in each case is zero).
  3246.  
  3247. The results of this routine are not redirectable by DOS.
  3248.  
  3249.    DXQPrint DSeg%, DOfs%, St$, Row%, Column%, VAttr%
  3250.  
  3251. DSeg%     segment of "screen" memory
  3252. DOfs%     offset of "screen" memory
  3253. St$       string to display
  3254. Row%      starting row
  3255. Column%   starting column
  3256. VAttr%    color/attribute (see CalcAttr)
  3257.  
  3258. Name  : EGARest7             (EGA Restore for SCREEN 7)
  3259. Class : Display
  3260. Level : Clone
  3261.  
  3262. This routine allows you to restore a SCREEN 7 (EGA, 320x200, 16
  3263. color) display that was saved using EGASave7 (see).
  3264.  
  3265.    EGARest7 DSeg%, DOfs%
  3266.  
  3267. DSeg%        segment of storage array, returned by VARSEG
  3268. DOfs%        offset  of storage array, returned by VARPTR
  3269.  
  3270. Name  : EGARest8             (EGA Restore for SCREEN 8)
  3271. Class : Display
  3272. Level : Clone
  3273.  
  3274. This routine allows you to restore a SCREEN 8 (EGA, 640x200, 16
  3275. color) display that was saved using EGASave8 (see).
  3276.  
  3277.    EGARest8 DSeg%, DOfs%
  3278.  
  3279. DSeg%        segment of storage array, returned by VARSEG
  3280. DOfs%        offset  of storage array, returned by VARPTR
  3281.  
  3282. Name  : EGARest9             (EGA Restore for SCREEN 9)
  3283. Class : Display
  3284. Level : Clone
  3285.  
  3286. This routine allows you to restore a SCREEN 9 (EGA, 640x350, 16
  3287. color) display that was saved using EGASave9 (see).
  3288.  
  3289.    EGARest9 DSeg1%, DOfs1%, DSeg2%, DOfs2%
  3290.  
  3291. DSeg1%       segment of storage array #1, returned by VARSEG
  3292. DOfs1%       offset  of storage array #1, returned by VARPTR
  3293. DSeg2%       segment of storage array #2, returned by VARSEG
  3294. DOfs2%       offset  of storage array #2, returned by VARPTR
  3295.  
  3296. Name  : EGASave7             (EGA Save for SCREEN 7)
  3297. Class : Display
  3298. Level : Clone
  3299.  
  3300. This routine allows you to save a SCREEN 7 (EGA, 320x200, 16
  3301. color) display that can be restored using EGARest7 (see).
  3302.  
  3303. The array used to hold the screen must contain 32,000 bytes. For
  3304. an integer array, this means that you must create the array by
  3305. DIM Array%(1 TO 16000).
  3306.  
  3307.    EGASave7 DSeg%, DOfs%
  3308.  
  3309. DSeg%        segment of storage array, returned by VARSEG
  3310. DOfs%        offset  of storage array, returned by VARPTR
  3311.  
  3312. Name  : EGASave8             (EGA Save for SCREEN 8)
  3313. Class : Display
  3314. Level : Clone
  3315.  
  3316. This routine allows you to save a SCREEN 8 (EGA, 640x200, 16
  3317. color) display that can be restored using EGARest8 (see).
  3318.  
  3319. The array used to hold the screen must contain 64,000 bytes. For
  3320. an integer array, this means that you must create the array by
  3321. DIM Array%(1 TO 32000).
  3322.  
  3323.    EGASave8 DSeg%, DOfs%
  3324.  
  3325. DSeg%        segment of storage array, returned by VARSEG
  3326. DOfs%        offset  of storage array, returned by VARPTR
  3327.  
  3328. Name  : EGASave9             (EGA Save for SCREEN 9)
  3329. Class : Display
  3330. Level : Clone
  3331.  
  3332. This routine allows you to save a SCREEN 9 (EGA, 640x350, 16
  3333. color) display that can be restored using EGARest9 (see).
  3334.  
  3335. Two arrays must be used to hold the screen, for a total of
  3336. 112,000 bytes. If you use integer arrays, each array must be
  3337. created by DIM Array%(1 TO 28000).
  3338.  
  3339.    EGASave9 DSeg%, DOfs%
  3340.  
  3341. DSeg1%       segment of storage array #1, returned by VARSEG
  3342. DOfs1%       offset  of storage array #1, returned by VARPTR
  3343. DSeg2%       segment of storage array #2, returned by VARSEG
  3344. DOfs2%       offset  of storage array #2, returned by VARPTR
  3345.  
  3346. Name  : Elapsed              (Elapsed time)
  3347. Class : Time
  3348. Level : Any
  3349.  
  3350. This routine tells you the amount of time elapsed between a
  3351. given starting time and ending time. The difference between the
  3352. times must be less than 24 hours for the results to be
  3353. meaningful.
  3354.  
  3355. See also ElapsedTime, the FUNCTION version of this routine.
  3356.  
  3357.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  3358.  
  3359. TimeStart$   starting time
  3360. TimeStop$    ending time
  3361. -------
  3362. TimeDiff$    elapsed time
  3363.  
  3364. Name  : ElapsedTime$         (Elapsed time)
  3365. Class : Time
  3366. Level : Any
  3367.  
  3368. This routine tells you the amount of time elapsed between a
  3369. given starting time and ending time. The difference between the
  3370. times must be less than 24 hours for the results to be
  3371. meaningful.
  3372.  
  3373. See also Elapsed, the SUB version of this routine.
  3374.  
  3375.    TimeDiff$ = ElapsedTime$(TimeStart$, TimeStop$)
  3376.  
  3377. TimeStart$   starting time
  3378. TimeStop$    ending time
  3379. -------
  3380. TimeDiff$    elapsed time
  3381.  
  3382. Name  : EMSBuffer            (EMS Buffer size)
  3383. Class : Memory
  3384. Level : BIOS
  3385.  
  3386. EMSBuffer tells you how many bytes are needed to save the state
  3387. of the EMS array routines. Used in conjunction with EMSSave and
  3388. EMSRest, it allows you to preserve EMS arrays across a CHAIN to
  3389. another part of your program.
  3390.  
  3391.    EMSBuffer Bytes%
  3392.    EMSState$ = SPACE$(Bytes%)
  3393.    EMSSave EMSState$
  3394.  
  3395. -------
  3396. Bytes%       bytes needed to save EMS array state
  3397.  
  3398. Name  : EMSClose             (EMS Close)
  3399. Class : Memory
  3400. Level : BIOS
  3401.  
  3402. The EMSClose routine is used when you are finished with an EMS
  3403. array. It frees the array handle and EMS memory for other uses.
  3404. If you don't close all EMS arrays before your program ends, the
  3405. memory will be lost until the system is rebooted, so it is
  3406. important to remember EMSClose.
  3407.  
  3408.    EMSClose ArrayHandle%
  3409.  
  3410. ArrayHandle%    handle of an EMS array
  3411.  
  3412. Name  : EMSGet               (EMS Get)
  3413. Class : Memory
  3414. Level : BIOS
  3415.  
  3416. This routine gets an element from an EMS array created by
  3417. EMSOpen. Element numbers start at 0. Be sure to use the right
  3418. numeric type for the array-- for instance, if you opened the
  3419. array for SINGLE precision, use "Value!".
  3420.  
  3421.    EMSGet ArrayHandle%, ElementNr&, Value
  3422.  
  3423. ArrayHandle%    handle of an EMS array
  3424. ElementNr&      element number to get
  3425. -------
  3426. Value           result (must be correct type for array)
  3427.  
  3428. Name  : EMSOpen              (EMS Open)
  3429. Class : Memory
  3430. Level : BIOS
  3431.  
  3432. This routine allows you to open a block of EMS (expanded) memory
  3433. which can then be accessed like a numeric array. The array size
  3434. is limited only by available EMS memory (use GetLIMM to find out
  3435. how much is available). You may specify any numeric type:
  3436.  
  3437.     1   INTEGER
  3438.     2   LONG or SINGLE
  3439.     3   DOUBLE
  3440.  
  3441. When the array is opened, you are returned an "array handle"
  3442. which is used to access that array. Access to the array is done
  3443. via EMSGet and EMSPut. When you are finished with the array, you
  3444. must close it with EMSClose.
  3445.  
  3446. As many as 25 EMS arrays can be in use at one time, subject to
  3447. limitations which may be imposed by your EMS driver (each array
  3448. requires one EMS handle).
  3449.  
  3450.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  3451.  
  3452. Elements&       number of elements in array (like DIM size)
  3453. ElementType%    numeric type of array (see above)
  3454. -------
  3455. ArrayHandle%    handle of an EMS array
  3456. ErrCode%        whether an error occurred (0 no)
  3457.  
  3458. Name  : EMSPut               (EMS Put)
  3459. Class : Memory
  3460. Level : BIOS
  3461.  
  3462. This routine puts an element into an EMS array created by
  3463. EMSOpen. Element numbers start at 0. Be sure to use the right
  3464. numeric type for the array-- for instance, if you opened the
  3465. array for SINGLE precision, use "Value!".
  3466.  
  3467.    EMSPut ArrayHandle%, ElementNr&, Value
  3468.  
  3469. ArrayHandle%    handle of an EMS array
  3470. ElementNr&      element number to set
  3471. Value           value to store (must be correct type for array)
  3472.  
  3473. Name  : EMSRest              (EMS Restore state)
  3474. Class : Memory
  3475. Level : BIOS
  3476.  
  3477. This routine allows you to restore the state of the EMS array
  3478. handler. Used in conjunction with EMSBuffer and EMSSave, it
  3479. allows you to preserve EMS arrays across a CHAIN to another part
  3480. of your program.
  3481.  
  3482.    EMSRest EMSState$
  3483.  
  3484. EMSState$    saved EMS array state
  3485.  
  3486. Name  : EMSSave              (EMS Save state)
  3487. Class : Memory
  3488. Level : BIOS
  3489.  
  3490. This routine allows you to save the state of the EMS array
  3491. handler. Used in conjunction with EMSBuffer and EMSRest, it
  3492. allows you to preserve EMS arrays across a CHAIN to another part
  3493. of your program.
  3494.  
  3495.    EMSBuffer Bytes%
  3496.    EMSState$ = SPACE$(Bytes%)
  3497.    EMSSave EMSState$
  3498.  
  3499. -------
  3500. EMSState$    saved EMS array state
  3501.  
  3502. Name  : EnhKbd               (Enhanced Keyboard)
  3503. Class : Input
  3504. Level : BIOS
  3505.  
  3506. By default, the PBClone routines assume an old-style keyboard is
  3507. in use, for greatest compatibility. EnhKbd allows you to turn on
  3508. enhanced keyboard handling for the current generation of
  3509. (usually) 101-key keyboards. This allows access to the F11 and
  3510. F12 function keys as well as codes for key combinations that
  3511. used to be ignored, among other things.
  3512.  
  3513. The KbdType or KbdType2% routine can be used to determine if an
  3514. enhanced keyboard is available (recommended).
  3515.  
  3516. Note that EnhKbd works by intercepting the BIOS keyboard
  3517. handler. All calls to the BIOS keyboard interrupt are converted
  3518. from the old keyboard functions to the new ones. YOU MUST
  3519. DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can restore the
  3520. old setup. Otherwise, the computer will most probably crash.
  3521.  
  3522. A list of the new key codes is given in PBClone.DOC.
  3523.  
  3524.    EnhKbd Enable%
  3525.  
  3526. Enable%     turn on enhanced keyboard support (0 disable)
  3527.  
  3528. Name  : Equipment            (Equipment information)
  3529. Class : Equipment
  3530. Level : BIOS
  3531.  
  3532. This routine gives you some information about the basic
  3533. equipment in your computer. Note that the "game port"
  3534. information is not reliable, due to changes in the meaning of
  3535. this particular area of the BIOS over many years.
  3536.  
  3537.    Equipment Memory%, Parallel%, Serial%, Game%
  3538.  
  3539. -------
  3540. Memory%    kilobytes of conventional memory installed (16 - 640)
  3541. Parallel%  parallel (printer) ports installed (0-4)
  3542. Serial%    serial (communications) ports installed (0-4)
  3543. Game%      game (joystick) ports installed (0-1).  See remarks, above.
  3544.  
  3545. Name  : EuropeDate           (European Date format)
  3546. Class : Time
  3547. Level : Any
  3548.  
  3549. This routine takes a date in one of the American formats
  3550. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  3551. convention ("DD.MM.YY" or "DD.MM.YYYY"). The date is formatted
  3552. according to a format string which provides the desired
  3553. delimiter and year length, e.g. "##-##-##" specifies a delimiter
  3554. of "-" and a year length of two digits.
  3555.  
  3556. An error code is returned if the date is not valid.
  3557.  
  3558.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  3559.  
  3560. DateSt$     date to format (month, day, year order)
  3561. Format$     format for the date
  3562. -------
  3563. Result$     resulting date (day, month, year order)
  3564. ErrCode     whether the date is valid (0 ok)
  3565.  
  3566. Name  : EWindowManagerC      (EGA Window Manager w Char coords)
  3567. Class : Display
  3568. Level : Clone
  3569.  
  3570. EWindowManagerC displays a pop-up window according to your
  3571. specifications. The window may have any of a variety of frames,
  3572. a title, or a shadow, and it may appear instantly or "grow" onto
  3573. the screen. EGA and VGA graphics modes (SCREEN 7 through SCREEN
  3574. 12) are supported.
  3575.  
  3576. These are the available frame types:
  3577.     0   no frame
  3578.     1   single lines
  3579.     2   double lines
  3580.     3   single horizontal, double vertical lines
  3581.     4   double horizontal, single vertical lines
  3582.     5   block graphic lines
  3583.  
  3584. These are the available shadows:
  3585.     0   no shadow
  3586.    1+   shadow attribute (use CalcAttr) for a colored shadow
  3587.  
  3588. Options for growing windows are as follows:
  3589.    -1   grow as fast as possible
  3590.     0   pop onto the screen
  3591.    1+   grow with delay given in milliseconds (not recommended)
  3592.  
  3593. The differences between this routine and its ProBas equivalent
  3594. are the same as mentioned in the description for WindowManager.
  3595. Also, growing windows are supported, but are not recommended
  3596. (too slow). Colored shadows work as in WindowManager. "True"
  3597. shadows are not yet supported.
  3598.  
  3599.    EWindowManagerC TRow%, LCol%, BRow%, RCol%, Frame%,
  3600.       Fore%, Back%, Grow%, Shade%, S1%, S2%, TFore%, Title$
  3601.  
  3602. TRow%       top row of window
  3603. LCol%       left column of window
  3604. BRow%       bottom row of window
  3605. RCol%       right column of window
  3606. Frame%      frame type (see above)
  3607. Fore%       frame foreground color
  3608. Back%       frame background color
  3609. Grow%       window growing option (see above)
  3610. Shade%      window shadow option (see above)
  3611. S1%         unused
  3612. S2%         unused
  3613. TFore%      title foreground color
  3614. Title$      window title ("" if none)
  3615.  
  3616. Name  : Exist                (file Existence)
  3617. Class : Disk
  3618. Level : DOS
  3619.  
  3620. Most versions of BASIC give you no way of seeing if a file
  3621. exists before you try to OPEN it, so you end up taking your
  3622. chances. The Exist routine allows you to test to see if the file
  3623. exists beforehand. It isn't really necessary for the PBClone
  3624. file routines, which will return an appropriate error code, but
  3625. it's an important safeguard when using the BASIC OPEN statement.
  3626.  
  3627. The Exist routine does not support wildcards. If you need that
  3628. feature, try the FindFirstFx and FindNextFx routines instead.
  3629.  
  3630. See also Exist2, the FUNCTION version of this routine.
  3631.  
  3632.    Exist FileName$, Found%
  3633.  
  3634. FileName$   name of the file to look for
  3635. -------
  3636. Found%      whether the file was found (0 if no)
  3637.  
  3638. Name  : Exist2%              (file Existence)
  3639. Class : Disk
  3640. Level : DOS
  3641.  
  3642. Most versions of BASIC give you no way of seeing if a file
  3643. exists before you try to OPEN it, so you end up taking your
  3644. chances. The Exist2% function allows you to test to see if the
  3645. file exists beforehand. It isn't really necessary for the
  3646. PBClone file routines, which will return an appropriate error
  3647. code, but it's an important safeguard when using the OPEN
  3648. statement.
  3649.  
  3650. The Exist2% routine does not support wildcards. If you need that
  3651. feature, try the FindFirstFx and FindNextFx routines instead.
  3652.  
  3653. See also Exist, the SUB version of this routine.
  3654.  
  3655.    Found% = Exist2%(FileName$)
  3656.  
  3657. FileName$   name of the file to look for
  3658. -------
  3659. Found%      whether the file was found (0 if no)
  3660.  
  3661. Name  : ExplainFAttr$        (Explain File Attribute)
  3662. Class : Disk
  3663. Level : Any
  3664.  
  3665. This function returns a string explaining what a file attribute
  3666. means, using a specified level of abbreviation. A single space
  3667. is used between each word, e.g. a hidden subdirectory at
  3668. abbreviation level 2 would be "Hid Dir".
  3669.  
  3670. Abbreviation Levels:
  3671.         1           2              3
  3672.    ---------------------------------------
  3673.  1      R          R-O         Read-Only
  3674.  2      H          Hid         Hidden
  3675.  4      S          Sys         System
  3676.  8      V          Vol         Volume
  3677. 16      D          Dir         Directory
  3678. 32      A          Arc         Archive
  3679.  
  3680. This function is convenient in conjunction with any of the
  3681. routines which return a file attribute: GetAttrF, GetAttrFx,
  3682. GetFAttr, LoadDirAll.
  3683.  
  3684.    Info$ = ExplainFAttr$(FilAttr%, AbbrevLevel%)
  3685.  
  3686. We use FilAttr% instead of FileAttr%, since BASIC has a built-in
  3687. FILEATTR function.
  3688.  
  3689. FilAttr%      file attribute
  3690. -------
  3691. AbbrevLevel%  how much to abbreviate the result (1-3)
  3692.  
  3693. Name  : EXQPrintC            (EGA Extended Quick Print, Char)
  3694. Class : Display
  3695. Level : Clone
  3696.  
  3697. This routine provides a rather crude, but very fast, display
  3698. capability. It works like the PRINT statement in BASIC, except
  3699. that it doesn't move the cursor or process control codes. It
  3700. works in EGA and VGA graphics modes (SCREEN 7 through SCREEN
  3701. 12).
  3702.  
  3703. The results of this routine are not redirectable by DOS.
  3704.  
  3705.    EXQPrintC St$, Row%, Column%, Fore%, Back%
  3706.  
  3707. St$       string to display
  3708. Row%      starting row
  3709. Column%   starting column
  3710. Fore%     foreground color
  3711. Back%     background color
  3712.  
  3713. Name  : ExtendFSpec          (Extend File Specification)
  3714. Class : Disk
  3715. Level : DOS
  3716.  
  3717. The ExtendFSpec routine combines a number of handy services
  3718. together. It is intended for processing user-entered file
  3719. specifications. It does the following:
  3720.  
  3721.    1) Makes sure the filespec is valid
  3722.    2) Formats the filespec to normal DOS standards
  3723.    3) Tells you whether the drive and subdirectories
  3724.       specified exist
  3725.    4) Fills out any drive or subdirectory information that
  3726.       was left out (optionally includes adding an extension
  3727.       to files which lack one)
  3728.  
  3729. The error codes returned are as follows:
  3730.    -1    Invalid file specification
  3731.     0    No error
  3732.     1    Specified drive does not exist (warning only)
  3733.     2    Specified subdirectory does not exist (warning only)
  3734.  
  3735. The ExtendFSpec routine mimics DOS filename handling exactly, to
  3736. the best of my knowledge.
  3737.  
  3738.    ExtendFSpec File$, Ext$, FullFile$, ErrCode%
  3739.  
  3740. File$      file specification to process
  3741. Ext$       extension to add to files that don't have extensions
  3742. -------
  3743. FullFile$  processed file specification
  3744. ErrCode%   error code
  3745.  
  3746. Name  : ExtGet               (Extended memory Get)
  3747. Class : Memory
  3748. Level : BIOS (AT)
  3749.  
  3750. This routine allows you to get information from extended memory.
  3751. It should only be used on AT-class computers, since older PCs do
  3752. not support extended memory.
  3753.  
  3754. You may get up to 32,766 words (just under 64 kilobytes) at a
  3755. time from a specified location in extended memory. The location
  3756. is specified as the distance from the start of extended memory,
  3757. starting at 1 for the first location. One word is equivalent to
  3758. one integer.
  3759.  
  3760. See ExtMem for information on extended memory constraints.
  3761.  
  3762.    ExtGet DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3763.  
  3764. DSeg%       segment of array to place data from extended memory
  3765. DOfs%       offset of array to place data from extended memory
  3766. Posn&       location of data in extended memory (starting at 1)
  3767. Words%      # of words to transfer (1 int = 1 word = 2 byte)
  3768. -------
  3769. ErrCode%    error code (0 if no error)
  3770.  
  3771. Name  : ExtMem               (Extended Memory)
  3772. Class : Memory / Equipment
  3773. Level : BIOS (AT)
  3774.  
  3775. This routine allows you to find out how much extended memory is
  3776. available. It should only be used on AT-class computers, since
  3777. older PCs do not support extended memory.
  3778.  
  3779. The amount of memory returned may be either the total amount of
  3780. extended memory installed or just the amount available at this
  3781. time, depending on how previously-installed programs (if any)
  3782. make use of extended memory. Unfortunately, there is no standard
  3783. which defines how a program should use extended memory as there
  3784. is with EMS (expanded memory), so there is no way for a program
  3785. to determine whether or how another program is using extended
  3786. memory. Microsoft is trying to clear up this situation with its
  3787. HIMEM driver (available at your local BBS, or [last I looked]
  3788. free from Microsoft), but this approach hasn't really become
  3789. standard yet.
  3790.  
  3791.    ExtMem KBytes%
  3792.  
  3793. -------
  3794. KBytes%     the number of kilobytes of extended memory
  3795.  
  3796. Name  : ExtPut               (Extended memory Put)
  3797. Class : Memory
  3798. Level : BIOS (AT)
  3799.  
  3800. This routine allows you to put information into extended memory.
  3801. It should only be used on AT-class computers, since older PCs do
  3802. not support extended memory.
  3803.  
  3804. You may put up to 32,766 words (just under 64 kilobytes) at a
  3805. time into a specified location in extended memory. The location
  3806. is specified as the distance from the start of extended memory,
  3807. starting at 1 for the first location. One word is equivalent to
  3808. one integer.
  3809.  
  3810. Note that you can't rely on extended memory being available just
  3811. because it exists. There is no automatic way to determine if
  3812. another program is also trying to use the same extended memory.
  3813. If in doubt, allow a user-installed option to enable/disable the
  3814. use of extended memory by your program.
  3815.  
  3816.    ExtPut DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3817.  
  3818. DSeg%       segment of data to store in extended memory
  3819. DOfs%       offset of data to store in extended memory
  3820. Posn&       location to place data in extended memory
  3821. Words%      # of words to transfer (1 int = 1 word = 2 bytes)
  3822. -------
  3823. ErrCode%    error code (0 if no error)
  3824.  
  3825. Name  : Extract              (Extract delimited substring)
  3826. Class : String
  3827. Level : Any
  3828.  
  3829. Extract allows you to remove any one of a list of delimited
  3830. substrings in a string. It's useful for input parsing and
  3831. database work. You pass it the string, delimiter, and the number
  3832. of the desired substring (numbers start at one). It returns the
  3833. starting position of the substring within the string and the
  3834. length of the substring (0 if not found).
  3835.  
  3836. Just for example, let's assume we have a string as follows:
  3837.    St$ = "Tom Hanlin=3544 E. Southern Ave #104=Mesa, AZ 85204"
  3838.  
  3839. If we selected a delimiter of "=" and substring number three,
  3840. the results would be "Mesa, AZ 85204".
  3841.  
  3842. Delimiters of more than one character are fine. This can be
  3843. handy for locating carriage return/linefeed pairs, among other
  3844. things.
  3845.  
  3846.    Extract St$, Delimiter$, SubStrNr%, StartPosn%, SLen%
  3847.    SubSt$ = MID$(St$, StartPosn%, SLen%)
  3848.  
  3849. St$         string from which to extract
  3850. Delimiter$  delimiter between substrings
  3851. SubStrNr%   number of the desired substring
  3852. -------
  3853. StartPosn%  starting position of substring within the string
  3854. SLen%       length of the substring (0 if none)
  3855.  
  3856. Name  : FadeOut              (Fade Out)
  3857. Class : Display
  3858. Level : Clone
  3859.  
  3860. Like CLS, but a bit more fancy, this routine provides an
  3861. interesting way to clear the screen. See also Dissolve.
  3862.  
  3863.    FadeOut VAttr%
  3864.  
  3865. VAttr%   color/attribute to which to clear (see CalcAttr)
  3866.  
  3867. Name  : FarPeek%             (Far memory Peek)
  3868. Class : Memory
  3869. Level : Clone
  3870.  
  3871. This is like the BASIC PEEK function, but expects both a segment
  3872. and an offset, thus doing away with the need for DEF SEG. This
  3873. is especially handy for use in subprograms which might otherwise
  3874. inadvertently change the DEF SEG value expected by the main
  3875. program.
  3876.  
  3877.    Value% = FarPeek%(DSeg%, DOfs%)
  3878.  
  3879. Related routines include FarPeekI%, FarPeekL&, DGetSt, DGetRec.
  3880.  
  3881. DSeg%    segment of the location to look at
  3882. DOfs%    offset of the location to look at
  3883. -------
  3884. Value%   value at the specified memory location (byte: 0-255)
  3885.  
  3886. Name  : FarPeekI%            (Far memory Peek Integer)
  3887. Class : Memory
  3888. Level : Clone
  3889.  
  3890. This is like the BASIC PEEK function, but expects both a segment
  3891. and an offset, thus doing away with the need for DEF SEG. This
  3892. is especially handy for use in subprograms which might otherwise
  3893. inadvertently change the DEF SEG value expected by the main
  3894. program. Unlike PEEK, this routine returns a word (integer)
  3895. rather than a byte.
  3896.  
  3897.    Value% = FarPeekI%(DSeg%, DOfs%)
  3898.  
  3899. Related routines include FarPeek%, FarPeekL&, DGetSt, DGetRec.
  3900.  
  3901. DSeg%    segment of the location to look at
  3902. DOfs%    offset of the location to look at
  3903. -------
  3904. Value%   value at the specified memory location (word)
  3905.  
  3906. Name  : FarPeekL&            (Far memory Peek Long integer)
  3907. Class : Memory
  3908. Level : Clone
  3909.  
  3910. This is like the BASIC PEEK function, but expects both a segment
  3911. and an offset, thus doing away with the need for DEF SEG. This
  3912. is especially handy for use in subprograms which might otherwise
  3913. inadvertently change the DEF SEG value expected by the main
  3914. program. Unlike PEEK, this routine returns a dword (long
  3915. integer) rather than a byte.
  3916.  
  3917.    Value& = FarPeekL&(DSeg%, DOfs%)
  3918.  
  3919. Related routines include FarPeek%, FarPeekI%, DGetSt, DGetRec.
  3920.  
  3921. DSeg%    segment of the location to look at
  3922. DOfs%    offset of the location to look at
  3923. -------
  3924. Value&   value at the specified memory location (dword)
  3925.  
  3926. Name  : FarPoke              (Far memory Poke)
  3927. Class : Memory
  3928. Level : Clone
  3929.  
  3930. This is like the BASIC POKE statement, but expects both a
  3931. segment and an offset, thus doing away with the need for DEF
  3932. SEG. This is especially handy for use in subprograms which might
  3933. otherwise inadvertently change the DEF SEG value expected by the
  3934. main program.
  3935.  
  3936.    FarPoke DSeg%, DOfs%, Value%
  3937.  
  3938. Related routines include FarPokeI, FarPokeL, DPutSt, DPutRec.
  3939.  
  3940. DSeg%    segment of the location to look at
  3941. DOfs%    offset of the location to look at
  3942. Value%   value to store in the given memory posn (byte: 0-255)
  3943.  
  3944. Name  : FarPokeI             (Far memory Poke Integer)
  3945. Class : Memory
  3946. Level : Clone
  3947.  
  3948. This is like the BASIC POKE statement, but expects both a
  3949. segment and an offset, thus doing away with the need for DEF
  3950. SEG. This is especially handy for use in subprograms which might
  3951. otherwise inadvertently change the DEF SEG value expected by the
  3952. main program. Unlike POKE, this routine stores a word or
  3953. integer.
  3954.  
  3955.    FarPokeI DSeg%, DOfs%, Value%
  3956.  
  3957. Related routines include FarPoke, FarPokeL, DPutSt, DPutRec.
  3958.  
  3959. DSeg%    segment of the location to look at
  3960. DOfs%    offset of the location to look at
  3961. Value%   value to store in the given memory posn (word)
  3962.  
  3963. Name  : FarPokeL             (Far memory Poke Long integer)
  3964. Class : Memory
  3965. Level : Clone
  3966.  
  3967. This is like the BASIC POKE statement, but expects both a
  3968. segment and an offset, thus doing away with the need for DEF
  3969. SEG. This is especially handy for use in subprograms which might
  3970. otherwise inadvertently change the DEF SEG value expected by the
  3971. main program. Unlike POKE, this routine stores a dword or long
  3972. integer.
  3973.  
  3974.    FarPokeL DSeg%, DOfs%, Value&
  3975.  
  3976. Related routines include FarPoke, FarPokeI, DPutSt, DPutRec.
  3977.  
  3978. DSeg%    segment of the location to look at
  3979. DOfs%    offset of the location to look at
  3980. Value&   value to store in the given memory posn (dword)
  3981.  
  3982. Name  : FClose1              (File Close)
  3983. Class : Disk
  3984. Level : DOS
  3985.  
  3986. This routine closes a file that was opened by FOpen1 or FCreate.
  3987. It can also be used to close any of the predefined device
  3988. handles.
  3989.  
  3990. These are the predefined device handles that are always
  3991. available:
  3992.  
  3993.    0    CON     stdin     standard input, normally the keyboard
  3994.    1    CON     stdout    standard output, normally the display
  3995.    2    CON     stderr    standard error, almost always display
  3996.    3    AUX     stdaux    auxiliary device, generally COM1
  3997.    4    PRN     stdprn    standard printer, generally LPT1
  3998.  
  3999. If you are running short of handles, you can always close stdaux
  4000. to free up a handle. The stdprn device can also be closed as
  4001. long as you don't use the printer or if you only access the
  4002. printer through LPRINT. It is not a good idea to close stdin,
  4003. stdout, or stderr under normal circumstances.
  4004.  
  4005.    FClose1 Handle%
  4006.  
  4007. Handle%    handle of the file to close
  4008.  
  4009. Name  : FCreate              (File Create)
  4010. Class : Disk
  4011. Level : DOS
  4012.  
  4013. This routine creates a file and opens it for use by the PBClone
  4014. file handling routines. If the file already existed, it will be
  4015. wiped out, so you may want to check beforehand if this is a
  4016. problem. Try the Exist routine.
  4017.  
  4018. The file is opened in read/write mode, allowing both input and
  4019. output.
  4020.  
  4021. You may create the file using any of the following attributes:
  4022.  
  4023.    Normal          0      (nothing special)
  4024.    Read Only       1      file can be read, but not written to
  4025.    Hidden          2      file is "invisible"
  4026.    System          4      special DOS system file
  4027.  
  4028. The attributes can be combined by adding them together. Don't
  4029. use the System attribute unless you know what you're doing!
  4030.  
  4031. Note that this routine does not support file sharing. If that is
  4032. a problem, close the file just after it is created and reopen it
  4033. using FOpen1.
  4034.  
  4035.    FCreate FileName$, FAttr%, Handle%, ErrCode%
  4036.  
  4037. FileName$  name of the file to create
  4038. FAttr%     attribute(s) of the file
  4039. -------
  4040. Handle%    handle by which to access the file (if no error)
  4041. ErrCode%   error code: 0 if no error, else DOS Error
  4042.  
  4043. Name  : FDescRead$           (File Description Read)
  4044. Class : Disk
  4045. Level : DOS
  4046.  
  4047. This routine reads a 4DOS-style file description from disk. If
  4048. there is no description or an error occurs, the result will be a
  4049. null string.
  4050.  
  4051.    FileDesc$ = FDescRead$(FileName$)
  4052.  
  4053. FileName$   file name
  4054. -------
  4055. FileDesc$   description of file, if any
  4056.  
  4057. Name  : FGetLoc              (File Get Location)
  4058. Class : Disk
  4059. Level : DOS
  4060.  
  4061. This routine tells you the position of the file pointer of a
  4062. file that was opened using FOpen1 or FCreate. This pointer is
  4063. used to specify where the next item should be read from or
  4064. written to the file. The first location of the file is at 1.
  4065.  
  4066. See also FGetLoc2, the FUNCTION version of this routine.
  4067.  
  4068.    FGetLoc Handle%, Posn&
  4069.  
  4070. Handle%    handle of the file
  4071. -------
  4072. Posn&      location of the file pointer
  4073.  
  4074. Name  : FGetLoc2&            (File Get Location)
  4075. Class : Disk
  4076. Level : DOS
  4077.  
  4078. This routine tells you the position of the file pointer of a
  4079. file that was opened using FOpen1 or FCreate. This pointer is
  4080. used to specify where the next item should be read from or
  4081. written to the file. The first location of the file is at 1.
  4082.  
  4083. See also FGetLoc, the SUB version of this routine.
  4084.  
  4085.    Posn& = FGetLoc2&(Handle%)
  4086.  
  4087. Handle%    handle of the file
  4088. -------
  4089. Posn&      location of the file pointer
  4090.  
  4091. Name  : FileCopy             (File Copy)
  4092. Class : Disk
  4093. Level : DOS
  4094.  
  4095. This routine copies one or more files, just like the DOS command
  4096. "COPY".
  4097.  
  4098. FileCopy works exactly like the DOS COPY command, except it
  4099. won't append files. You may use wildcards in both source and
  4100. destination file specifications. In the event of an error,
  4101. normal DOS error codes are returned, with two exceptions:
  4102.  
  4103.   -2  attempt to copy files over themselves
  4104.   -1  attempt to copy multiple sources to a single dest file
  4105.  
  4106. See also CopyFile, a simpler routine which doesn't support
  4107. wildcards.
  4108.  
  4109.    FileCopy SrcFile$, DestFile$, FCount%, ByteCount&, ErrCode%
  4110.  
  4111. SrcFile$    source file name(s)
  4112. DestFile$   destination file name(s)
  4113. -------
  4114. FCount%     number of files copied
  4115. ByteCount&  number of bytes copied
  4116. ErrCode%    error code (0 if no error)
  4117.  
  4118. Name  : FileCount            (File Count)
  4119. Class : Disk
  4120. Level : DOS
  4121.  
  4122. This routine returns the number of files which match a given
  4123. file specification and attribute. You need to use this routine
  4124. before LoadDir or LoadDirAll in order to DIM the array to the
  4125. appropriate size.
  4126.  
  4127. The attribute can be any of the usual file attributes:
  4128.    1   Read-Only
  4129.    2   Hidden
  4130.    4   System
  4131.   16   Directory
  4132.  
  4133. You can combine attributes by adding their values. For instance,
  4134. to search for hidden directories, you'd use an attribute of 18.
  4135. By default, DOS returns normal files as well as files which have
  4136. the specified attributes, so an attribute of 18 would get you
  4137. normal files, hidden files, directories, and hidden directories.
  4138. However, FileCount can be made to screen out unwanted files--
  4139. just negate the attribute to force only files of that attribute
  4140. to be counted. For example, an attribute of -18 would return
  4141. only hidden subdirectories.
  4142.  
  4143.    FileCount FileSpec$, FilAttr%, Count%, ErrCode%
  4144.  
  4145. We use FilAttr% instead of FileAttr%, since BASIC has a built-in
  4146. FILEATTR function.
  4147.  
  4148. FileSpec$   search filename (may contain wildcards)
  4149. FilAttr%    search file attribute
  4150. -------
  4151. Count%      number of matching files found
  4152. ErrCode%    error code (0 if no error)
  4153.  
  4154. Name  : FileCRC              (File CRC)
  4155. Class : Disk
  4156. Level : DOS
  4157.  
  4158. This routine calculates a 32-bit CRC for a file. This CRC is
  4159. derived by a formula which takes each character of the file into
  4160. consideration. It provides a powerful (although not 100%
  4161. foolproof) way to verify that a file hasn't changed since you
  4162. last checked.
  4163.  
  4164.    FileCRC FileName$, Result&, ErrCode%
  4165.  
  4166. FileName$   source file name(s)
  4167. -------
  4168. Result&     32-bit CRC of the file
  4169. ErrCode%    error code (0 if no error)
  4170.  
  4171. Name  : FileMenu             (File Menu)
  4172. Class : Input
  4173. Level : Clone
  4174.  
  4175. This routine provides a list of files according to the filespec
  4176. and attribute you pass it and allows the user to pick a single
  4177. file from the resulting list. The filespec may contain a full
  4178. path and wildcards. The attribute may be negated if you insist
  4179. on an exact match (directories only, for example), or use a
  4180. normal attribute for multiple matches (directories and files,
  4181. for instance). Many of the usual WindowManager parameters are
  4182. used here-- top row, left column, and bottom row (right column
  4183. is calculated for you), window frame color and frame type,
  4184. growth, shadow, title string and title color-- see the
  4185. WindowManager routine for details. For a description of file
  4186. search attributes, see the FindFirstFx routine.
  4187.  
  4188. If you allow using the mouse, be sure the mouse is initialized
  4189. (MMCheck or MMCheck2%) and the mouse cursor is visible
  4190. (MMCursorOn) before calling this routine.
  4191.  
  4192. This routine automatically saves and restores the underlying
  4193. screen. It can handle up to 2,048 files in a window. See
  4194. CalcAttr if you're not familiar with color/attributes.
  4195.  
  4196.    FileMenu Mouse%, FileSpec$, SeekAttr%, TopRow%, LeftCol%, _
  4197.       BottomRow%, Frame%, FrameAttr%, FileListAttr%, _
  4198.       HiliteAttr%, TitleFore%, Title$, Grow%, Shade%
  4199.  
  4200. Mouse%          whether to support the mouse (0 no, -1 yes)
  4201. FileSpec$       filespec to use in creating the file list
  4202. SeekAttr%       file search attribute to use in creating list
  4203. TopRow%         top row of pick window
  4204. LeftCol%        left column of pick window
  4205. BottomRow%      bottom row of pick window
  4206. Frame%          frame type
  4207. FrameAttr%      frame color/attribute
  4208. FileListAttr%   file list color/attribute
  4209. HiliteAttr%     highlight bar color/attribute
  4210. TitleFore%      title foreground color (backgnd is frame color)
  4211. Title$          title (use "" for no title)
  4212. Grow%           window growth
  4213. Shade%          window shadow
  4214. -------
  4215. FileSpec$       file picked ("" if none)
  4216.  
  4217. Name  : FindFirstA           (Find First file in an Archive)
  4218. Class : Disk
  4219. Level : DOS
  4220.  
  4221. The FindFirstA routine is used to find the first file that
  4222. matches search parameters which you specify. Various information
  4223. about the file that matches (if any) can be retrieved by other
  4224. routines.
  4225.  
  4226. Rather than working on a directory, this routine works on files
  4227. in an archive. Supported archive formats include ARC, ARJ, LZH,
  4228. PAK, ZIP and ZOO. Self-extracting archives in ARJ, LHARC, and
  4229. PKZIP (ZIP2EXE) form are also supported, as either .COM or .EXE
  4230. files. If no extension is given, a search will be made through
  4231. each valid archive extension, and the first matching archive
  4232. will be used for the file search.
  4233.  
  4234. Archive names may contain drive and subdirectory specs, but not
  4235. wildcards. File names may contain wildcards, but not drive or
  4236. subdir specs.
  4237.  
  4238. When you are done searching, be sure to use CloseA to terminate
  4239. the search.
  4240.  
  4241. Routines in this series include:
  4242.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4243.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4244.  
  4245.    FindFirstA ArcName$, FileName$, ErrCode%
  4246.  
  4247. ArcName$    name of archive to search through
  4248. FileName$   name of file(s) for which to search
  4249. -------
  4250. ErrCode%    error code (0 if no error, else no matching files)
  4251.  
  4252. Name  : FindFirstF           (Find First File)
  4253. Class : Disk
  4254. Level : DOS
  4255.  
  4256. This is part of a set of routines included for compatibility
  4257. with ADVBAS and ProBas. A better solution may be found in
  4258. FindFirstFx.
  4259.  
  4260. The FindFirstF routine is used to find the first file that
  4261. matches search parameters which you specify. Various information
  4262. about the file that matches (if any) can be retrieved by other
  4263. routines. See also FindNextF.
  4264.  
  4265. The file name specified may contain a drive and subdirectory
  4266. specification. Wildcards are also allowed.
  4267.  
  4268. Possible search attributes are as follows:
  4269.  
  4270.    Normal          0      (nothing special)
  4271.    Hidden          2      file is "invisible"
  4272.    System          4      special DOS system file
  4273.    Subdirectory   16      subdirectory
  4274.  
  4275. You can combine the attributes by adding them together. All
  4276. searches will match if any of the specified attributes are
  4277. found, so if you're looking only for a specific attribute, you
  4278. will need to test the results using GetAttrF.
  4279.  
  4280. Routines in this series include:
  4281.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4282.    GetTimeF, GetSizeFL
  4283.  
  4284.    FindFirstF FileName$, FAttr%, ErrCode%
  4285.  
  4286. FileName$   name of file(s) for which to search
  4287. FAttr%      file attribute(s) to seek
  4288. -------
  4289. ErrCode%    error code (0 if no error, else no matching files)
  4290.  
  4291. Name  : FindFirstFx          (Find First File, Extended)
  4292. Class : Disk
  4293. Level : DOS
  4294.  
  4295. The FindFirstFx routine is used to find the first file that
  4296. matches search parameters which you specify. Various information
  4297. about the file that matches (if any) can be retrieved by other
  4298. routines.
  4299.  
  4300. The file name specified may contain a drive and subdirectory
  4301. specification. Wildcards are also allowed.
  4302.  
  4303. Possible search attributes are as follows:
  4304.  
  4305.    Normal          0      (nothing special)
  4306.    Read Only       1      file can be read, but not written to
  4307.    Hidden          2      file is "invisible"
  4308.    System          4      special DOS system file
  4309.    Subdirectory   16      subdirectory
  4310.  
  4311. You can combine the attributes by adding them together. All
  4312. searches will match if any of the specified attributes are
  4313. found, so if you're looking only for a specific attribute, you
  4314. will need to test the results using GetAttrFx.
  4315.  
  4316. Routines in this series include:
  4317.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4318.    GetTimeFx$, GetSizeFx&
  4319.  
  4320. These routines differ from the older FindFirstF-based series in
  4321. two major respects. They include a Buffer$ parameter, which
  4322. allows you to have more than one search going on at a time. This
  4323. makes it safe to use these routines in subprograms without
  4324. conflict with the main program. It also allows you to search
  4325. entire subdirectory trees recursively. The other major
  4326. difference is that many of these routines are coded as functions
  4327. for greater convenience.
  4328.  
  4329.    Buffer$ = SPACE$(64)
  4330.    FindFirstFx Buffer$, FileName$, FAttr%, ErrCode%
  4331.  
  4332. FileName$   name of file(s) for which to search
  4333. FAttr%      file attribute(s) to seek
  4334. -------
  4335. Buffer$     buffer used in search (init to 64 characters)
  4336. ErrCode%    error code (0 if no error, else no matching files)
  4337.  
  4338. Name  : FindNextA            (Find Next file in an Archive)
  4339. Class : Disk
  4340. Level : DOS
  4341.  
  4342. This routine is for use after FindFirstA, to find any additional
  4343. archived files which may match your search specifications.
  4344.  
  4345. Routines in this series include:
  4346.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4347.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4348.  
  4349.    FindNextA ErrCode%
  4350.  
  4351. -------
  4352. ErrCode%    error code (0 if no error, else no matching files)
  4353.  
  4354. Name  : FindNextF            (Find Next File)
  4355. Class : Disk
  4356. Level : DOS
  4357.  
  4358. This routine is for use after FindFirstF, to find any additional
  4359. files which may match your search specifications.
  4360.  
  4361. Routines in this series include:
  4362.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4363.    GetTimeF, GetSizeFL
  4364.  
  4365.    FindNextF ErrCode%
  4366.  
  4367. -------
  4368. ErrCode%    error code (0 if no error, else no matching files)
  4369.  
  4370. Name  : FindNextFx           (Find Next File, Extended)
  4371. Class : Disk
  4372. Level : DOS
  4373.  
  4374. This routine is for use after FindFirstFx, to find any
  4375. additional files which may match your search specifications.
  4376.  
  4377. Routines in this series include:
  4378.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4379.    GetTimeFx$, GetSizeFx&
  4380.  
  4381.    FindNextFx Buffer$, ErrCode%
  4382.  
  4383. Buffer$     buffer used in search
  4384. -------
  4385. Buffer$     updated buffer
  4386. ErrCode%    error code (0 if no error, else no matching files)
  4387.  
  4388. Name  : FindPatch            (Find Patch location)
  4389. Class : Disk
  4390. Level : DOS
  4391.  
  4392. This is one of a set of routines that allow you to write
  4393. self-modifying code. Your program can patch DATA statements in
  4394. itself or in another program, allowing you to save configuration
  4395. information (for example) without having to create additional
  4396. data files.
  4397.  
  4398. In order for this routine to work, you must have a series of
  4399. DATA statements containing quoted strings of the maximum desired
  4400. length. The first DATA statement must contain a unique string,
  4401. as FindPatch will use it to locate the data block. Note that if
  4402. your program is patching itself, you must READ the unique string
  4403. rather than assigning it directly, to make sure it's unique. The
  4404. string must exist at only one place in the program.
  4405.  
  4406. See the PATCHER.BAS file if you would like clarification. This
  4407. little demo program, when compiled, will patch itself with
  4408. whatever you enter on the command line. For instance, if you
  4409. type PATCHER BANANA, it will store "BANANA" in its DATA
  4410. statement. PDEMO will not work in the QuickBASIC environment, of
  4411. course. You must compile it to an .EXE file.
  4412.  
  4413. You may compile the program using any switches. You may not use
  4414. the /E (/EXEPACK) switch for LINK, though, as this may alter the
  4415. program DATA area. Likewise, you must not use compression
  4416. utilities such as PKLite on the program.
  4417.  
  4418. Routines in this set include FindPatch, SetPatch, PatchDone.
  4419.  
  4420.    FindPatch FileName$, SearchSt$, ErrCode%
  4421.  
  4422. FileName$     name of the file to patch
  4423. SearchSt$     value of the first DATA statement
  4424. MoveBack%     not used
  4425. -------
  4426. ErrCode%      whether search worked (0 yes, <0 no, >0 Error)
  4427.  
  4428. Name  : FLock                (File Lock)
  4429. Class : Disk
  4430. Level : DOS
  4431.  
  4432. This routine locks any part of a file. It will typically be used
  4433. for random-access files in circumstances where the file needs to
  4434. be accessed by multiple programs at the same time. This routine
  4435. lets you lock just the part of the file you need to access,
  4436. allowing other programs to work with other parts of the file at
  4437. the same time. It is best to maintain the lock for the shortest
  4438. time possible, in case someone else needs the same data. The
  4439. ideal technique is to lock the area, read what data you need,
  4440. write any changes, and unlock the area as a single program
  4441. block.
  4442.  
  4443. Note that it is IMPORTANT to unlock the locked area before the
  4444. file is closed and before your program terminates. If the file
  4445. is not properly unlocked, it may be damaged. See also FUnlock.
  4446.  
  4447. This routine is used for occasions where you expect multiple
  4448. accesses to a single file, under networking or multitasking
  4449. conditions. For less demanding file sharing, it is safer to
  4450. simply lock the entire file when you open it-- see FOpen.
  4451.  
  4452.    FLock FileHandle%, StartPosn&, Bytes&, ErrCode%
  4453.  
  4454. FileHandle%    file handle
  4455. StartPosn&     starting offset (1 for first position)
  4456. Bytes&         number of bytes to lock
  4457. -------
  4458. ErrCode%       error code (0 if no error, else DOS error code)
  4459.  
  4460. Name  : FloorD#              (Floor, Double-precision)
  4461. Class : String
  4462. Level : Any
  4463.  
  4464. This function returns the largest integer less than or equal to
  4465. the number you give it. This is most often used for rounding.
  4466.  
  4467.    Result# = FloorD#(Nr#)
  4468.  
  4469. Nr#          number to process
  4470. -------
  4471. Result#      result
  4472.  
  4473. Name  : FloorS!              (Floor, Single-precision)
  4474. Class : String
  4475. Level : Any
  4476.  
  4477. This function returns the largest integer less than or equal to
  4478. the number you give it. This is most often used for rounding.
  4479.  
  4480.    Result! = FloorS!(Nr!)
  4481.  
  4482. Nr!          number to process
  4483. -------
  4484. Result!      result
  4485.  
  4486. Name  : Floppies             (Floppies installed)
  4487. Class : Equipment / Disk
  4488. Level : BIOS
  4489.  
  4490. The Floppies routine tells you how many floppy drives are
  4491. installed (0-4). See also Floppies2, a function version of this
  4492. routine.
  4493.  
  4494.    Floppies Drives%
  4495.  
  4496. -------
  4497. Drives%  number of floppy disk drives installed
  4498.  
  4499. Name  : Floppies2%           (Floppies installed)
  4500. Class : Equipment / Disk
  4501. Level : BIOS
  4502.  
  4503. The Floppies2 routine tells you how many floppy drives are
  4504. installed (0-4).
  4505.  
  4506.    Drives% = Floppies2%
  4507.  
  4508. -------
  4509. Drives%  number of floppy disk drives installed
  4510.  
  4511. Name  : FloppyType           (Floppy drive Type)
  4512. Class : Equipment / Disk
  4513. Level : Clone (AT)
  4514.  
  4515. This routine tells you what kinds of floppy drives are
  4516. installed, if any. A code is returned for each drive, as
  4517. follows:
  4518.  
  4519.    0    no drive
  4520.    1    5 1/4"    360K
  4521.    2    5 1/4"    1.2M
  4522.    3    3 1/2"    720K
  4523.    4    3 1/2"    1.44M
  4524.    5    3 1/2"    2.88M
  4525.  
  4526. Note that this routine supports a maximum of only two drives. It
  4527. is possible for a machine to have up to four drives, but there
  4528. is not currently any good way to find out about them.
  4529.  
  4530. FloppyType should only be used on AT-class machines. It will not
  4531. work on PC/XT computers and may cause unusual results if used on
  4532. such machines. It will also not work on some of the earliest AT
  4533. clone machines which didn't adhere to the standard CMOS format.
  4534.  
  4535.    FloppyType DriveA%, DriveB%
  4536.  
  4537. -------
  4538. DriveA%    drive type of first floppy drive
  4539. DriveB%    drive type of second floppy drive
  4540.  
  4541. Name  : FlushToDisk          (Flush file buffers To Disk)
  4542. Class : Disk
  4543. Level : DOS
  4544.  
  4545. This is a "file safety" routine for use with files opened by
  4546. FOpen1 or FCreate. Files are normally buffered by DOS, which
  4547. makes file handling faster but creates the danger of losing the
  4548. file if there is a crash or power outage. By flushing the file
  4549. to disk, you insure that it is updated to the current moment.
  4550.  
  4551. Note: this routine will need to temporarily create a new file
  4552. handle if DOS versions before 4.0 are used.
  4553.  
  4554.    FlushToDisk Handle%, ErrCode%
  4555.  
  4556. Handle%    handle of the file to flush
  4557. -------
  4558. ErrCode%   error code: 0 if none, else DOS Error
  4559.  
  4560. Name  : FOpen1               (File Open)
  4561. Class : Disk
  4562. Level : DOS
  4563.  
  4564. This routine opens an existing file for use with the PBClone
  4565. file handling routines. If you need to create a file that
  4566. doesn't already exist, use the FCreate routine instead.
  4567.  
  4568. The file may be opened for reading, writing, or both:
  4569.  
  4570.    0   Read
  4571.    1   Write
  4572.    2   Read/Write
  4573.  
  4574. You may specify a file sharing mode for use with networks and
  4575. multitaskers. This will only take effect if the DOS version is
  4576. 3.0 or later and if the DOS SHARE utility has been executed.
  4577. Otherwise, it will be ignored.
  4578.  
  4579.    0   Normal       compatibility mode: no file sharing
  4580.    1   Exclusive    no one else may access the file
  4581.    2   Deny Write   no one else may write to the file
  4582.    3   Deny Read    no one else may read from the file
  4583.    4   Deny None    anyone else may read from or write to file
  4584.  
  4585. Most of the time, "Deny Write" will be appropriate. This allows
  4586. others to read the file, but not to modify the file on you
  4587. unexpectedly.
  4588.  
  4589. See the discussion of predefined device handles at FClose1.
  4590.  
  4591.    FOpen1 FileName$, ReadWrite%, Sharing%, Handle%, ErrCode%
  4592.  
  4593. FileName$   name of the file to open
  4594. ReadWrite%  whether you want input, output, or both (see above)
  4595. Sharing%    file sharing mode (see above)
  4596. -------
  4597. Handle%    handle by which to access the file (if no error)
  4598. ErrCode%   error code: 0 if no error, else DOS Error
  4599.  
  4600. Name  : ForceMatch$          (Force Match of file to wildcard)
  4601. Class : Disk
  4602. Level : Any
  4603.  
  4604. The ForceMatch$ function allows you to mimic DOS commands that
  4605. operate on source file(s) and destination file(s). It forces a
  4606. source file name to match a specified pattern (which may contain
  4607. wildcards), producing an appropriate destination file name.
  4608.  
  4609. For example, if the source is "TESTNAME.BAS" and the pattern is
  4610. "?RUE*.*", the result would be "TRUENAME.BAS".
  4611.  
  4612. Consider the DOS command "COPY *.BAS A:*.BAK". The "*.BAK" part
  4613. is the desired pattern. The "*.BAS" part specifies which files
  4614. to copy to the new pattern. Each filename that matches "*.BAS"
  4615. is translated through the "*.BAK" pattern to give the
  4616. destination filename. The ForceMatch$ function is designed to do
  4617. this sort of translation for you.
  4618.  
  4619.    DestFile$ = ForceMatch$(Pattern$, SrcFile$)
  4620.  
  4621. Pattern$   pattern of desired file name (may contain wildcards)
  4622. SrcFile$   file name to force through the pattern
  4623. -------
  4624. DestFile$  resulting file name
  4625.  
  4626. Name  : FormatDate           (Format Date)
  4627. Class : Time
  4628. Level : Any
  4629.  
  4630. This is a highly flexible date formatting routine. It accepts a
  4631. date in one of the usual American formats ("03-22-1990",
  4632. "03/22/90", or even "3/22/90") and converts it according to a
  4633. format string. This format string allows you to normalize the
  4634. date, select a new delimiter, choose between two-digit and
  4635. four-digit years, and even change the order from month/day/year
  4636. to anything else. An error code will be returned if the date is
  4637. not valid.
  4638.  
  4639. The format string can be as simple as "##/##/##", which
  4640. specifies that the usual month/day/year order be used, with a
  4641. delimiter of "/" and a two-digit year. If you want to change the
  4642. date order, you would need a format like "DD.MM.YYYY" instead.
  4643. For sorting or storage, you might want to convert the date to a
  4644. plain number, using a format string like "YYYYMMDD". The result
  4645. could then be converted to a LONG with the BASIC VAL function.
  4646.  
  4647.    FormatDate DateSt$, Format$, Result$, ErrCode%
  4648.  
  4649. DateSt$     date to format (month, day, year order)
  4650. Format$     format for the date
  4651. -------
  4652. Result$     resulting date
  4653. ErrCode     whether the date is valid (0 ok)
  4654.  
  4655. Name  : FormatPhone$         (Format Phone number)
  4656. Class : String
  4657. Level : Any
  4658.  
  4659. This function formats a phone number using the standard U.S.
  4660. notation. The phone number is passed as a string. This string is
  4661. screened of any invalid phone number characters and is then
  4662. formatted according to its length into one of the following:
  4663.  
  4664.    "1234"
  4665.    "555-1234"
  4666.    "(303) 555-1234"
  4667.  
  4668. Valid characters are all digits and letters except for Q and Z.
  4669. Letters are capitalized by the routine. A leading "1" may be
  4670. present if there is an area code-- if so, it is removed. Phone
  4671. numbers which are the wrong length will cause a null string ("")
  4672. to be returned.
  4673.  
  4674. See also StripChar, which will allow you to undo formatting.
  4675.  
  4676.    Phone$ = FormatPhone$(RawNr$)
  4677.  
  4678. RawNr$      unformatted phone number
  4679. -------
  4680. Phone$      formatted phone number ("" if invalid)
  4681.  
  4682. Name  : FReadLine            (File Read Line)
  4683. Class : Disk
  4684. Level : DOS
  4685.  
  4686. This routine works like LINE INPUT-- it reads in an entire line
  4687. of text from a file. The Dest$ variable must be set to the
  4688. desired maximum length beforehand. On return, the number of
  4689. characters is returned in DLen%, and TooLong% will be set if the
  4690. Dest$ variable is full and a carriage return/linefeed pair was
  4691. not (yet?) found.
  4692.  
  4693.    Dest$ = SPACE$(MaxLength%)
  4694.    FReadLine Handle%, Dest$, DLen%, TooLong%, ErrCode%
  4695.    Dest$ = LEFT$(Dest$, DLen%)
  4696.  
  4697. Handle%    handle of the file
  4698. -------
  4699. Dest$      result (init to max length first)
  4700. DLen%      number of characters in result
  4701. TooLong%   zero if we read it all, -1 if CR/LF not found
  4702. ErrCode%   zero if no error, else DOS error code
  4703.  
  4704. Name  : FromPostal$          (From Postal Abbreviation)
  4705. Class : String
  4706. Level : Any
  4707.  
  4708. This function returns the state name corresponding to a given
  4709. two-letter postal abbreviation. It handles all U.S. postal
  4710. abbreviations, including states (e.g., "AZ" = "Arizona") and a
  4711. number of other countries (e.g., "PR" = "Puerto Rico"). A null
  4712. string ("") is returned if the specified abbreviation is not a
  4713. valid code.
  4714.  
  4715. The conversion can also be done the other way around-- see the
  4716. ToPostal$ function.
  4717.  
  4718.    PlaceName$ = FromPostal$(Abbrev$)
  4719.  
  4720. Abbrev$      two-letter postal abbreviation
  4721. -------
  4722. PlaceName$   place name corresponding with abbreviation
  4723.  
  4724. Name  : FSetEnd              (File Set to End)
  4725. Class : Disk
  4726. Level : DOS
  4727.  
  4728. This moves the file pointer to the end of the file. It is for
  4729. use with files opened by FOpen1 or FCreate. The usual purpose
  4730. for this is to append information to an existing file.
  4731.  
  4732. Note that some text files may have a Control-Z or CHR$(26) on
  4733. the end. For historical reasons, this character is sometimes
  4734. used as an "end of file" marker. When dealing with text files,
  4735. you may want to examine the last character of the file to make
  4736. sure it isn't a Control-Z.
  4737.  
  4738. Some of Microsoft's BASIC compilers are among the programs
  4739. which, unfortunately, put a Control-Z at the end of a file (if
  4740. you OPEN for OUTPUT).
  4741.  
  4742.    FSetEnd Handle%
  4743.  
  4744. Handle%    handle of the file
  4745.  
  4746. Name  : FSetLoc              (File Set Location to byte)
  4747. Class : Disk
  4748. Level : DOS
  4749.  
  4750. This moves the file pointer to a specified position in the file.
  4751. It is for use with files opened by FOpen1 or FCreate. File
  4752. positions are considered to start at 1.
  4753.  
  4754.    FSetLoc Handle%, Posn&
  4755.  
  4756. Handle%    handle of the file
  4757. Posn&      location to which to move
  4758.  
  4759. Name  : FSetOfs              (File Set location by Offset)
  4760. Class : Disk
  4761. Level : DOS
  4762.  
  4763. This moves the file pointer backwards or forwards in the file.
  4764. It is for use with files opened by FOpen1 or FCreate.
  4765.  
  4766.    FSetOfs Handle%, Offset&
  4767.  
  4768. Handle%    handle of the file
  4769. Offset&    number of bytes by which to move
  4770.  
  4771. Name  : FSetRec              (File Set location to Record)
  4772. Class : Disk
  4773. Level : DOS
  4774.  
  4775. This sets the file pointer to a specific record in the file. It
  4776. is for use with files opened by FOpen1 or FCreate.
  4777.  
  4778. This routine provides the same function as FSetLoc, but is a bit
  4779. more convenient for dealing with files composed of fixed-length
  4780. records.
  4781.  
  4782.    FSetRec Handle%, RecSize%, RecNr%
  4783.  
  4784. Handle%    handle of the file
  4785. RecSize%   number of bytes per record
  4786. RecNr%     number of record (starting at 1)
  4787.  
  4788. Name  : FSetSize             (File Set Size)
  4789. Class : Disk
  4790. Level : DOS
  4791.  
  4792. Many people have asked how to delete information from a file.
  4793. Well, there's no straightforward way to do it most of the time,
  4794. but if the record is at the end of the file, you can chop it
  4795. right off.
  4796.  
  4797. This routine can also be used to make a file larger, perhaps
  4798. pre-allocating space that will be used later (for better speed).
  4799.  
  4800. The file in question must have been opened by FCreate or FOpen1.
  4801.  
  4802.    FSetSize Handle%, Bytes&
  4803.  
  4804. Handle%    handle of the file
  4805. Bytes&     desired file size, in bytes
  4806.  
  4807. Name  : FSize                (File get Size)
  4808. Class : Disk
  4809. Level : DOS
  4810.  
  4811. This routine allows you to get the size of a file that was
  4812. opened by FOpen1 or FCreate.
  4813.  
  4814. See also FSize2, the FUNCTION version of this routine.
  4815.  
  4816.    FSize Handle%, Bytes&
  4817.  
  4818. Handle%    handle of the file
  4819. -------
  4820. Bytes&     file size, in bytes
  4821.  
  4822. Name  : FSize2&              (File get Size)
  4823. Class : Disk
  4824. Level : DOS
  4825.  
  4826. This routine allows you to get the size of a file that was
  4827. opened by FOpen1 or FCreate.
  4828.  
  4829. See also FSize, the Sub version of this routine.
  4830.  
  4831.    Bytes& = FSize2&(Handle%)
  4832.  
  4833. Handle%    handle of the file
  4834. -------
  4835. Bytes&     file size, in bytes
  4836.  
  4837. Name  : FUnlock              (File Unlock)
  4838. Class : Disk
  4839. Level : DOS
  4840.  
  4841. This routine unlocks any part of a file. It is used to undo the
  4842. effects of FLock, which locks any part of a file. It is
  4843. important to pass the exact same parameters to FUnlock as you
  4844. did to FLock. See also FLock.
  4845.  
  4846. Note that it is IMPORTANT to unlock the locked area before the
  4847. file is closed and before your program terminates. If the file
  4848. is not properly unlocked, it may be damaged.
  4849.  
  4850.    FUnlock FileHandle%, StartPosn&, Bytes&, ErrCode%
  4851.  
  4852. FileHandle%    file handle
  4853. StartPosn&     starting offset (1 for first position)
  4854. Bytes&         number of bytes to unlock
  4855. -------
  4856. ErrCode%       error code (0 if no error, else DOS error code)
  4857.  
  4858. Name  : Get4DOSv             (Get 4DOS Version)
  4859. Class : Equipment
  4860. Level : DOS
  4861.  
  4862. The Get4DOSv routine returns the version of 4DOS being used. It
  4863. returns the results as two integers containing the major and
  4864. minor version numbers. For instance, 4DOS 4.0 would return a
  4865. major number of 4, minor 0. If 4DOS is not installed, both
  4866. version numbers will be zero.
  4867.  
  4868. If you're not familiar with 4DOS, it's a terrific improved
  4869. replacement for COMMAND.COM. For more information, write JP
  4870. Software Inc., P.O. Box 1470, Arlington MA 02174, or call your
  4871. local BBS.
  4872.  
  4873.    Get4DOSv MajorV%, MinorV%
  4874.  
  4875. -------
  4876. MajorV%   major part of the 4DOS version
  4877. MinorV%   minor part of the 4DOS version
  4878.  
  4879. Name  : GetAttrF             (Get Attribute of File)
  4880. Class : Disk
  4881. Level : DOS
  4882.  
  4883. The GetAttrF routine returns the attributes of a file matched by
  4884. FindFirstF or FindNextF.
  4885.  
  4886.    Normal          0      (nothing special)
  4887.    Read Only       1      file can be read, but not written to
  4888.    Hidden          2      file is "invisible"
  4889.    System          4      special DOS system file
  4890.    Subdirectory   16      subdirectory
  4891.    Archive        32      (used by some backup utilities)
  4892.  
  4893. You can see if a certain value is set using the AND operator:
  4894.  
  4895.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4896.  
  4897. Since the values are all powers of two, the AND operator makes
  4898. for a convenient way of decoding the results.
  4899.  
  4900. See also the ExplainFAttr$ function, which decodes the meanings
  4901. of the attribute for you.
  4902.  
  4903. Routines in this series include:
  4904.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4905.    GetTimeF, GetSizeFL
  4906.  
  4907.    GetAttrF FAttr%
  4908.  
  4909. -------
  4910. FAttr%   attributes that are set
  4911.  
  4912. Name  : GetAttrFx%           (Get Attribute of File, Extended)
  4913. Class : Disk
  4914. Level : DOS
  4915.  
  4916. The GetAttrFx% function returns the attributes of a file matched
  4917. by FindFirstFx or FindNextFx.
  4918.  
  4919.    Normal          0      (nothing special)
  4920.    Read Only       1      file can be read, but not written to
  4921.    Hidden          2      file is "invisible"
  4922.    System          4      special DOS system file
  4923.    Subdirectory   16      subdirectory
  4924.    Archive        32      (used by some backup utilities)
  4925.  
  4926. You can see if a certain value is set using the AND operator:
  4927.  
  4928.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4929.  
  4930. Since the values are all powers of two, the AND operator makes
  4931. for a convenient way of decoding the results.
  4932.  
  4933. See also the ExplainFAttr$ function, which decodes the meanings
  4934. of the attribute for you.
  4935.  
  4936. Routines in this series include:
  4937.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4938.    GetTimeFx$, GetSizeFx&
  4939.  
  4940.    FAttr% = GetAttrFx%(Buffer$)
  4941.  
  4942. Buffer$   buffer used in search
  4943. -------
  4944. FAttr%    file attributes
  4945.  
  4946. Name  : GetColor             (Get Color)
  4947. Class : Display
  4948. Level : Clone
  4949.  
  4950. This routine tells you the current default foreground and
  4951. background colors being used by BASIC. It should be used only in
  4952. text modes.
  4953.  
  4954.    GetColor Foreground%, Background%
  4955.  
  4956. -------
  4957. Foreground%   foreground color
  4958. Background%   background color
  4959.  
  4960. Name  : GetCommAddr          (Get Comm Address)
  4961. Class : Serial
  4962. Level : Clone
  4963.  
  4964. This routine allows you to determine the base port address of a
  4965. serial port. You tell it the COM port number (1-4) and it
  4966. returns the port address. If there is no port installed, zero
  4967. will be returned.
  4968.  
  4969. Note that ports are "supposed" to be assigned sequentially-- in
  4970. other words, if you find a "zero" port address, there will be no
  4971. ports after that. This is not necessarily the case, however.
  4972. Some semi-standard machines may have a COM2 without a COM1, for
  4973. instance. QuickBASIC gets confused in that case, but it's no
  4974. problem with my PBClone or BasWiz libraries.
  4975.  
  4976. Aside from purely informational purposes, this routine can be
  4977. useful in conjunction with SetCommAddr in manipulating the
  4978. serial ports.
  4979.  
  4980.    GetCommAddr PortNr%, PortAddr%
  4981.  
  4982. PortNr%     COM port number (1-4)
  4983. -------
  4984. PortAddr%   port address
  4985.  
  4986. Name  : GetCRCA              (Get CRC of Archive file)
  4987. Class : Disk / Time
  4988. Level : DOS
  4989.  
  4990. GetCRCA returns the 16-bit CRC of an archived file matched by
  4991. the FindFirstA or FindNextA routines. Since some archives use
  4992. 32-bit CRCs, you may wish to use the more generic version of
  4993. this routine, GetCRCAL.
  4994.  
  4995. Routines in this series include:
  4996.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4997.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4998.  
  4999.    GetCRCA CRC16%
  5000.  
  5001. -------
  5002. CRC16%     16-bit CRC
  5003.  
  5004. Name  : GetCRCAL             (Get CRC of Archive file as Long)
  5005. Class : Disk / Time
  5006. Level : DOS
  5007.  
  5008. GetCRCAL returns the 32-bit CRC of an archived file matched by
  5009. the FindFirstA or FindNextA routines. If the archive only has a
  5010. 16-bit CRC, the result is converted to 32 bits, so this routine
  5011. works with all archives.
  5012.  
  5013. Routines in this series include:
  5014.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5015.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5016.  
  5017.    GetCRCAL CRC32%
  5018.  
  5019. -------
  5020. CRC32%     32-bit CRC
  5021.  
  5022. Name  : GetCRT               (Get CRT)
  5023. Class : Display / Equipment
  5024. Level : Clone
  5025.  
  5026. The GetCRT routine simply tells you whether the current display
  5027. is capable of handling colors or not. An unsophisticated
  5028. routine, GetCRT assumes that if the display is an MDA/Hercules,
  5029. it can't do color, but otherwise it can.
  5030.  
  5031. See also GetEGA, GetHGA and GetVGA.
  5032.  
  5033.    GetCRT Colour%
  5034.  
  5035. -------
  5036. Colour%   whether the display is color (0 if no)
  5037.  
  5038. Name  : GetCRT2%             (Get CRT)
  5039. Class : Display / Equipment
  5040. Level : Clone
  5041.  
  5042. The GetCRT2 routine simply tells you whether the current display
  5043. is capable of handling colors or not. An unsophisticated
  5044. routine, GetCRT2 assumes that if the display is an MDA/Hercules,
  5045. it can't do color, but otherwise it can.
  5046.  
  5047. See also GetEGA, GetHGA and GetVGA.
  5048.  
  5049.    Colour% = GetCRT%
  5050.  
  5051. -------
  5052. Colour%   whether the display is color (0 if no)
  5053.  
  5054. Name  : GetDateA             (Get Date of Archive file)
  5055. Class : Disk / Time
  5056. Level : DOS
  5057.  
  5058. GetDateA returns the date of a archived file matched by the
  5059. FindFirstA or FindNextA routines.
  5060.  
  5061. Routines in this series include:
  5062.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5063.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5064.  
  5065.    GetDateA MonthNr%, DayNr%, YearNr%
  5066.  
  5067. -------
  5068. MonthNr%    month
  5069. DayNr%      day
  5070. YearNr%     year
  5071.  
  5072. Name  : GetDateAT            (Get Date from AT clock)
  5073. Class : Time
  5074. Level : BIOS (AT)
  5075.  
  5076. This routine gets the date from the hardware real-time clock in
  5077. AT-class computers. Depending on the DOS version, this date may
  5078. be partially or completely independent of the date kept by DOS
  5079. in software. DOS always reads the date from the hardware clock
  5080. when it starts up. However, use of the DATE command in DOS (and
  5081. the DATE$ function in QuickBASIC) may relate only to the
  5082. software copy of the date, which is not always guaranteed to be
  5083. the same as the date in the hardware clock due to certain
  5084. discrepancies in DOS.
  5085.  
  5086.    GetDateAT MonthNr%, DayNr%, YearNr%, ErrCode%
  5087.  
  5088. -------
  5089. MonthNr%     month number (1-12)
  5090. DayNr%       day (1-31)
  5091. YearNr%      year (1980-2079)
  5092. ErrCode%     error code: 0 if no error, else clock has stopped
  5093.  
  5094. Name  : GetDateF             (Get Date of File)
  5095. Class : Disk / Time
  5096. Level : DOS
  5097.  
  5098. The GetDateF routine returns the date of a file matched by
  5099. FindFirstF or FindNextF.
  5100.  
  5101. Routines in this series include:
  5102.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5103.    GetTimeF, GetSizeFL
  5104.  
  5105.    GetDateF MonthNr%, DayNr%, YearNr%
  5106.  
  5107. -------
  5108. MonthNr%    month
  5109. DayNr%      day
  5110. YearNr%     year
  5111.  
  5112. Name  : GetDateFx$           (Get Date of File, Extended)
  5113. Class : Disk / Time
  5114. Level : DOS
  5115.  
  5116. The GetDateFx$ function returns the date of a file matched by
  5117. FindFirstFx or FindNextFx.
  5118.  
  5119. Routines in this series include:
  5120.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5121.    GetTimeFx$, GetSizeFx&
  5122.  
  5123.    FileDate$ = GetDateFx$(Buffer$)
  5124.  
  5125. Buffer$     buffer used in search
  5126. -------
  5127. FileDate$   date of file (e.g., "02-28-1991")
  5128.  
  5129. Name  : GetDOSv              (Get DOS Version)
  5130. Class : Equipment
  5131. Level : DOS
  5132.  
  5133. The GetDOSv routine tells you what version of DOS you're using.
  5134. It returns the results as two integers containing the major and
  5135. minor version numbers. For instance, MS-DOS 2.11 would return a
  5136. major number of 2, minor 11.
  5137.  
  5138. The OS/2 compatibility box returns version numbers beginning at
  5139. 10.00. For instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0
  5140. returns 20.00.
  5141.  
  5142.    GetDOSv MajorV%, MinorV%
  5143.  
  5144. -------
  5145. MajorV%   major part of the DOS version
  5146. MinorV%   minor part of the DOS version
  5147.  
  5148. Name  : GetDrive$            (Get default Drive)
  5149. Class : Disk
  5150. Level : DOS
  5151.  
  5152. This routine tells you the letter of the current default drive.
  5153.  
  5154. See also GetDrv, the SUB version of this routine.
  5155.  
  5156.    Drive$ = GetDrive$
  5157.  
  5158. -------
  5159. Drive$    default drive letter.
  5160.  
  5161. Name  : GetDrv               (Get default Drive)
  5162. Class : Disk
  5163. Level : DOS
  5164.  
  5165. This routine tells you the letter of the current default drive.
  5166.  
  5167. See also GetDrive, the FUNCTION version of this routine.
  5168.  
  5169.    Drive$ = "x"
  5170.    GetDrv Drive$
  5171.  
  5172. -------
  5173. Drive$    default drive letter.  Init to at least one character.
  5174.  
  5175. Name  : GetDView             (Get DESQview version)
  5176. Class : Miscellaneous
  5177. Level : DOS
  5178.  
  5179. The GetDView routine tells you what version of DESQview is
  5180. loaded. It returns the results as two integers containing the
  5181. major and minor version numbers. For instance, DESQview 2.0
  5182. would return a major number of 2 and a minor number of 0. If
  5183. DESQview is not loaded, zeroes are returned.
  5184.  
  5185. See also GetTView, GetTVScreen, UpdTVScreen.
  5186.  
  5187.    GetDView MajorV%, MinorV%
  5188.  
  5189. -------
  5190. MajorV%   major part of the DESQview version (0 if no DESQview)
  5191. MinorV%   minor part of the DESQview version
  5192.  
  5193. Name  : GetEGA               (Get EGA information)
  5194. Class : Display / Equipment
  5195. Level : BIOS
  5196.  
  5197. This routine tells you whether an EGA (or VGA) is available, and
  5198. if so, what kind. It tells you whether the attached display is
  5199. monochrome or color, and how many kilobytes of RAM are installed
  5200. in the adapter.
  5201.  
  5202. Many early EGAs had only 64K of RAM. Current adapters have 256K
  5203. or more. Since there are some limitations attached to having
  5204. only 64K, it's a good idea to see if this is the case-- most
  5205. PBClone EGA routines won't work properly on 64k adapters.
  5206.  
  5207. See also GetCRT, GetHGA and GetVGA.
  5208.  
  5209. See also GetEGA2, the FUNCTION version of this routine.
  5210.  
  5211.    GetEGA Display%, KBytes%
  5212.  
  5213. -------
  5214. Display%  EGA display type: 0 no EGA, 1 EGA color, 2 EGA mono
  5215. KBytes%   kilobytes of display memory
  5216.  
  5217. Name  : GetEGA2%             (Get EGA information)
  5218. Class : Display / Equipment
  5219. Level : BIOS
  5220.  
  5221. This routine tells you whether an EGA (or VGA) is available.
  5222.  
  5223. See also GetCRT2, GetHGA and GetVGA2.
  5224.  
  5225. See also GetEGA, the SUB version of this routine. It returns
  5226. additional information.
  5227.  
  5228.    IsEGA% = GetEGA2%
  5229.  
  5230. -------
  5231. IsEGA%    whether the display is an EGA (0 if no)
  5232.  
  5233. Name  : GetError             (Get Error code from DOS)
  5234. Class : Miscellaneous
  5235. Level : Clone
  5236.  
  5237. NOTE: The GetError2% function should be used in preference to
  5238. this routine.
  5239.  
  5240. The GetError routine is used in conjunction with CatchError. It
  5241. lets you get the exit code (error level) returned by a program
  5242. to which you have SHELLed. Since CatchError hooks an interrupt
  5243. to do its work, you must always make sure to use GetError
  5244. afterwards to "clean up". See also CatchError.
  5245.  
  5246. Note that differences in DOS mean that this routine will not
  5247. always work. In some versions of DOS, you can only get the error
  5248. level if a batch file was executed; in others, you can't get the
  5249. error level from a batch file at all. Sorry about that. I don't
  5250. know of any way to work around it.
  5251.  
  5252.    CatchError
  5253.    SHELL ProgramName$
  5254.    GetError ExitCode%
  5255.  
  5256. -------
  5257. ExitCode%   exit code returned by SHELLed-to program (0-255)
  5258.  
  5259. Name  : GetError2%           (Get Error code from DOS)
  5260. Class : Miscellaneous
  5261. Level : DOS
  5262.  
  5263. The GetError2% function gets the exit code (error level)
  5264. returned by a program to which you have SHELLed. It should be
  5265. used as soon as possible after the SHELL, and its value will
  5266. only be meaningful on the first call after the SHELL.
  5267.  
  5268. This routine should be used in preference to CatchError and
  5269. GetError.
  5270.  
  5271.    SHELL ProgramName$
  5272.    ExitCode% = GetError2%
  5273.  
  5274. -------
  5275. ExitCode%   exit code returned by SHELLed-to program (0-255)
  5276.  
  5277. Name  : GetExecPath          (Get Execution Path of program)
  5278. Class : Disk
  5279. Level : DOS 3.0+
  5280.  
  5281. This routine returns the full path of your program, i.e., the
  5282. drive, subdirectory, and name of the program. It does not rely
  5283. on the current drive and subdirectory settings or look at the
  5284. PATH setting-- DOS tells it directly. This makes it an excellent
  5285. way to find the program's "home" directory, where (hopefully)
  5286. any data files associated with the program will also be stored.
  5287.  
  5288.    SelfName$ = SPACE$(80)
  5289.    GetExecPath SelfName$, SelfLen%
  5290.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  5291.  
  5292. -------
  5293. SelfName$   full path for current program.  Init to 80+ chars.
  5294. SelfLen%    length of the full path spec.
  5295.  
  5296. Name  : GetExtM              (Get Extended Memory)
  5297. Class : Memory / Equipment
  5298. Level : BIOS (AT)
  5299.  
  5300. This routine allows you to find out how much extended memory is
  5301. available. It should only be used on AT-class computers, since
  5302. older PCs do not support extended memory. Note that some of the
  5303. very early AT machines will return erroneous results.
  5304.  
  5305. The amount of memory returned may be either the total amount of
  5306. extended memory installed or just the amount available at this
  5307. time, depending on how previously-installed programs (if any)
  5308. make use of extended memory. Unfortunately, there is no standard
  5309. which defines how a program should use extended memory as there
  5310. is with EMS (expanded memory), so there is no way for a program
  5311. to determine whether or how another program is using extended
  5312. memory. Microsoft is trying to clear up this situation with its
  5313. HIMEM driver (available at your local BBS, or [last I looked]
  5314. free from Microsoft), but this approach hasn't really become
  5315. standard yet.
  5316.  
  5317.    GetExtM KBytes%
  5318.  
  5319. -------
  5320. KBytes%    the number of kilobytes of extended memory
  5321.  
  5322. Name  : GetFAttr             (Get File Attribute)
  5323. Class : Disk
  5324. Level : DOS
  5325.  
  5326. This routine lets you read the attributes of a file or
  5327. subdirectory. The attributes may contain a combination of any of
  5328. the following:
  5329.  
  5330.    Normal          0      (nothing special)
  5331.    Read Only       1      file can be read, but not written to
  5332.    Hidden          2      file is "invisible"
  5333.    System          4      special DOS system file
  5334.    Subdirectory   16      subdirectory
  5335.    Archive        32      (used by some backup utilities)
  5336.  
  5337. You can see if a certain value is set by using the AND operator:
  5338.  
  5339.    IF FAttr% AND 2 THEN PRINT "Hidden file"
  5340.  
  5341. Since the values are all powers of two, the AND operator makes
  5342. for a convenient way of decoding the results.
  5343.  
  5344. See also the ExplainFAttr$ function, which decodes the meanings
  5345. of the attribute for you.
  5346.  
  5347.    GetFAttr FileName$, FAttr%
  5348.  
  5349. FileName$   name of the file (or subdirectory) to examine
  5350. -------
  5351. FAttr%      attributes that are set
  5352.  
  5353. Name  : GetFDate             (Get File Date)
  5354. Class : Disk / Time
  5355. Level : DOS
  5356.  
  5357. This routine gets the date of a file.
  5358.  
  5359.    GetFDate FileName$, MonthNr%, DayNr%, YearNr%
  5360.  
  5361. FileName$   name of the file to examine
  5362. -------
  5363. MonthNr%    month
  5364. DayNr%      day
  5365. YearNr%     year
  5366.  
  5367. Name  : GetFSize             (Get File Size)
  5368. Class : Disk
  5369. Level : DOS
  5370.  
  5371. This function gets the size of a file.
  5372.  
  5373.    FileSize& = GetFSize&(FileName$)
  5374.  
  5375. FileName$   name of the file to examine
  5376. -------
  5377. FileSize&   size of the file, in bytes
  5378.  
  5379. Name  : GetFTime             (Get File Time)
  5380. Class : Disk / Time
  5381. Level : DOS
  5382.  
  5383. This routine gets the time of a file.
  5384.  
  5385.    GetFTime FileName$, HourNr%, MinuteNr%, SecondNr%
  5386.  
  5387. FileName$     name of the file to examine
  5388. -------
  5389. HourNr%       hour
  5390. MinuteNr%     minute
  5391. SecondNr%     second (always even, due to DOS storage techniques)
  5392.  
  5393. Name  : GetHGA%              (Get Hercules Adapter info)
  5394. Class : Display / Equipment
  5395. Level : Clone
  5396.  
  5397. This routine tells you whether a Hercules-compatible monochrome
  5398. graphics adapter is in use.
  5399.  
  5400. See also GetCRT2, GetEGA and GetVGA2.
  5401.  
  5402.    IsHGA% = GetHGA%
  5403.  
  5404. -------
  5405. IsHGA%    whether the display is Hercules mono graphics (0 no)
  5406.  
  5407. Name  : GetKbd               (Get Keyboard toggles)
  5408. Class : Input
  5409. Level : Clone
  5410.  
  5411. The GetKbd routine allows you to get the state of the four
  5412. keyboard toggles: Insert, Caps lock, Num lock, and Scroll Lock.
  5413.  
  5414.    GetKbd Insert%, Caps%, Num%, Scrl%
  5415.  
  5416. -------
  5417. Insert%    whether "insert" mode is on (0 if no)
  5418. Caps%      whether "caps lock" is on (0 if no)
  5419. Num%       whether "num lock" is on (0 if no)
  5420. Scrl%      whether "scroll lock" is on (0 if no)
  5421.  
  5422. Name  : GetKbd1              (Get Keyboard Shifts)
  5423. Class : Input
  5424. Level : Clone
  5425.  
  5426. The GetKbd1 routine allows you to get the state of the four
  5427. keyboard shift keys: Left shift, Right shift, Control and Alt.
  5428.  
  5429.    GetKbd1 LShift%, RShift%, Control%, Alt%
  5430.  
  5431. -------
  5432. LShift%    whether the left shift key is depressed (0 if no)
  5433. RShift%    whether the right shift key is depressed (0 if no)
  5434. Control%   whether a control key is depressed (0 if no)
  5435. Alt%       whether an alt key is depressed (0 if no)
  5436.  
  5437. Name  : GetKbd2              (Get Keyboard Shifts)
  5438. Class : Input
  5439. Level : AT BIOS
  5440.  
  5441. The GetKbd2 routine allows you to get the state of the six
  5442. keyboard shift keys on an "enhanced" keyboard: Left shift, Right
  5443. shift, Left Control, Right Control, Left Alt and Right Alt.
  5444.  
  5445. Normally, the BIOS only lets you see one key at a time, which
  5446. can be a barrier when you need more input. This is a particular
  5447. problem with action games and other real-time applications which
  5448. have complex input requirements. Due to the special way the BIOS
  5449. treats shift keys, GetKbd2 can tell if the the various shift
  5450. keys are pressed simultaneously, allowing more flexibility.
  5451.  
  5452.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  5453.  
  5454. -------
  5455. LShift%    whether the left shift key is depressed (0 if no)
  5456. RShift%    whether the right shift key is depressed (0 if no)
  5457. LCtrl%     whether the left control key is depressed (0 if no)
  5458. RCtrl%     whether the right control key is depressed (0 if no)
  5459. LAlt%      whether the left alt key is depressed (0 if no)
  5460. RAlt%      whether the right alt key is depressed (0 if no)
  5461.  
  5462. Name  : GetKey               (Get Key or mouse)
  5463. Class : Input, Mouse
  5464. Level : BIOS
  5465.  
  5466. This routine is kind of an extended version of INPUT$. It waits
  5467. until a key is available at the keyboard and returns the key
  5468. pressed. At your option, it can also return if a mouse button is
  5469. pressed.
  5470.  
  5471. See also the LClickLoc and RClickLoc routines, which allow you
  5472. to determine what the mouse position was at the last click.
  5473.  
  5474.    GetKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  5475.  
  5476. Mouse%        whether to check the mouse (0: no)
  5477. -------
  5478. ASCIIcode%    ASCII code of the key pressed
  5479. ScanCode%     scan code of the key pressed (0 if none)
  5480. LButton%      whether the left  mouse button was pressed
  5481. RButton%      whether the right mouse button was pressed
  5482.  
  5483. Name  : GetKey3              (Get Key or 3-button mouse)
  5484. Class : Input, Mouse
  5485. Level : BIOS
  5486.  
  5487. This routine is kind of an extended version of INPUT$. It waits
  5488. until a key is available at the keyboard and returns the key
  5489. pressed. At your option, it can also return if a mouse button is
  5490. pressed.
  5491.  
  5492. See also the LClickLoc, MClickLoc and RClickLoc routines, which
  5493. allow you to determine what the mouse position was at the last
  5494. click.
  5495.  
  5496.    GetKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  5497.       MButton%, RButton%
  5498.  
  5499. Mouse%        whether to check the mouse (0: no)
  5500. -------
  5501. ASCIIcode%    ASCII code of the key pressed
  5502. ScanCode%     scan code of the key pressed (0 if none)
  5503. LButton%      whether the left   mouse button is pressed
  5504. MButton%      whether the middle mouse button is pressed
  5505. RButton%      whether the right  mouse button is pressed
  5506.  
  5507. Name  : GetLabel             (Get disk volume Label)
  5508. Class : Disk
  5509. Level : DOS
  5510.  
  5511. This routine gets the volume label from a specified drive. See
  5512. also GetLabel2$.
  5513.  
  5514.    Label$ = SPACE$(11)
  5515.    GetLabel Drive$, Label$, LabelLen%, ErrCode%
  5516.    Label$ = LEFT$(Label$, LabelLen%)
  5517.  
  5518. Drive$     letter of the drive to examine
  5519. -------
  5520. Label$     volume label of drive.  Init to >= 11 chars.
  5521. LabelLen%  length of the volume label
  5522. ErrCode%   error code: 0 if no error, else DOS Error
  5523.  
  5524. Name  : GetLabel2$           (Get disk volume Label)
  5525. Class : Disk
  5526. Level : DOS
  5527.  
  5528. This routine gets the volume label from a specified drive. See
  5529. also GetLabel, a subprogram version of this routine. The
  5530. GetLabel subprogram is preferable in that it returns an error
  5531. code, but you may find the function version more convenient if
  5532. error checking is not desired.
  5533.  
  5534.    Label$ = GetLabel2$(Drive$)
  5535.  
  5536. Drive$     letter of the drive to examine
  5537. -------
  5538. Label$     volume label of the specified drive.
  5539.  
  5540. Name  : GetLIMHandles        (Get L/I/M expanded mem Handles)
  5541. Class : Memory
  5542. Level : DOS
  5543.  
  5544. Early Lotus/Intel/Microsoft expanded memory revisions provided a
  5545. limited number of "handles" which could be used to access
  5546. expanded memory-- often as few as 15 or so. If your program uses
  5547. expanded memory and the EMS driver is one of the older versions,
  5548. you may want to make sure that enough handles are available.
  5549. This routine tells you how many handles are in use.
  5550.  
  5551. Note that this routine expects an EMS driver to be installed. If
  5552. you can't be sure of that, use GetLIMM first to avoid an
  5553. unpleasant surprise.
  5554.  
  5555.    GetLIMHandles Handles%
  5556.  
  5557. -------
  5558. Handles%  number of EMS handles in use
  5559.  
  5560. Name  : GetLIMM              (Get L/I/M expanded Memory)
  5561. Class : Memory / Equipment
  5562. Level : DOS
  5563.  
  5564. This routine tells you how much expanded memory is installed. If
  5565. there is none, or if the EMS driver hasn't been installed, it
  5566. returns zeroes. You should use this routine before any other of
  5567. the PBClone routines that access expanded memory, since the
  5568. other routines expect EMS to be available.
  5569.  
  5570. The results are returned in terms of EMS pages. Each page is 16
  5571. kilobytes.
  5572.  
  5573.    GetLIMM TotalPages%, FreePages%
  5574.  
  5575. -------
  5576. TotalPages%  number of EMS pages installed
  5577. FreePages%   number of EMS pages available for use
  5578.  
  5579. Name  : GetLIMV              (Get L/I/M expanded mem Version)
  5580. Class : Memory / Equipment
  5581. Level : DOS
  5582.  
  5583. The GetLIMV routine tells you the version of EMS driver that is
  5584. being used. The version number is separated into major and minor
  5585. parts. For example, an EMS 3.1 driver would return a major
  5586. number of 3 and minor number of 1.
  5587.  
  5588. Note that this routine expects an EMS driver to be installed. If
  5589. you can't be sure of that, use GetLIMM first to avoid an
  5590. unpleasant surprise.
  5591.  
  5592.    GetLIMV MajorVer%, MinorVer%
  5593.  
  5594. -------
  5595. MajorVer%  major part of the EMS version number
  5596. MinorVer%  minor part of the EMS version number
  5597.  
  5598. Name  : GetLine              (Get Line of text)
  5599. Class : Display
  5600. Level : Any
  5601.  
  5602. This routine retrieves a row of text from a saved (or virtual)
  5603. screen.
  5604.  
  5605. You can use GetLine with a saved screen of any size. The St$
  5606. parameter must be initialized to the width of the saved screen
  5607. (in columns).
  5608.  
  5609. See also ReadScreen, which allows you to read a string of any
  5610. length directly from the display.
  5611.  
  5612.    St$ = SPACE$(ScrWidth%)   ' init to v. screen width
  5613.    GetLine DSeg%, DOfs%, Row%, St$, SLen%
  5614.    St$ = LEFT$(St$, SLen%)
  5615.  
  5616. DSeg%      segment of saved screen
  5617. DOfs%      offset of saved screen
  5618. Row%       row of saved screen (starting at 1)
  5619. -------
  5620. St$        text at given row (init to width of saved screen)
  5621. SLen       logical length of text
  5622.  
  5623. Name  : GetLogiDrive$        (Get Logical Drive)
  5624. Class : Disk
  5625. Level : DOS 3.2+
  5626.  
  5627. This routine is useful for systems which only have a single
  5628. floppy drive. In such cases, DOS connects both drive letters A:
  5629. and B: to the same drive. However, only one drive letter is
  5630. active, and when you try to access the "other" drive, DOS
  5631. displays the message:
  5632.  
  5633.   "Insert diskette for drive x: and press any key when ready."
  5634.  
  5635. This function allows you to determine whether a drive is
  5636. remapped, and if so, which letter is currently active for the
  5637. drive in question. The result will be a null string ("") if the
  5638. drive is not multiply mapped; or, if the drive is multiply
  5639. mapped, the letter which currently refers to the drive is
  5640. returned. For example, if you check drive "A" on a dual-floppy
  5641. system, you'll get back ""; but on a single-floppy system,
  5642. you'll get back "A" or "B", depending on which letter was last
  5643. used to access the drive.
  5644.  
  5645. See also SetLogiDrive, which allows you to set the active drive
  5646. letter for a given drive.
  5647.  
  5648.    ActiveDrv$ = GetLogiDrive$(Drive$)
  5649.  
  5650. Drive$       drive letter to check (use "" for current drive)
  5651. -------
  5652. ActiveDrv$   active drive letter, or "" if no remapping is done
  5653.  
  5654. Name  : GetMemBox            (Get Memory Box info)
  5655. Class : Memory
  5656. Level : DOS
  5657.  
  5658. The PBClone library comes with a TSR called MEMBOX.COM. This TSR
  5659. reserves an area of memory which can be used as a transfer area
  5660. for communication between multiple programs-- the data remains
  5661. as long as the TSR is installed.
  5662.  
  5663. The GetMemBox routine tells you whether MEMBOX is installed, how
  5664. much memory it has, and the location of that memory. You can
  5665. access the MEMBOX memory using any PBClone routine that accepts
  5666. segment and offset pointers. The DGetSt and DPutSt routines will
  5667. probably be most helpful for general use.
  5668.  
  5669. NOTE that MEMBOX expects to be the last TSR installed. If any
  5670. other TSR or program alters the INT 2Fh interrupt vector while
  5671. MEMBOX is active, the results are liable to be messy at best.
  5672.  
  5673.    GetMemLoc DSeg%, DOfs%, Bytes%
  5674.  
  5675. -------
  5676. DSeg%      memory segment
  5677. DOfs%      memory offset
  5678. Bytes%     bytes available (0 if MEMBOX is not installed)
  5679.  
  5680. Name  : GetMouseLoc          (Get Mouse Location)
  5681. Class : Mouse
  5682. Level : BIOS
  5683.  
  5684. This routine allows you to get the current location of the mouse
  5685. cursor. It doesn't matter if the cursor is visible or invisible.
  5686. GetMouseLoc is only for use in text mode.
  5687.  
  5688. This routine will not work properly if there is no mouse
  5689. available. Use the MMCheck routine if you are not sure.
  5690.  
  5691. See also MMGetLoc, which returns the coordinates for graphics
  5692. mode.
  5693.  
  5694.    GetMouseLoc Row%, Column%
  5695.  
  5696. -------
  5697. Row%       mouse cursor row
  5698. Column%    mouse cursor column
  5699.  
  5700. Name  : GetMouseVer          (Get Mouse driver Version)
  5701. Class : Mouse
  5702. Level : BIOS
  5703.  
  5704. This routine retrieves various information about the mouse,
  5705. including the driver version number, mouse type, and IRQ used by
  5706. the mouse.
  5707.  
  5708. Note that this is among the mouse routines that makes you wonder
  5709. what Microsoft was thinking when they designed the mouse driver.
  5710. The mouse driver has no provision for error codes and the "get
  5711. version" function was added comparatively recently, so there is
  5712. no way of knowing with certainty whether this routine worked or
  5713. what the mouse driver version is. If that could be a problem,
  5714. you can reduce the risk by checking the returned values to make
  5715. sure they appear reasonable.
  5716.  
  5717. This routine will not work properly if there is no mouse
  5718. available. Use the MMCheck routine if you are not sure.
  5719.  
  5720. The mouse type may be any of the following:
  5721.    1   bus mouse
  5722.    2   serial mouse
  5723.    3   InPort mouse
  5724.    4   PS/2 mouse
  5725.    5   Hewlett-Packard mouse
  5726.  
  5727. The IRQ will be 0 on the PS/2. Otherwise, it will be 2-5 or 7 on
  5728. Microsoft mice. A mouse designed to take advantage of the AT
  5729. interrupt controller may use higher IRQs (to perhaps 15, I'm not
  5730. sure), so be generous if you do range checking here.
  5731.  
  5732. The version number is divided into two parts. For instance,
  5733. mouse driver 8.20 would return a major version number of 8 and a
  5734. minor version number of 20.
  5735.  
  5736.    GetMouseVer MajorV%, MinorV%, MType%, IRQ%
  5737.  
  5738. -------
  5739. MajorV%    mouse driver major version number
  5740. MinorV%    mouse driver minor version number
  5741. MType%     mouse type
  5742. IRQ%       IRQ used by mouse
  5743.  
  5744. Name  : GetNameA             (Get Name of file in Archive)
  5745. Class : Disk
  5746. Level : DOS
  5747.  
  5748. GetNameA returns the name of an archived file matched by the
  5749. FindFirstA or FindNextA routines. Since some archives may
  5750. include subdirectory specs along with the file name, it is
  5751. recommended that you initialize the return string to 80
  5752. characters (at least 12 are required).
  5753.  
  5754. When parsing filenames which may contain subdirectory specs,
  5755. keep in mind that the forward slash "/" may be used instead of
  5756. the backslash "\" for delimiting subdirectories.
  5757.  
  5758. In order to reach the very widest audience, you may also wish to
  5759. take into account filenames which may have originated on non-PC
  5760. systems. In such filenames, the length of any part of the path
  5761. will not necessarily be restricted to the 11-plus-dot of MS-DOS,
  5762. the dot character may not mean anything special,
  5763. uppercase/lowercase distinctions may be significant, and
  5764. characters may be present which are not valid in MS-DOS names.
  5765.  
  5766. Routines in this series include:
  5767.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5768.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5769.  
  5770.    FileName$ = SPACE$(80)
  5771.    GetNameA FileName$, NameLen%
  5772.    FileName$ = LEFT$(FileName$, NameLen%)
  5773.  
  5774. -------
  5775. FileName$   file name (init to >= 12 characters, preferably 80)
  5776. NameLen%    length of file name
  5777.  
  5778. Name  : GetNameF             (Get Name of File)
  5779. Class : Disk
  5780. Level : DOS
  5781.  
  5782. The GetNameF routine returns the name of a file matched by
  5783. FindFirstF or FindNextF. The name will not contain a drive or
  5784. subdirectory specification.
  5785.  
  5786. Routines in this series include:
  5787.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5788.    GetTimeF, GetSizeFL
  5789.  
  5790.    FileName$ = SPACE$(12)
  5791.    GetNameF FileName$, NameLen%
  5792.    FileName$ = LEFT$(FileName$, NameLen%)
  5793.  
  5794. -------
  5795. FileName$   file name (init to at least 12 characters)
  5796. NameLen%    length of file name
  5797.  
  5798. Name  : GetNameFx$           (Get Name of File, Extended)
  5799. Class : Disk
  5800. Level : DOS
  5801.  
  5802. The GetNameFx$ function returns the name of a file matched by
  5803. FindFirstFx or FindNextFx. The name will not contain a drive or
  5804. subdirectory specification.
  5805.  
  5806. Routines in this series include:
  5807.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5808.    GetTimeFx$, GetSizeFx&
  5809.  
  5810.    FileName$ = GetNameFx$(Buffer$)
  5811.  
  5812. Buffer$       buffer used in search
  5813. -------
  5814. FileName$     file name
  5815.  
  5816. Name  : GetPath$             (Get default Path)
  5817. Class : Disk
  5818. Level : DOS
  5819.  
  5820. This function returns the current drive and subdirectory as an
  5821. absolute path specification.
  5822.  
  5823. See also GetDrv, GetDrive$, GetSub, GetSub1, and GetSub2$.
  5824.  
  5825.    Path$ = GetPath$
  5826.  
  5827. -------
  5828. Path$      name of the current drive and subdirectory
  5829.  
  5830. Name  : GetPrtAddr           (Get Printer Address)
  5831. Class : Printer
  5832. Level : Clone
  5833.  
  5834. This routine allows you to determine the base port address of a
  5835. parallel port. You tell it the LPT port number (1-4) and it
  5836. returns the port address. If there is no port installed, zero
  5837. will be returned.
  5838.  
  5839. Note that up to four printer ports are (theoretically) supported
  5840. on most machines. On PS/2 computers, only three ports are
  5841. allowed, and the fourth port data area is used for other
  5842. purposes. So, it would probably be a good idea to restrict your
  5843. program to ports 1-3.
  5844.  
  5845. Aside from purely informational purposes, this routine can be
  5846. useful in conjunction with SetPrtAddr in manipulating the
  5847. parallel ports.
  5848.  
  5849.    GetPrtAddr PortNr%, PortAddr%
  5850.  
  5851. PortNr%     LPT port number (1-4 or 1-3 [see above])
  5852. -------
  5853. PortAddr%   port address
  5854.  
  5855. Name  : GetPrtSc%            (Get PrtSc press)
  5856. Class : Input
  5857. Level : BIOS
  5858.  
  5859. This function only works when the "print screen" key is
  5860. disabled, which you can accomplish via the PrtSc routine. It
  5861. returns whether the print screen key was pressed since you last
  5862. checked. Like INKEY$, it clears the value after you read it.
  5863.  
  5864.    Pressed% = GetPrtSc%
  5865.  
  5866. -------
  5867. Pressed%    whether the print screen key was pressed (0 if no)
  5868.  
  5869. Name  : GetPSP%              (Get Program Segment Prefix)
  5870. Class : Memory
  5871. Level : DOS
  5872.  
  5873. This function returns the segment of the Program Segment Prefix,
  5874. which is a sort of header at the beginning of every program that
  5875. contains assorted information. You can find out more about the
  5876. PSP in any DOS technical reference.
  5877.  
  5878.    PSeg% = GetPSP%
  5879.  
  5880. -------
  5881. PSeg%      segment of the Program Segment Prefix
  5882.  
  5883. Name  : GetRows              (Get Rows on screen)
  5884. Class : Display
  5885. Level : Clone
  5886.  
  5887. This routine tells you how many rows are on the display. This is
  5888. normally 25, but it may be greater on an EGA or VGA. Only text
  5889. modes are supported.
  5890.  
  5891.    GetRows Rows%
  5892.  
  5893. -------
  5894. Rows%    text rows on the display
  5895.  
  5896. Name  : GetRows2%            (Get Rows on screen)
  5897. Class : Display
  5898. Level : Clone
  5899.  
  5900. This routine tells you how many rows are on the display. This is
  5901. normally 25, but it may be greater on an EGA or VGA. Only text
  5902. modes are supported.
  5903.  
  5904.    Rows% = GetRows2%
  5905.  
  5906. -------
  5907. Rows%    text rows on the display
  5908.  
  5909. Name  : GetScreen            (Get Screen)
  5910. Class : Display
  5911. Level : Clone
  5912.  
  5913. This routine saves any portion of the display to an array. Only
  5914. text modes are supported. If your program uses multiple display
  5915. pages, you can get an image from any of those pages. A special
  5916. "slow" mode is supported for the CGA, to prevent flickering (a
  5917. problem only with some CGAs).
  5918.  
  5919. The size of the integer array needed to store a specific area of
  5920. the screen can be calculated using the CalcSize routine (see).
  5921.  
  5922. If you wish to save the entire screen, you may find ScrSave
  5923. easier (see).
  5924.  
  5925.    GetScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  5926.  
  5927. TRow%      top row of the desired screen area
  5928. LCol%      left column of the desired screen area
  5929. BRow%      bottom row of the desired screen area
  5930. RCol%      right column of the desired screen area
  5931. Page%      page from which to get the display area
  5932. Fast%      whether to use fast mode (0 no)
  5933. -------
  5934. Array%()   stored image of the selected area of the screen
  5935.  
  5936. Name  : GetSerial$           (Get disk Serial number)
  5937. Class : Disk
  5938. Level : DOS 4.0+
  5939.  
  5940. The GetSerial function returns the serial number of the
  5941. specified disk. If there is no serial number, it returns
  5942. "0000-0000".
  5943.  
  5944.    SerialNr$ = GetSerial$(Drive$)
  5945.  
  5946. Drive$       drive to get serial # from ("" for current drive)
  5947. -------
  5948. SerialNr$    serial number of the specified drive
  5949.  
  5950. Name  : GetSizeAL            (Get Size of file in Archive Long)
  5951. Class : Disk
  5952. Level : DOS
  5953.  
  5954. GetSizeAL returns the size of an archived file matched by the
  5955. FindFirstA or FindNextA routines.
  5956.  
  5957. Routines in this series include:
  5958.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5959.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5960.  
  5961.    GetSizeAL OrigSize&, CurrSize&
  5962.  
  5963. -------
  5964. OrigSize&    original (uncompressed) file size
  5965. CurrSize&    current (compressed) file size
  5966.  
  5967. Name  : GetSizeFL            (Get Size of File as Long)
  5968. Class : Disk
  5969. Level : DOS
  5970.  
  5971. The GetSizeFL routine returns the size of a file matched by
  5972. FindFirstF or FindNextF.
  5973.  
  5974. Routines in this series include:
  5975.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5976.    GetTimeF, GetSizeFL
  5977.  
  5978.    GetSizeFL FileSize&
  5979.  
  5980. -------
  5981. FileSize&   file size
  5982.  
  5983. Name  : GetSizeFx&           (Get Size of File, Extended)
  5984. Class : Disk
  5985. Level : DOS
  5986.  
  5987. The GetSizeFx& function returns the size of a file matched by
  5988. FindFirstFx or FindNextFx.
  5989.  
  5990. Routines in this series include:
  5991.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5992.    GetTimeFx$, GetSizeFx&
  5993.  
  5994.    FileSize& = GetSizeFx&(Buffer$)
  5995.  
  5996. Buffer$     buffer used in search
  5997. -------
  5998. FileSize&   file size
  5999.  
  6000. Name  : GetStoreA            (Get Storage of file in Archive)
  6001. Class : Disk / Time
  6002. Level : DOS
  6003.  
  6004. GetStoreA returns the method used to compress an archived file
  6005. matched by the FindFirstA or FindNextA routines.
  6006.  
  6007. Routines in this series include:
  6008.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  6009.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  6010.  
  6011.    Storage$ = SPACE$(8)
  6012.    GetStoreA Storage$
  6013.  
  6014. -------
  6015. Storage$    storage method (init to 8 characters)
  6016.  
  6017. Name  : GetSub               (Get default Subdirectory)
  6018. Class : Disk
  6019. Level : DOS
  6020.  
  6021. The GetSub routine gets the current subdirectory on the default
  6022. drive. It does not put a backslash at the start of the
  6023. subdirectory, so you should add this yourself.
  6024.  
  6025. See also GetPath$, GetSub1, and GetSub2$.
  6026.  
  6027.    SubDir$ = SPACE$(64)
  6028.    GetSub SubDir$, SubLen%
  6029.    SubDir$ = "\" + LEFT$(SubDir$, SubLen%)
  6030.  
  6031. -------
  6032. SubDir$    name of the current subdirectory. Init to 64+ chars
  6033. SubLen%    length of the subdirectory name
  6034.  
  6035. Name  : GetSub1              (Get default Subdirectory)
  6036. Class : Disk
  6037. Level : DOS
  6038.  
  6039. The GetSub1 routine gets the current subdirectory on a specified
  6040. drive. Unlike GetSub, it places a backslash at the start of the
  6041. name. It also returns an error code, which allows you to see if
  6042. there was a disk error.
  6043.  
  6044. See also GetPath$, GetSub, and GetSub2$.
  6045.  
  6046.    SubDir$ = SPACE$(65)
  6047.    GetSub1 Drive$, SubDir$, SubLen%, ErrCode%
  6048.    SubDir$ = LEFT$(SubDir$, SubLen%)
  6049.  
  6050. Drive$     letter of the drive to check
  6051. -------
  6052. SubDir$    name of the current subdirectory. Init to 65+ chars
  6053. SubLen%    length of the subdirectory name
  6054. ErrCode%   error code: 0 if no error, else DOS Error
  6055.  
  6056. Name  : GetSub2$             (Get default Subdirectory)
  6057. Class : Disk
  6058. Level : DOS
  6059.  
  6060. The GetSub2 routine gets the current subdirectory on a specified
  6061. drive. Unlike GetSub, it places a backslash at the start of the
  6062. name.
  6063.  
  6064. See also GetPath$, GetSub, and GetSub1.
  6065.  
  6066. If you just want the subdirectory of the current drive, you can
  6067. use a null string ("") as the drive letter, or use GetPath$.
  6068.  
  6069.    SubDir$ = GetSub2$(Drive$)
  6070.  
  6071. Drive$     letter of the drive to check
  6072. -------
  6073. SubDir$    name of the current subdirectory. Init to 65+ chars
  6074.  
  6075. Name  : GetSwitch            (Get Switch character)
  6076. Class : Miscellaneous
  6077. Level : DOS
  6078.  
  6079. An undocumented capability in many DOS versions allows you to
  6080. set the DOS "switch character", which is the delimiter used to
  6081. identify a switch on the DOS command line. This is normally a
  6082. slash, as in "DIR /W". However, many people prefer to change it
  6083. to a "-", which is the switch character used by Unix.
  6084.  
  6085. With the normal "/" delimiter, a backslash "\" is used in
  6086. subdirectory specifications. DOS itself will recognize either
  6087. one as a subdirectory delimiter, but the command line won't
  6088. unless the switch char was changed.
  6089.  
  6090. The upshot of all this is, whereas you might normally use a
  6091. command like:
  6092.    DIR /W C:\GAMES
  6093.  
  6094. Someone with a different switch character might use something
  6095. like this:
  6096.    DIR -W C:/GAMES
  6097.  
  6098. This is exactly the sort of syntax that Unix commands use.
  6099.  
  6100. If you design your program to recognize the different
  6101. delimiters, you will make some people very happy! The GetSwitch
  6102. routine will detect changed delimiters on those versions of DOS
  6103. which support it, and will return an ordinary "/" on those
  6104. versions of DOS which don't.
  6105.  
  6106.    Switch$ = "x"
  6107.    GetSwitch Switch$
  6108.  
  6109. -------
  6110. Switch$    the DOS switch character.  Init to one character.
  6111.  
  6112. Name  : GetSwitch2$          (Get Switch character)
  6113. Class : Miscellaneous
  6114. Level : DOS
  6115.  
  6116. This does exactly the same thing as the GetSwitch routine, but
  6117. it is a FUNCTION rather than a SUB. For more information, see
  6118. GetSwitch.
  6119.  
  6120.    Switch$ = GetSwitch2$
  6121.  
  6122. -------
  6123. Switch$    the DOS switch character
  6124.  
  6125. Name  : GetTick&             (Get Tick)
  6126. Class : Time
  6127. Level : Clone
  6128.  
  6129. This function returns the system time. This value represents the
  6130. time after midnight. There are about 18.2 ticks per second,
  6131. providing sufficiently fine resolution for most purposes.
  6132.  
  6133. If you use this function as part of a delay loop, keep in mind
  6134. that the value will wrap around at midnight, and that any given
  6135. value may be "skipped" due to causes beyond your control--
  6136. multitasking or background operations such as communications or
  6137. print spooling, for example. So, DO NOT check for a specific
  6138. "end time"-- it may never come! Instead, decrement a counter
  6139. whenever you notice that the time has changed since you last
  6140. checked. This disassociates the delay from a specific time,
  6141. preventing lockups.
  6142.  
  6143.    Tick& = GetTick&
  6144.  
  6145. -------
  6146. Tick&        time after midnight (1/18.2 seconds)
  6147.  
  6148. Name  : GetTime              (Get Time)
  6149. Class : Time
  6150. Level : DOS
  6151.  
  6152. This routine tells you the time according to DOS.
  6153.  
  6154. The main difference between getting the time from BASIC and
  6155. getting it from DOS is the "hundredths of seconds" value.
  6156. However, this value is not available on some machines, in which
  6157. case it will be set to zero. It is not accurate on most
  6158. machines, being calculated instead using a semi-random approach;
  6159. it is more of a novelty than a useful value.
  6160.  
  6161.    GetTime HourNr%, MinuteNr%, SecondNr%, Hundredth%
  6162.  
  6163. -------
  6164. HourNr%      hour (0-23)
  6165. MinuteNr%    minute
  6166. SecondNr%    second
  6167. Hundredth%   hundredth of a second.  See remarks, above.
  6168.  
  6169. Name  : GetTimeA             (Get Time of file in Archive)
  6170. Class : Disk / Time
  6171. Level : DOS
  6172.  
  6173. GetTimeA returns the time of an archived file matched by the
  6174. FindFirstA or FindNextA routines.
  6175.  
  6176. Routines in this series include:
  6177.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  6178.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  6179.  
  6180.    GetTimeA HourNr%, MinuteNr%, SecondNr%
  6181.  
  6182. -------
  6183. HourNr%     hour
  6184. MinuteNr%   minute
  6185. SecondNr%   second
  6186.  
  6187. Name  : GetTimeAT            (Get Time from AT clock)
  6188. Class : Time
  6189. Level : BIOS (AT)
  6190.  
  6191. This routine gets the time from the hardware real-time clock in
  6192. AT-class computers. Depending on the DOS version, this time may
  6193. be partially or completely independent of the time kept by DOS
  6194. in software. DOS always reads the time from the hardware clock
  6195. when it starts up. However, use of the TIME command in DOS (and
  6196. the TIME$ function in QuickBASIC) may relate only to the
  6197. software copy of the time, which is not always guaranteed to be
  6198. the same as the time in the hardware clock due to certain
  6199. discrepancies in DOS.
  6200.  
  6201.    GetTimeAT HourNr%, MinuteNr%, SecondNr%, ErrCode%
  6202.  
  6203. -------
  6204. HourNr%      hour (0-23)
  6205. MinuteNr%    minute
  6206. SecondNr%    second
  6207. ErrCode%     error code: 0 if no error, else clock has stopped
  6208.  
  6209. Name  : GetTimeF             (Get Time of File)
  6210. Class : Disk / Time
  6211. Level : DOS
  6212.  
  6213. The GetTimeF routine returns the time of a file matched by
  6214. FindFirstF or FindNextF.
  6215.  
  6216. Routines in this series include:
  6217.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  6218.    GetTimeF, GetSizeFL
  6219.  
  6220.    GetTimeF HourNr%, MinuteNr%, SecondNr%
  6221.  
  6222. -------
  6223. HourNr%     hour
  6224. MinuteNr%   minute
  6225. SecondNr%   second
  6226.  
  6227. Name  : GetTimeFx$           (Get Time of File, Extended)
  6228. Class : Disk / Time
  6229. Level : DOS
  6230.  
  6231. The GetTimeFx$ function returns the time of a file matched by
  6232. FindFirstFx or FindNextFx.
  6233.  
  6234. Routines in this series include:
  6235.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  6236.    GetTimeFx$, GetSizeFx&
  6237.  
  6238.    FileTime$ = GetTimeFx$(Buffer$)
  6239.  
  6240. Buffer$      buffer used in search
  6241. -------
  6242. FileTime$    file time (e.g., "17:53:20")
  6243.  
  6244. Name  : GetTView             (Get TopView)
  6245. Class : Miscellaneous
  6246. Level : BIOS
  6247.  
  6248. This routine tells you whether TopView or a compatible
  6249. multitasker (such as TaskView or DESQview) is loaded.
  6250.  
  6251. See also GetDView, GetTVScreen, UpdTVScreen.
  6252.  
  6253.    GetTView Installed%
  6254.  
  6255. -------
  6256. Installed%   whether a TopView-type multitasker is loaded
  6257.  
  6258. Name  : GetTVScreen          (Get TopView Screen address)
  6259. Class : Display / Miscellaneous
  6260. Level : BIOS
  6261.  
  6262. GetTVScreen returns the address of the screen buffer used by a
  6263. TopView-type multitasker. This allows you to use direct screen
  6264. access while remaining within the windows allocated to your
  6265. program by the multitasker.
  6266.  
  6267. You must tell the multitasker the address of the screen you
  6268. would be writing to if the multitasker was not installed.
  6269. Specify a segment of &HB000 if using an MDA or Hercules, or a
  6270. segment of &HB800 for CGA, EGA, MCGA or VGA. The offset should
  6271. always be 0. This is for use in text modes.
  6272.  
  6273. The routine will return with the new segment and offset for you
  6274. to use. These values can be used with any PBClone screen routine
  6275. that accepts a segment and offset-- DQPrint and DXQPrint, for
  6276. example.
  6277.  
  6278. Note that not all TopView-compatible multitaskers will
  6279. automatically update the screen from the buffer. The UpdTVScreen
  6280. routine allows you to force a screen update.
  6281.  
  6282. See also GetDView, GetTView, UpdTVScreen.
  6283.  
  6284.    GetTVScreen DSeg%, DOfs%
  6285.  
  6286. DSeg%       segment of desired screen
  6287. DOfs%       offset of desired screen
  6288. -------
  6289. DSeg%       segment of screen buffer
  6290. DOfs%       offset of screen buffer
  6291.  
  6292. Name  : GetValidKey          (Get Valid Key)
  6293. Class : Input
  6294. Level : DOS
  6295.  
  6296. This one is useful for getting one of a list of keys from the
  6297. keyboard. You give it a list of keys (letters should be
  6298. uppercase) to accept. It will wait until one of the listed keys
  6299. is pressed; for letters, it will accept either lowercase or
  6300. uppercase keys, but will convert the letter to uppercase before
  6301. it returns to you. If you pass it a blank list, it will accept
  6302. any key.
  6303.  
  6304. The Result$ string needs to be initialized to one character
  6305. before you call the routine, due to limitations on what assembly
  6306. language routines are allowed to do with BASIC strings.
  6307.  
  6308. This routine is handy for when you want to allow one of a list
  6309. of choices from a menu, for instance.
  6310.  
  6311.    Result$ = "x"
  6312.    GetValidKey GoodList$, Result$
  6313.  
  6314. GoodList$    list of acceptable keys.  See above for remarks.
  6315. -------
  6316. Result$      the key that was accepted (uppercase if letter)
  6317.  
  6318. Name  : GetVerify            (Get Verify setting)
  6319. Class : Disk
  6320. Level : DOS
  6321.  
  6322. The GetVerify routine tells you the state of the DOS VERIFY
  6323. flag. When VERIFY is on, some checking is done to make sure that
  6324. writing to the disk works as requested. The checks are not very
  6325. good, however, and VERIFY slows down disk handling, so it is
  6326. usually better to have VERIFY off.
  6327.  
  6328. You can change the state of VERIFY by using the DOS VERIFY
  6329. command or with the SetVerify routine in PBClone.
  6330.  
  6331.    GetVerify VerifyOn%
  6332.  
  6333. -------
  6334. VerifyOn%   whether VERIFY is on (0 if no)
  6335.  
  6336. Name  : GetVGA               (Get VGA information)
  6337. Class : Display / Equipment
  6338. Level : BIOS
  6339.  
  6340. This routine tells you whether a VGA is available.
  6341.  
  6342. See also GetCRT, GetEGA and GetHGA.
  6343.  
  6344.    GetVGA IsVGA%
  6345.  
  6346. -------
  6347. IsVGA%    whether a VGA is installed (0 if no)
  6348.  
  6349. Name  : GetVGA2%             (Get VGA information)
  6350. Class : Display / Equipment
  6351. Level : BIOS
  6352.  
  6353. This routine tells you whether a VGA is available.
  6354.  
  6355. See also GetCRT, GetEGA and GetHGA.
  6356.  
  6357.    IsVGA% = GetVGA2%
  6358.  
  6359. -------
  6360. IsVGA%    whether a VGA is installed (0 if no)
  6361.  
  6362. Name  : GetVGAColor          (Get VGA Color)
  6363. Class : Display
  6364. Level : BIOS
  6365.  
  6366. This routine gets the components of a single VGA palette color.
  6367. It returns the color value associated with a given color number.
  6368.  
  6369. If you are dealing with more than one color at a time, you may
  6370. find GetVGAPalette more appropriate.
  6371.  
  6372.    GetVGAColor ColorNr%, Red%, Green%, Blue%
  6373.  
  6374. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  6375. -------
  6376. Red%       red intensity (0-63)
  6377. Green%     green intensity (0-63)
  6378. Blue%      blue intensity (0-63)
  6379.  
  6380. Name  : GetVGAPalette        (Get VGA Palette)
  6381. Class : Display
  6382. Level : BIOS
  6383.  
  6384. This routine allows you to get any number of the VGA palette
  6385. settings into a TYPEd array. The TYPE for the array should be
  6386. defined like this:
  6387.  
  6388.    TYPE Palet
  6389.       IRed AS STRING * 1
  6390.       IBlue AS STRING * 1
  6391.       IGreen AS STRING * 1
  6392.    END TYPE
  6393.  
  6394. This type holds a CHR$-encoded representation of the intensity
  6395. of each component of the color. The values range from 0-63.
  6396.  
  6397. If you are only dealing with a few colors, you may find it more
  6398. convenient to use GetVGAColor instead.
  6399.  
  6400.    GetVGAPalette DSeg%, DOfs%, Start%, Colors%
  6401.  
  6402. DSeg%      segment of the palette array
  6403. DOfs%      offset of the palette array
  6404. Start%     color number to start with
  6405. Colors%    number of colors to get
  6406.  
  6407. Name  : GetVidMode           (Get Video Mode)
  6408. Class : Display
  6409. Level : BIOS
  6410.  
  6411. The GetVidMode routine tells you about the current display
  6412. status from the BIOS' point of view. Note that the BIOS display
  6413. mode is not the same as the BASIC SCREEN mode (a direct
  6414. translation between the two is messy, because BASIC
  6415. conglomerates several BIOS modes into a single SCREEN mode in
  6416. several instances).
  6417.  
  6418.    GetVidMode BIOSMode%, ScreenWidth%, ActivePage%
  6419.  
  6420. -------
  6421. BIOSMode%     BIOS video mode
  6422. ScreenWidth%  number of columns per row
  6423. ActivePage%   active (visible) display page
  6424.  
  6425. Name  : GetXMSm              (Get XMS Memory)
  6426. Class : Memory / Equipment
  6427. Level : DOS
  6428.  
  6429. This routine tells you how much XMS memory is available. If
  6430. there is none, or if the XMS driver hasn't been installed, it
  6431. returns zeroes. Memory is returned kilobytes.
  6432.  
  6433.    GetXMSm LargestFree&, TotalFree&
  6434.  
  6435. -------
  6436. LargestFree&  largest free block of XMS memory
  6437. TotalFree&    total free XMS memory
  6438.  
  6439. Name  : GetXMSv              (Get XMS Version)
  6440. Class : Memory / Equipment
  6441. Level : BIOS
  6442.  
  6443. The GetXMSv routine tells you the version of XMS driver that is
  6444. being used. The version number is separated into major and minor
  6445. parts. For example, an XMS 2.0 driver would return a major
  6446. number of 2 and minor number of 0.
  6447.  
  6448.    GetXMSv MajorVer%, MinorVer%
  6449.  
  6450. -------
  6451. MajorVer%  major part of the XMS version number
  6452. MinorVer%  minor part of the XMS version number
  6453.  
  6454. Name  : GLoad                (Graphics Load)
  6455. Class : Disk
  6456. Level : DOS
  6457.  
  6458. A replacement for the BASIC BLOAD statement, this routine loads
  6459. a binary memory image from a file into the area of memory it
  6460. formerly occupied. This is most often used to restore a screen
  6461. display from a file, although PBClone offers more flexible
  6462. alternatives.
  6463.  
  6464.    GLoad FileName$
  6465.  
  6466. FileName$    name of the file to load into memory
  6467.  
  6468. Name  : GQPrint              (Graphics Quick Print)
  6469. Class : Display
  6470. Level : Clone
  6471.  
  6472. This is a simple high-speed replacement for the PRINT statement
  6473. which works in CGA graphics mode (SCREEN 2). It does not
  6474. interpret control codes, support graphics characters (ASCII
  6475. 128-255), or update the cursor position, in return for which it
  6476. is much faster than PRINT.
  6477.  
  6478. The Fast% parameter is ignored at the moment-- top speed is
  6479. always used, which may cause flickering on some CGAs.
  6480.  
  6481.    GQPrint St$, Row%, Column%, Fast%
  6482.  
  6483. St$      string to display
  6484. Row%     row (1-25)
  6485. Column%  column (1-80)
  6486. Fast%    not used
  6487.  
  6488. Name  : GrafPrint            (Graphics Print)
  6489. Class : Display
  6490. Level : Clone
  6491.  
  6492. This is a flexible replacement for the PRINT statement which
  6493. operates in graphics mode. It allows you to display text at
  6494. graphics coordinates instead of text coordinates for better
  6495. alignment with graphs and so forth. It also lets you specify the
  6496. size of the font-- you can stretch it in either vertical or
  6497. horizontal directions, or both, using a font multiplier value.
  6498.  
  6499. The disadvantages of this routine are that it is slower than an
  6500. ordinary PRINT, only does foreground printing (if you need a
  6501. background color, you need to fill that in yourself beforehand),
  6502. won't do automatic wrap or scroll, and won't handle control
  6503. codes or graphics characters (ASCII 0-31, 127-255). The font is
  6504. based on the normal CGA graphics font, which uses an 8x8 grid
  6505. for each character.
  6506.  
  6507. GrafPrint will work in any graphics mode.
  6508.  
  6509.    GrafPrint St$, X%, Y%, High%, Wide%, Colour%
  6510.  
  6511. St$       string to display
  6512. X%        graphics column to start at
  6513. Y%        graphics row to start at
  6514. High%     font height multiplier
  6515. Wide%     font width multiplier
  6516. Colour%   foreground color for string
  6517.  
  6518. Name  : GrafRest             (Graphics Restore)
  6519. Class : Display
  6520. Level : Clone
  6521.  
  6522. This routine allows you to restore a SCREEN 1 (CGA, 320x200, 4
  6523. color) or SCREEN 2 (CGA, 640x200, 2 color) display that was
  6524. saved using GrafSave (see).
  6525.  
  6526.    GrafRest DSeg%, DOfs%
  6527.  
  6528. DSeg%      segment of storage array, returned by VARSEG
  6529. DOfs%      offset  of storage array, returned by VARPTR
  6530.  
  6531. Name  : GrafSave             (Graphics Save)
  6532. Class : Display
  6533. Level : Clone
  6534.  
  6535. This routine allows you to save a SCREEN 1 (CGA, 320x200, 4
  6536. color) or SCREEN 2 (CGA, 640x200, 2 color) display that can be
  6537. restored using GrafRest (see).
  6538.  
  6539. The array used to hold the screen must contain 16,000 bytes. For
  6540. an integer array, this means that you must create the array by
  6541. DIM Array%(1 TO 8000).
  6542.  
  6543.    GrafSave DSeg%, DOfs%
  6544.  
  6545. DSeg%      segment of storage array, returned by VARSEG
  6546. DOfs%      offset  of storage array, returned by VARPTR
  6547.  
  6548. Name  : GXQPrint             (Graphics Extended Quick Print)
  6549. Class : Display
  6550. Level : Clone
  6551.  
  6552. This is a simple high-speed replacement for the PRINT statement
  6553. which works in CGA graphics mode (SCREEN 1). It does not
  6554. interpret control codes, support graphics characters (ASCII
  6555. 128-255), or update the cursor position, in return for which it
  6556. is much faster than PRINT.
  6557.  
  6558. This routine can also be used in SCREEN 2, where it will display
  6559. the string in shades instead of in color (using 40 columns/row).
  6560.  
  6561. The Fast% parameter is ignored at the moment-- top speed is
  6562. always used, which may cause flickering on some CGAs.
  6563.  
  6564. The results of this routine are not redirectable by DOS.
  6565.  
  6566.    GXQPrint St$, Row%, Column%, Fore%, Fast%
  6567.  
  6568. St$      string to display
  6569. Row%     row (1-25)
  6570. Column%  column (1-40)
  6571. Fore%    foreground color (0-3)
  6572. Fast%    not used
  6573.  
  6574. Name  : GXQPrint1            (Graphics Extended Quick Print)
  6575. Class : Display
  6576. Level : Clone
  6577.  
  6578. This is a high-speed replacement for the PRINT statement which
  6579. works in CGA graphics mode (SCREEN 1). It does not interpret
  6580. control codes or update the cursor position, in return for which
  6581. it is much faster than PRINT.
  6582.  
  6583. This routine can also be used in SCREEN 2, where it will display
  6584. the string in shades instead of in color (using 40 columns/row).
  6585.  
  6586. The Fast% parameter is ignored at the moment-- top speed is
  6587. always used, which may cause flickering on some CGAs.
  6588.  
  6589. The results of this routine are not redirectable by DOS.
  6590.  
  6591.    GXQPrint1 St$, Row%, Column%, Fore%, Back%, Fast%
  6592.  
  6593. St$      string to display
  6594. Row%     row (1-25)
  6595. Column%  column (1-40)
  6596. Fore%    foreground color (0-3)
  6597. Back%    background color (0-3)
  6598. Fast%    not used
  6599.  
  6600. Name  : HandleInfo           (Handle Information)
  6601. Class : Miscellaneous
  6602. Level : DOS
  6603.  
  6604. HandleInfo tells you whether a file handle refers to a file or
  6605. to a device. If the handle does not exist, an error code will be
  6606. returned.
  6607.  
  6608. This is for file handles as returned by FOpen1 and FCreate. It
  6609. can also be used with file numbers associated with OPEN, via a
  6610. BASIC function that was introduced with QuickBASIC 4.0:
  6611.  
  6612.    Handle% = FILEATTR(FileNumber%, 2)
  6613.  
  6614. See FClose1 for a list of predefined handles.
  6615.  
  6616.    HandleInfo Handle%, Device%, ErrCode%
  6617.  
  6618. Handle%    file handle
  6619. -------
  6620. Device%    whether the handle refers to a device (0 no)
  6621. ErrCode%   whether there was an error (0 no)
  6622.  
  6623. Name  : HCls                 (Hercules CLS)
  6624. Class : Display
  6625. Level : Clone
  6626.  
  6627. This routine clears a Hercules graphics screen to the specified
  6628. color.
  6629.  
  6630. Routines in this series are:
  6631.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6632.  
  6633.    HCls Colour%
  6634.  
  6635. Colour%    color (0-1)
  6636.  
  6637. Name  : Heads%               (Heads)
  6638. Class : Disk
  6639. Level : DOS 3.3+
  6640.  
  6641. This function returns the number of heads for a given disk
  6642. drive. If the drive does not exist or is not a physical drive,
  6643. -1 will be returned.
  6644.  
  6645. You may use "" to denote the current drive.
  6646.  
  6647.    Hds% = Heads% (Drive$)
  6648.  
  6649. Drive$    drive for which to return cylinders
  6650. -------
  6651. Heads%    number of drive heads (-1 if error)
  6652.  
  6653. Name  : HiByte%              (High Byte)
  6654. Class : Numeric
  6655. Level : Any
  6656.  
  6657. This function returns the high byte of an integer.
  6658.  
  6659.    Byte% = HiByte%(Nr%)
  6660.  
  6661. Nr%        integer
  6662. -------
  6663. Byte%      value of the most significant byte
  6664.  
  6665. Name  : HiLite               (Highlight)
  6666. Class : Display
  6667. Level : Clone
  6668.  
  6669. This routine allows you to highlight text on the screen. It
  6670. works in text modes only and always displays to the visible
  6671. screen page.
  6672.  
  6673. See also ReColorArea, which lets you highlight any rectangular
  6674. area of the screen.
  6675.  
  6676.    HiLite Row%, LCol%, RCol%, VAttr%
  6677.  
  6678. Row%       row on which to highlight
  6679. LCol%      left column (where highlight starts)
  6680. RCol%      right column (where highlight ends)
  6681. VAttr%     new color (see CalcAttr)
  6682.  
  6683. Name  : HiWord%              (High Word)
  6684. Class : Numeric
  6685. Level : Any
  6686.  
  6687. This function returns the high word of a long integer.
  6688.  
  6689.    Word% = HiWord%(Nr&)
  6690.  
  6691. Nr&        long integer
  6692. -------
  6693. Word%      value of the most significant word
  6694.  
  6695. Name  : HLine                (Hercules LINE)
  6696. Class : Display
  6697. Level : Clone
  6698.  
  6699. This routine draws a line on a Hercules graphics screen.
  6700.  
  6701. Routines in this series are:
  6702.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6703.  
  6704.    HLine X1%, Y1%, X2%, Y2%, Colour%
  6705.  
  6706. X1%        starting graphics column (0-719)
  6707. Y1%        starting graphics row (0-347)
  6708. X2%        ending graphics column (0-719)
  6709. Y2%        ending graphics row (0-347)
  6710. Colour%    color (0-1)
  6711.  
  6712. Name  : HMode                (Hercules Mode)
  6713. Class : Display
  6714. Level : Clone
  6715.  
  6716. This routine switches between text mode and Hercules graphics
  6717. mode. Use HInit first to initialize the graphics mode
  6718. appropriately.
  6719.  
  6720. HMode will clear page 0 when graphics mode is entered. Page 1,
  6721. if it exists, is not cleared. PBClone does not support page 1 in
  6722. any respect.
  6723.  
  6724. Routines in this series are:
  6725.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6726.  
  6727.    HMode Graphics%
  6728.  
  6729. Graphics%    display mode to set (0 text, else graphics)
  6730.  
  6731. Name  : HPrint               (Hercules Print)
  6732. Class : Display
  6733. Level : Clone
  6734.  
  6735. This routine displays text in Hercules graphics mode. It uses
  6736. the full resolution of the screen, so text is 90 columns by 43
  6737. rows. This gives you more space than even the largest EGA text
  6738. mode, which is only 80x43.
  6739.  
  6740. Routines in this series are:
  6741.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6742.  
  6743.    HPrint St$, Row%, Column%
  6744.  
  6745. St$        text to display
  6746. Row%       row (1-43)
  6747. Column%    column (1-90)
  6748.  
  6749. Name  : HSetPixel            (Hercules Set Pixel)
  6750. Class : Display
  6751. Level : Clone
  6752.  
  6753. This routine draws a dot on a Hercules graphics screen.
  6754.  
  6755. Routines in this series are:
  6756.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6757.  
  6758.    HSetPixel X%, Y%, Colour%
  6759.  
  6760. X%         graphics column (0-719)
  6761. Y%         graphics row (0-347)
  6762. Colour%    color (0-1)
  6763.  
  6764. Name  : HTestPixel           (Hercules Test Pixel)
  6765. Class : Display
  6766. Level : Clone
  6767.  
  6768. This routine returns the color of a dot on a Hercules graphics
  6769. screen.
  6770.  
  6771. Routines in this series are:
  6772.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6773.  
  6774.    Colour% = HTestPixel%(X%, Y%)
  6775.  
  6776. X%         graphics column (0-719)
  6777. Y%         graphics row (0-347)
  6778. -------
  6779. Colour%    color (0-1)
  6780.  
  6781. Name  : IdentifyFile         (Identify File)
  6782. Class : Disk
  6783. Level : DOS
  6784.  
  6785. Given a file name, this routine attempts to identify what kind
  6786. of file it is. Most information is derived from the file
  6787. extension, but some files are processed more deeply. For
  6788. instance, a file named "UNKNOWN.BAS" will be checked to see if
  6789. it is source code (tokenized GWBASIC format, tokenized
  6790. QuickBASIC format, or plain ASCII text) or a binary BSAVE/BLOAD
  6791. image (which is further categorized as to whether it is a screen
  6792. image, and if so, for what kind of display).
  6793.  
  6794.    Descript$ = SPACE$(80)
  6795.    IdentifyFile FileName$, Descript$, DescrLen%
  6796.    Descript$ = LEFT$(Descript$, DescrLen%)
  6797.  
  6798. FileName$    name of the file to identify
  6799. -------
  6800. Descript$    description of the file (init to at least 80 chars)
  6801. DescrLen%    length of the description
  6802.  
  6803. Name  : InitPtr              (Initialize Pointers)
  6804. Class : Array management
  6805. Level : Any
  6806.  
  6807. This routine initializes an array of pointers for use with the
  6808. pointer sort routines (PSortD, et al). It may also be useful for
  6809. other purposes. Each element of the array is set equal to its
  6810. index (the first element is set to 1, the second to 2, and so
  6811. forth). Arrays are expected to begin at element 1. You may
  6812. specify the last element to initialize, allowing you to use only
  6813. part of an array.
  6814.  
  6815.    InitPtr Ptr%(), Elements%
  6816.  
  6817. Ptr%()      array to initialize
  6818. Elements%   number of elements to initialize
  6819. -------
  6820. Ptr%()      initialized array
  6821.  
  6822. Name  : InsChr               (Insert Character)
  6823. Class : Display
  6824. Level : Clone
  6825.  
  6826. The InsChr routine inserts a space at the specified screen
  6827. location.
  6828.  
  6829.    InsChr Row%, Column%
  6830.  
  6831. Row%      row of character
  6832. Column%   column of character
  6833.  
  6834. Name  : InsLine              (Insert Line)
  6835. Class : Display
  6836. Level : BIOS
  6837.  
  6838. This routine inserts a blank line at the specified row of the
  6839. screen.
  6840.  
  6841.    InsLine Row%, VAttr%
  6842.  
  6843. Row%      row to insert
  6844. VAttr%    color/attribute to use on new row (see CalcAttr)
  6845.  
  6846. Name  : Int2Date             (Integer to Date)
  6847. Class : Time
  6848. Level : Any
  6849.  
  6850. This routine undoes the results of the Date2Int routine. It
  6851. expands a single integer into month, day, and year values.
  6852.  
  6853. The storage format is identical to that used by DOS for file
  6854. dates, by the way, so this routine makes an apt companion for
  6855. LoadDirAll.
  6856.  
  6857.  
  6858. See also Int2DateSt$, a version of this routine which returns a
  6859. string instead of numbers.
  6860.  
  6861.  
  6862.    Int2Date MonthNr%, DayNr%, YearNr%, IntDate%
  6863.  
  6864. IntDate%     date compressed into an integer
  6865. -------
  6866. MonthNr%     month number (1-12)
  6867. DayNr%       day (1-31)
  6868. YearNr%      year (1980-2079; see above for two-digit years)
  6869.  
  6870. Name  : Int2DateSt$          (Integer to Date String)
  6871. Class : Time
  6872. Level : Any
  6873.  
  6874. This routine undoes the results of the Date2Int routine. It
  6875. expands a single integer into a date string with the format
  6876. MM-DD-YYYY.
  6877.  
  6878. The storage format is identical to that used by DOS for file
  6879. dates, by the way, so this routine makes an apt companion for
  6880. LoadDirAll.
  6881.  
  6882. See also Int2Date, a version of this routine which returns
  6883. month, day, and year numbers instead of a string.
  6884.  
  6885.  
  6886.    DateSt$ = Int2DateSt$(IntDate%)
  6887.  
  6888. IntDate%     date compressed into an integer
  6889. -------
  6890. DateSt$      uncompressed date in MM-DD-YYYY format.
  6891.  
  6892. Name  : Int2Time             (Integer to Time)
  6893. Class : Time
  6894. Level : Any
  6895.  
  6896. This routine undoes the results of the Time2Int routine. It
  6897. expands a single integer into hour, minute, and second values.
  6898.  
  6899. Note that the seconds will always be even, due to the storage
  6900. format. The storage format is identical to that used by DOS for
  6901. file times, by the way, so this routine makes an apt companion
  6902. for LoadDirAll.
  6903.  
  6904. See also Int2TimeSt$, a version of this routine which returns a
  6905. string instead of numbers.
  6906.  
  6907.    Int2Time HourNr%, MinuteNr%, SecondNr%, IntTime%
  6908.  
  6909. IntTime%     time compressed into an integer
  6910. -------
  6911. HourNr%      hour (0-23)
  6912. MinuteNr%    minute
  6913. SecondNr%    second
  6914.  
  6915. Name  : Int2TimeSt$          (Integer to Time String)
  6916. Class : Time
  6917. Level : Any
  6918.  
  6919. This routine undoes the results of the Time2Int routine. It
  6920. expands a single integer into hour, minute, and second values.
  6921.  
  6922. Note that the seconds will always be even, due to the storage
  6923. format. The storage format is identical to that used by DOS for
  6924. file times, by the way, so this routine makes an apt companion
  6925. for LoadDirAll.
  6926.  
  6927. See also Int2Time, a version of this routine which returns hour,
  6928. minute, and second numbers instead of a string.
  6929.  
  6930.    TimeSt$ = Int2TimeSt$(IntTime%)
  6931.  
  6932. IntTime%     time compressed into an integer
  6933. -------
  6934. TimeSt$      uncompressed time in HH:MM:SS format
  6935.  
  6936. Name  : IntVector            (Interrupt Vector)
  6937. Class : Miscellaneous
  6938. Level : DOS
  6939.  
  6940. The IntVector routine retrieves the address of a specified
  6941. interrupt handler. If there is no interrupt handler, the results
  6942. will normally be zero, although early DOS versions did not
  6943. always have the sense to initialize unused vectors that way.
  6944.  
  6945.    IntVector DSeg%, DOfs%, Interrupt%
  6946.  
  6947. Interrupt%   interrupt number to examine
  6948. -------
  6949. DSeg%        segment of the interrupt handler
  6950. DOfs%        offset of the interrupt handler
  6951.  
  6952. Name  : IRead                (Integer Read)
  6953. Class : Disk
  6954. Level : DOS
  6955.  
  6956. This routine reads an integer (two binary bytes) from a file.
  6957. For some applications, you might prefer LIRead, which reads an
  6958. integer from a file into a zero-extended long integer-- which
  6959. essentially provides support for unsigned integers (0-65535).
  6960.  
  6961. The file must have been opened using FCreate or FOpen1.
  6962.  
  6963.    IRead Handle%, Value%, ErrCode%
  6964.  
  6965. Handle%    file handle
  6966. -------
  6967. Value%     integer read from file
  6968. ErrCode%   DOS error code (0 if no error)
  6969.  
  6970. Name  : IsAlNum%             (Is Alphanumeric?)
  6971. Class : String
  6972. Level : Any
  6973.  
  6974. This function returns whether a character is alphabetic or
  6975. numeric.
  6976.  
  6977. Functions in this family include:
  6978.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6979.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6980.  
  6981.    IsIt% = IsAlNum%(Ch$)
  6982.  
  6983. Ch$       character to check
  6984. -------
  6985. IsIt%     -1 if the character is alphabetic or numeric
  6986.  
  6987. Name  : IsAlpha%             (Is Alphabetic?)
  6988. Class : String
  6989. Level : Any
  6990.  
  6991. This function returns whether a character is alphabetic.
  6992.  
  6993. Functions in this family include:
  6994.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6995.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6996.  
  6997.    IsIt% = IsAlpha%(Ch$)
  6998.  
  6999. Ch$       character to check
  7000. -------
  7001. IsIt%     -1 if the character is alphabetic
  7002.  
  7003. Name  : IsASCII%             (Is ASCII?)
  7004. Class : String
  7005. Level : Any
  7006.  
  7007. This function returns whether a character is ASCII. This is true
  7008. if the character ranges from CHR$(0)-CHR$(127).
  7009.  
  7010. Functions in this family include:
  7011.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7012.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7013.  
  7014.    IsIt% = IsASCII%(Ch$)
  7015.  
  7016. Ch$       character to check
  7017. -------
  7018. IsIt%     -1 if the character is ASCII
  7019.  
  7020. Name  : IsCntrl%             (Is Control?)
  7021. Class : String
  7022. Level : Any
  7023.  
  7024. This function returns whether a character is a control code.
  7025. This is true for CHR$(0)-CHR$(32) and CHR$(127).
  7026.  
  7027. Functions in this family include:
  7028.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7029.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7030.  
  7031.    IsIt% = IsCntrl%(Ch$)
  7032.  
  7033. Ch$       character to check
  7034. -------
  7035. IsIt%     -1 if the character is a control code
  7036.  
  7037. Name  : IsDigit%             (Is Digit?)
  7038. Class : String
  7039. Level : Any
  7040.  
  7041. This function returns whether a character is numeric.
  7042.  
  7043. Functions in this family include:
  7044.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7045.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7046.  
  7047.    IsIt% = IsDigit%(Ch$)
  7048.  
  7049. Ch$       character to check
  7050. -------
  7051. IsIt%     -1 if the character is a digit
  7052.  
  7053. Name  : IsLower%             (Is Lowercase?)
  7054. Class : String
  7055. Level : Any
  7056.  
  7057. This function returns whether a character is a lowercase letter.
  7058.  
  7059. Functions in this family include:
  7060.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7061.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7062.  
  7063.    IsIt% = IsLower%(Ch$)
  7064.  
  7065. Ch$       character to check
  7066. -------
  7067. IsIt%     -1 if the character is a lowercase letter
  7068.  
  7069. Name  : IsPrint%             (Is Printable?)
  7070. Class : String
  7071. Level : Any
  7072.  
  7073. This function returns whether a character is printable. This is
  7074. true for CHR$(32)-CHR$(126).
  7075.  
  7076. Functions in this family include:
  7077.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7078.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7079.  
  7080.    IsIt% = IsPrint%(Ch$)
  7081.  
  7082. Ch$       character to check
  7083. -------
  7084. IsIt%     -1 if the character is printable
  7085.  
  7086. Name  : IsPunct%             (Is Punctuation?)
  7087. Class : String
  7088. Level : Any
  7089.  
  7090. This function returns whether a character is punctuation. This
  7091. is true for any ASCII character that is not alphabetic, numeric,
  7092. or a control code; and for a space.
  7093.  
  7094. Functions in this family include:
  7095.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7096.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7097.  
  7098.    IsIt% = IsPunct%(Ch$)
  7099.  
  7100. Ch$       character to check
  7101. -------
  7102. IsIt%     -1 if the character is punctuation
  7103.  
  7104. Name  : IsSpace%             (Is Space?)
  7105. Class : String
  7106. Level : Any
  7107.  
  7108. This function returns whether a character is white space. This
  7109. includes Space, Carriage Return, Horizontal Tab, Vertical Tab,
  7110. LineFeed, and FormFeed characters.
  7111.  
  7112. Functions in this family include:
  7113.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7114.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7115.  
  7116.    IsIt% = IsSpace%(Ch$)
  7117.  
  7118. Ch$       character to check
  7119. -------
  7120. IsIt%     -1 if the character is white space
  7121.  
  7122. Name  : IStr$                (Integer STR$)
  7123. Class : String
  7124. Level : Any
  7125.  
  7126. This function is identical to the BASIC function STR$, but is
  7127. somewhat smaller. It is only for integer values.
  7128.  
  7129. If you prefer not to have a leading blank for non-negative
  7130. numbers, use the IStrNB$ function instead.
  7131.  
  7132.    St$ = IStr$(Number%)
  7133.  
  7134. Number%   integer to convert
  7135. -------
  7136. St$       string form of the number
  7137.  
  7138. Name  : IStrNB$              (Integer STR$, No Blank)
  7139. Class : String
  7140. Level : Any
  7141.  
  7142. This function is similar to the BASIC function STR$, but is
  7143. somewhat smaller. It is only for integer values. Unlike the STR$
  7144. function, this function does not add a leading blank to
  7145. non-negative numbers.
  7146.  
  7147. If you prefer to have a leading blank for non-negative numbers,
  7148. use the IStr$ function instead.
  7149.  
  7150.    St$ = IStrNB$(Number%)
  7151.  
  7152. Number%   integer to convert
  7153. -------
  7154. St$       string form of the number
  7155.  
  7156. Name  : IsUpper%             (Is Uppercase?)
  7157. Class : String
  7158. Level : Any
  7159.  
  7160. This function returns whether a character is an uppercase
  7161. letter.
  7162.  
  7163. Functions in this family include:
  7164.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7165.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7166.  
  7167.    IsIt% = IsUpper%(Ch$)
  7168.  
  7169. Ch$       character to check
  7170. -------
  7171. IsIt%     -1 if the character is uppercase
  7172.  
  7173. Name  : IsXDigit%            (Is Hex Digit?)
  7174. Class : String
  7175. Level : Any
  7176.  
  7177. This function returns whether a character is a hexadecimal
  7178. digit.
  7179.  
  7180. Functions in this family include:
  7181.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7182.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7183.  
  7184.    IsIt% = IsXDigit%(Ch$)
  7185.  
  7186. Ch$       character to check
  7187. -------
  7188. IsIt%     -1 if the character is a hex digit
  7189.  
  7190. Name  : IVal%                (Integer VAL)
  7191. Class : Numeric
  7192. Level : Any
  7193.  
  7194. This routine is similar to the BASIC function VAL, but is much
  7195. faster. If you are not using floating point numbers, this
  7196. routine may also decrease the size of your program
  7197. significantly, since it won't cause BASIC to pull in its
  7198. floating point routines as VAL does.
  7199.  
  7200. Unlike VAL, this routine only converts strings to integer
  7201. values. It will not handle hex or octal strings. It will not
  7202. notify you if there is an overflow error. Finally, although
  7203. IVal% will ignore leading blanks, it assumes that a number may
  7204. not contain blanks, whereas VAL will ignore blanks in the middle
  7205. of a number:
  7206.  
  7207.      VAL("  12 34") returns 1234
  7208.    IVal%("  12 34") returns 12
  7209.  
  7210. Note that, like VAL (but unlike the IVal% function in ProBas),
  7211. multiple negation is considered illegal. For example, the result
  7212. of IVal%("--1") is zero.
  7213.  
  7214.    Number% = IVal%(St$)
  7215.  
  7216. St$       string to convert
  7217. -------
  7218. Number%   integer form of string (0 if there isn't one)
  7219.  
  7220. Name  : IWrite               (Integer Write)
  7221. Class : Disk
  7222. Level : DOS
  7223.  
  7224. This routine writes an integer (two binary bytes) to a file.
  7225.  
  7226. The file must have been opened using FCreate or FOpen1.
  7227.  
  7228.    IWrite Handle%, Value%, ErrCode%
  7229.  
  7230. Handle%    file handle
  7231. Value%     integer to write to file
  7232. -------
  7233. ErrCode%   DOS error code (0 if no error)
  7234.  
  7235. Name  : JButtonA1%           (Joystick Button A1)
  7236. Class : Input
  7237. Level : BIOS
  7238.  
  7239. This function returns the status of joystick A button 1. The
  7240. result will be -1 if the button is pressed, or 0 if not.
  7241.  
  7242. If you need information on more than one button, you will find
  7243. it substantially faster to use the JButtons routine, which
  7244. returns the status of all joystick buttons at once.
  7245.  
  7246. Note that this function will not work on the oldest PCs (those
  7247. made before 1983 or so).
  7248.  
  7249.    Status% = JButtonA1%
  7250.  
  7251. -------
  7252. Status%      whether joystick A button 1 is pressed (0 no)
  7253.  
  7254. Name  : JButtonA2%           (Joystick Button A2)
  7255. Class : Input
  7256. Level : BIOS
  7257.  
  7258. This function returns the status of joystick A button 2. The
  7259. result will be -1 if the button is pressed, or 0 if not.
  7260.  
  7261. If you need information on more than one button, you will find
  7262. it substantially faster to use the JButtons routine, which
  7263. returns the status of all joystick buttons at once.
  7264.  
  7265. Note that this function will not work on the oldest PCs (those
  7266. made before 1983 or so).
  7267.  
  7268.    Status% = JButtonA2%
  7269.  
  7270. -------
  7271. Status%      whether joystick A button 2 is pressed (0 no)
  7272.  
  7273. Name  : JButtonB1%           (Joystick Button B1)
  7274. Class : Input
  7275. Level : BIOS
  7276.  
  7277. This function returns the status of joystick B button 1. The
  7278. result will be -1 if the button is pressed, or 0 if not.
  7279.  
  7280. If you need information on more than one button, you will find
  7281. it substantially faster to use the JButtons routine, which
  7282. returns the status of all joystick buttons at once.
  7283.  
  7284. Note that this function will not work on the oldest PCs (those
  7285. made before 1983 or so).
  7286.  
  7287.    Status% = JButtonB1%
  7288.  
  7289. -------
  7290. Status%      whether joystick B button 1 is pressed (0 no)
  7291.  
  7292. Name  : JButtonB2%           (Joystick Button B2)
  7293. Class : Input
  7294. Level : BIOS
  7295.  
  7296. This function returns the status of joystick B button 2. The
  7297. result will be -1 if the button is pressed, or 0 if not.
  7298.  
  7299. If you need information on more than one button, you will find
  7300. it substantially faster to use the JButtons routine, which
  7301. returns the status of all joystick buttons at once.
  7302.  
  7303. Note that this function will not work on the oldest PCs (those
  7304. made before 1983 or so).
  7305.  
  7306.    Status% = JButtonB2%
  7307.  
  7308. -------
  7309. Status%      whether joystick B button 2 is pressed (0 no)
  7310.  
  7311. Name  : JButtons             (Joystick Buttons)
  7312. Class : Input
  7313. Level : BIOS
  7314.  
  7315. This routine returns the status of all joystick buttons. The
  7316. result will be -1 if the button is pressed, or 0 if not.
  7317.  
  7318. This routine is ideal if you need to check more than one
  7319. joystick button. It is substantially faster than using several
  7320. single-button status functions. However, if you only need to
  7321. check a single button, or speed is not an issue, you may find it
  7322. more convenient to use the functions:
  7323.    JButtonA1%, JButtonA2%, JButtonB1%, JButtonB2%
  7324.  
  7325. Note that this routine will not work on the oldest PCs (those
  7326. made before 1983 or so).
  7327.  
  7328.    JButtons A1%, A2%, B1%, B2%
  7329.  
  7330. -------
  7331. A1%        whether joystick A button 1 is pressed (0 no)
  7332. A2%        whether joystick A button 2 is pressed (0 no)
  7333. B1%        whether joystick B button 1 is pressed (0 no)
  7334. B2%        whether joystick B button 2 is pressed (0 no)
  7335.  
  7336. Name  : JPos                 (Joystick Positions)
  7337. Class : Input
  7338. Level : BIOS
  7339.  
  7340. This routine returns the X,Y positions of both joysticks. If
  7341. there is only one joystick attached, the results for the second
  7342. joystick will usually be meaningless-- except in the case of the
  7343. FlightStick, which returns the "throttle" status via the Y
  7344. position of an imaginary joystick B.
  7345.  
  7346. Note that X represents the horizontal axis and Y the vertical.
  7347. I've seen considerable confusion on that topic... I use the
  7348. standard mathematical convention here.
  7349.  
  7350. The range of values returned depends on the individual joystick
  7351. and may drift somewhat. You would be well advised to include a
  7352. joystick "calibration" routine in your program to customize your
  7353. settings to the particular joystick used. I find a range of
  7354. about 5-140 on my FlightStick; your mileage may vary.
  7355.  
  7356. Note that this routine will not work on the oldest PCs (those
  7357. made before 1983 or so).
  7358.  
  7359.    JPos AX%, AY%, BX%, BY%
  7360.  
  7361. -------
  7362. AX%        X position of joystick A
  7363. AY%        Y position of joystick A
  7364. BX%        X position of joystick B
  7365. BY%        Y position of joystick B (or FlightStick throttle)
  7366.  
  7367. Name  : KbdType              (Keyboard Type)
  7368. Class : Input / Equipment
  7369. Level : Clone
  7370.  
  7371. This routine tells you if an enhanced (101-key) keyboard is
  7372. available.
  7373.  
  7374. If KbdType is not entirely sure that an enhanced keyboard is
  7375. available, it plays safe and assumes there isn't one. This
  7376. avoids possible disaster on older PCs.
  7377.  
  7378.    KbdType Enhanced%
  7379.  
  7380. -------
  7381. Enhanced%    whether keyboard is of the enhanced type (0 no)
  7382.  
  7383. Name  : KbdType2%            (Keyboard Type)
  7384. Class : Input / Equipment
  7385. Level : Clone
  7386.  
  7387. This routine tells you if an enhanced (101-key) keyboard is
  7388. available.
  7389.  
  7390. If KbdType2% is not entirely sure that an enhanced keyboard is
  7391. available, it plays safe and assumes there isn't one. This
  7392. avoids possible disaster on older PCs.
  7393.  
  7394.    Enhanced% = KbdType2%
  7395.  
  7396. -------
  7397. Enhanced%    whether keyboard is of the enhanced type (0 no)
  7398.  
  7399. Name  : KeyPress             (detect Key Press)
  7400. Class : Input
  7401. Level : DOS
  7402.  
  7403. This routine works like the Turbo/Power BASIC function INSTAT.
  7404. It tells you whether there is a key waiting to be processed.
  7405.  
  7406.    KeyPress KeyHit%
  7407.  
  7408. -------
  7409. KeyHit%   whether a key is waiting (0 if no)
  7410.  
  7411. Name  : KVal&                (Kilobyte VAL)
  7412. Class : Numeric
  7413. Level : Any
  7414.  
  7415. This routine is similar to the BASIC function VAL, but is much
  7416. faster. The number returned is divided by 1024, which is useful
  7417. if you're dealing in terms of kilobytes. If you are not using
  7418. floating point numbers, this routine may decrease the size of
  7419. your program significantly, since it won't cause BASIC to pull
  7420. in its floating point routines as VAL does.
  7421.  
  7422. Unlike VAL, this routine only converts strings to long integer
  7423. values. It will not handle hex or octal strings. It will not
  7424. notify you if there is an overflow error. Finally, although
  7425. KVal& will ignore leading blanks, it assumes that a number may
  7426. not contain blanks, whereas VAL will ignore blanks in the middle
  7427. of a number.
  7428.  
  7429. Note that, like VAL (but unlike the KVal& function in ProBas),
  7430. multiple negation is considered illegal. For example, the result
  7431. of KVal&("--10000") is zero.
  7432.  
  7433.    Number& = KVal&(St$)
  7434.  
  7435. St$       string to convert
  7436. -------
  7437. Number&   long integer form of string, divided by 1024
  7438.  
  7439. Name  : LClickLoc            (Left Click Location)
  7440. Class : Mouse
  7441. Level : BIOS
  7442.  
  7443. This routine returns the position of the mouse cursor at the
  7444. last click of the left mouse button. It must be used after one
  7445. of the routines which check for mouse clicks, as they maintain
  7446. the click position. These routines include GetKey, GetKey3,
  7447. MMClick, and MMClick3.
  7448.  
  7449. The values returned are in graphics coordinates (virtual
  7450. coordinates for SCREEN 0 through SCREEN 2, due to the nature of
  7451. the mouse driver).
  7452.  
  7453.    LClickLoc X%, Y%
  7454.  
  7455. -------
  7456. X%         horizontal coordinate at last left click
  7457. Y%         vertical coordinate at last left click
  7458.  
  7459. Name  : LClose               (L/I/M Close)
  7460. Class : Memory
  7461. Level : BIOS
  7462.  
  7463. This routine closes a block of expanded memory that was opened
  7464. for access by LOpen. It is important to close the block when you
  7465. are finished with it, to return it to the free memory pool.
  7466.  
  7467. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7468.  
  7469.    LClose EMSHandle%
  7470.  
  7471. EMSHandle%    handle of the expanded memory block
  7472.  
  7473. Name  : LGet                 (L/I/M Get)
  7474. Class : Memory
  7475. Level : BIOS
  7476.  
  7477. This routine gets a block of data from expanded memory that was
  7478. opened for access by LOpen. The amount of data is specified in
  7479. words; one word is the same as two bytes. An integer takes up a
  7480. word, long integers and single precision numbers require two
  7481. words, and double precision numbers take four.
  7482.  
  7483. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7484.  
  7485.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  7486.  
  7487. EMSHandle%    handle of the expanded memory block
  7488. DSeg%         segment of place to store data
  7489. DOfs%         offset of place to store data
  7490. Words%        words to get from expanded memory
  7491.  
  7492. Name  : LIRead               (Long Integer Read)
  7493. Class : Disk
  7494. Level : DOS
  7495.  
  7496. This routine reads an integer from a file into a long integer.
  7497. The integer is zero-extended into the long, providing effective
  7498. support for unsigned integers (a range of 0-65535).
  7499.  
  7500. The file must have been opened using FCreate or FOpen1.
  7501.  
  7502.    LIRead Handle%, Value&, ErrCode%
  7503.  
  7504. Handle%    file handle
  7505. -------
  7506. Value&     integer read from file
  7507. ErrCode%   DOS error code (0 if no error)
  7508.  
  7509. Name  : LIWrite              (Long Integer Write)
  7510. Class : Disk
  7511. Level : DOS
  7512.  
  7513. This routine writes an integer to a file from a long integer.
  7514. This makes it easier to support unsigned integers (with a range
  7515. of 0-65535).
  7516.  
  7517. The file must have been opened using FCreate or FOpen1.
  7518.  
  7519.    LIWrite Handle%, Value&, ErrCode%
  7520.  
  7521. Handle%    file handle
  7522. Value&     integer to write to file
  7523. -------
  7524. ErrCode%   DOS error code (0 if no error)
  7525.  
  7526. Name  : LoadDir              (Load Directory)
  7527. Class : Disk
  7528. Level : DOS
  7529.  
  7530. Given a filespec with wildcards and a file attribute, this
  7531. routine loads a list of all matching files into an array. The
  7532. array must be of fixed-length string type, with 12 characters
  7533. for each filename. You can find out how large to DIM the array
  7534. by using the FileCount routine.
  7535.  
  7536. The attribute can be any of the usual file attributes:
  7537.    1   Read-Only
  7538.    2   Hidden
  7539.    4   System
  7540.   16   Directory
  7541.  
  7542. You can combine attributes by adding their values. For instance,
  7543. to search for hidden directories, you'd use an attribute of 18.
  7544. By default, DOS returns normal files as well as files which have
  7545. the specified attributes, so an attribute of 18 would get you
  7546. normal files, hidden files, directories, and hidden directories.
  7547. However, LoadDir can be made to screen out unwanted files-- just
  7548. negate the attribute to force only files of that attribute to be
  7549. counted. For example, an attribute of -18 would return only
  7550. hidden subdirectories.
  7551.  
  7552. NOTE: we use FilAttr%, not FileAttr%, because BASIC has an
  7553. internal function named FILEATTR.
  7554.  
  7555.    LoadDir FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  7556.  
  7557. FileSpec$    search file specification (may contain wildcards)
  7558. FilAttr%     search file attribute
  7559. DSeg%        segment of fixed-length-string array (use VARSEG)
  7560. DOfs%        offset of fixed-length-string array (use VARPTR)
  7561. -------
  7562. ErrCode%     error code (0 if no error)
  7563.  
  7564. Name  : LoadDirAll           (Load Directory, All info)
  7565. Class : Disk
  7566. Level : DOS
  7567.  
  7568. Given a filespec with wildcards and a file attribute, this
  7569. routine loads a list of all matching files into an array. All
  7570. available information about the file is included: name, size,
  7571. time, date, and attribute. The array must be of the TYPE shown
  7572. below. You can find out how large to DIM the array by using the
  7573. FileCount routine.
  7574.  
  7575.    TYPE DirType
  7576.       FilAttr AS STRING * 1
  7577.       FilTime AS INTEGER
  7578.       FilDate AS INTEGER
  7579.       FilSize AS LONG
  7580.       FilName AS STRING * 12
  7581.    END TYPE
  7582.  
  7583. You can change the names if you like, but don't alter the order
  7584. of the information. You can decode the file attribute with the
  7585. ASC function, then process it with ExplainFAttr$. The file time
  7586. and date can be decoded with the Int2Time and Int2Date or
  7587. Int2TimeSt$ and Int2DateSt$ routines.
  7588.  
  7589. The attribute can be any of the usual file attributes:
  7590.    1   Read-Only
  7591.    2   Hidden
  7592.    4   System
  7593.   16   Directory
  7594.  
  7595. You can combine attributes by adding their values. For instance,
  7596. to search for hidden directories, you'd use an attribute of 18.
  7597. By default, DOS returns normal files as well as files which have
  7598. the specified attributes, so an attribute of 18 would get you
  7599. normal files, hidden files, directories, and hidden directories.
  7600. However, LoadDirAll can be made to screen out unwanted files--
  7601. just negate the attribute to force only files of that attribute
  7602. to be counted. For example, an attribute of -18 would return
  7603. only hidden subdirectories.
  7604.  
  7605. NOTE: we use FilAttr%, not FileAttr%, because BASIC has an
  7606. internal function named FILEATTR.
  7607.  
  7608.    LoadDirAll FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  7609.  
  7610. FileSpec$    search file specification (may contain wildcards)
  7611. FilAttr%     search file attribute
  7612. DSeg%        segment of typed array (use VARSEG)
  7613. DOfs%        offset of typed array (use VARPTR)
  7614. -------
  7615. ErrCode%     error code (0 if no error)
  7616.  
  7617. Name  : LoByte%              (Low Byte)
  7618. Class : Numeric
  7619. Level : Any
  7620.  
  7621. This function returns the low byte of an integer.
  7622.  
  7623.    Byte% = LoByte%(Nr%)
  7624.  
  7625. Nr%        integer
  7626. -------
  7627. Byte%      value of the least significant byte
  7628.  
  7629. Name  : Locase               (Lowercase)
  7630. Class : String
  7631. Level : Any
  7632.  
  7633. This routine, like BASIC's LCASE$ function, converts a string to
  7634. lowercase. Since it doesn't have to create a new return string
  7635. (a fairly slow process), it's faster than the BASIC equivalent.
  7636.  
  7637. See also Locase1.
  7638.  
  7639.    Locase St$
  7640.  
  7641. St$     string to be put into lowercase
  7642. -------
  7643. St$     lowercase string
  7644.  
  7645. Name  : Locase1              (Lowercase)
  7646. Class : String
  7647. Level : Any
  7648.  
  7649. This routine, like BASIC's LCASE$ function, converts a string to
  7650. lowercase. It converts letters in the extended character set as
  7651. well as the usual letters, making it well suited for text which
  7652. may not be in English.
  7653.  
  7654. Note that DOS 5.0 and later versions provide National Language
  7655. Support which includes conversion to uppercase (not lowercase,
  7656. unfortunately). So, if you merely need the characters in a known
  7657. state, rather than lowercase, you would do better to use the
  7658. Upcase1 routine. Locase1 assumes the U.S. character set, which
  7659. may well not be appropriate.
  7660.  
  7661. See also Locase.
  7662.  
  7663.    Locase1 St$
  7664.  
  7665. St$     string to be put into lowercase
  7666. -------
  7667. St$     lowercase string
  7668.  
  7669. Name  : LogicalDrives%       (Logical Drives)
  7670. Class : Disk / Equipment
  7671. Level : DOS
  7672.  
  7673. This function returns the number of logical drives available.
  7674.  
  7675. A logical drive corresponds roughly to a drive letter-- it may
  7676. point to zero or more actual devices. For instance, on a
  7677. one-floppy system, both A: and B: point to the same drive. On a
  7678. partitioned hard drive, both C: and D: may point to different
  7679. areas of the same drive. Drive E: may point to a RAMdisk, or
  7680. maybe it doesn't point to anything at all.
  7681.  
  7682. As you can see, knowing the number of logical drives doesn't
  7683. tell you much about what's actually there. However, it does give
  7684. you an upper limit on the number of drive letters available,
  7685. which is a good place to start.
  7686.  
  7687.    Drives% = LogicalDrives%
  7688.  
  7689. -------
  7690. Drives%    number of logical drives
  7691.  
  7692. Name  : LOpen                (L/I/M Open)
  7693. Class : Memory
  7694. Level : BIOS
  7695.  
  7696. This routine opens a block of expanded memory for access. The
  7697. size of the block is specified in words; one word is the same as
  7698. two bytes. An integer takes up a word, long integers and single
  7699. precision numbers require two words, and double precision
  7700. numbers take four. This allows you to store up to 64K in each
  7701. EMS block that you open.
  7702.  
  7703. Note that LOpen expects an EMS driver to be available. If you
  7704. are not certain on this point, use GetLIMM beforehand to make
  7705. sure.
  7706.  
  7707. Routines in this suite include:
  7708.    LOpen, LGet, LPut, LClose.
  7709.  
  7710.    LOpen Words%, EMSHandle%, ErrCode%
  7711.  
  7712. Words%        size of expanded memory block to allocate
  7713. -------
  7714. EMSHandle%    handle of the expanded memory block
  7715. ErrCode%      error code (0 if no error)
  7716.  
  7717. Name  : LoWord%              (Low Word)
  7718. Class : Numeric
  7719. Level : Any
  7720.  
  7721. This function returns the low word of a long integer.
  7722.  
  7723.    Word% = LoWord%(Nr&)
  7724.  
  7725. Nr&        long integer
  7726. -------
  7727. Word%      value of the least significant word
  7728.  
  7729. Name  : LPut                 (L/I/M Put)
  7730. Class : Memory
  7731. Level : BIOS
  7732.  
  7733. This routine puts a block of data into expanded memory that was
  7734. opened for access by LOpen. The amount of data is specified in
  7735. words; one word is the same as two bytes. An integer takes up a
  7736. word, long integers and single precision numbers require two
  7737. words, and double precision numbers take four.
  7738.  
  7739. Routines in this suite include:
  7740.    LOpen, LGet, LPut, LClose.
  7741.  
  7742.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  7743.  
  7744. EMSHandle%    handle of the expanded memory block
  7745. DSeg%         segment of place from which to get data
  7746. DOfs%         offset of place from which to get data
  7747. Words%        words to put into expanded memory
  7748.  
  7749. Name  : LRead                (Long Read)
  7750. Class : Disk
  7751. Level : DOS
  7752.  
  7753. This routine reads a long integer (four binary bytes) from a
  7754. file.
  7755.  
  7756. The file must have been opened using FCreate or FOpen1.
  7757.  
  7758.    LRead Handle%, Value&, ErrCode%
  7759.  
  7760. Handle%    file handle
  7761. -------
  7762. Value&     long integer read from file
  7763. ErrCode%   DOS error code (0 if no error)
  7764.  
  7765. Name  : LRotate              (Left Rotate string)
  7766. Class : String
  7767. Level : Any
  7768.  
  7769. Many years ago, I wrote one of the first terminal programs for
  7770. the PC. It died a horrible death when Qmodem came out... sigh.
  7771. This routine comes from that experience. It rotates the
  7772. characters in a string left once (e.g., "ABCDE" becomes
  7773. "BCDEA"). I used this in my routine to dial a list of BBSes,
  7774. skipping to the next one if the current one was busy.
  7775.  
  7776. LRotate can also be handy for things like scrolling a long
  7777. message across the screen (you just PRINT LEFT$(Message$, 80);
  7778. then delay a bit, LRotate and do it again).
  7779.  
  7780. See also RRotate.
  7781.  
  7782.    LRotate St$
  7783.  
  7784. St$     string to be rotated left once
  7785. -------
  7786. St$     string after being rotated left once
  7787.  
  7788. Name  : LScroll              (Left Scroll)
  7789. Class : Display
  7790. Level : Clone
  7791.  
  7792. This routine scrolls any selected part of the display left. You
  7793. may scroll as many times as you like, or scroll "zero" times to
  7794. totally clear the selected part of the display.
  7795.  
  7796.    LScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  7797.  
  7798. TopRow%      top row of the area to scroll
  7799. LeftCol%     left column of the area to scroll
  7800. BottomRow%   top row of the area to scroll
  7801. RightCol%    left column of the area to scroll
  7802. Times%       number of times (or rows) to scroll
  7803.  
  7804. Name  : LVal&                (Long integer VAL)
  7805. Class : Numeric
  7806. Level : Any
  7807.  
  7808. This routine is similar to the BASIC function VAL, but is much
  7809. faster. If you are not using floating point numbers, this
  7810. routine may also decrease the size of your program quite a bit,
  7811. since it won't cause BASIC to pull in its floating point
  7812. routines as VAL does.
  7813.  
  7814. Unlike VAL, this routine only converts strings to long integer
  7815. values. It will not handle hex or octal strings. It will not
  7816. notify you if there is an overflow error. Finally, although
  7817. LVal& will ignore leading blanks, it assumes that a number may
  7818. not contain blanks, whereas VAL will ignore blanks in the middle
  7819. of a number:
  7820.  
  7821.      VAL("  12 34") returns 1234
  7822.    LVal&("  12 34") returns 12
  7823.  
  7824. Note that, like VAL (but unlike the LVal& function in ProBas),
  7825. multiple negation is considered illegal. For example, the result
  7826. of LVal&("--1") is zero.
  7827.  
  7828.    Number& = LVal&(St$)
  7829.  
  7830. St$       string to convert
  7831. -------
  7832. Number&   long integer form of string (0 if there isn't one)
  7833.  
  7834. Name  : LWrite               (Long Write)
  7835. Class : Disk
  7836. Level : DOS
  7837.  
  7838. This routine writes a long integer to a file.
  7839.  
  7840. The file must have been opened using FCreate or FOpen1.
  7841.  
  7842.    LWrite Handle%, Value&, ErrCode%
  7843.  
  7844. Handle%    file handle
  7845. Value&     long integer to write to file
  7846. -------
  7847. ErrCode%   DOS error code (0 if no error)
  7848.  
  7849. Name  : MakeSub              (Make Subdirectory)
  7850. Class : Disk
  7851. Level : DOS
  7852.  
  7853. Like the DOS MD (or MKDIR) command, this routine creates a new
  7854. subdirectory.
  7855.  
  7856.    MakeSub SubDir$, ErrCode%
  7857.  
  7858. SubDir$    name of new subdirectory
  7859. -------
  7860. ErrCode%   error code: 0 if none, else DOS Error
  7861.  
  7862. Name  : MatchFile            (Match File)
  7863. Class : Disk / String
  7864. Level : Any
  7865.  
  7866. The MatchFile routine tells you whether a given filename matches
  7867. a file specification which may contain wildcards. The filename
  7868. itself should not contain wildcards. Neither the filename nor
  7869. filespec should include drive or subdirectory specifications.
  7870.  
  7871. One way of using this is in processing file exclusion lists. The
  7872. FindFirstF routine allows you to find files that match a given
  7873. filespec; to this, you could add a MatchFile-based routine which
  7874. would screen out files that match a different filespec. Such a
  7875. routine would allow you to create utilities to do things like
  7876. "DIR *.* /EXCEPT=*.BAS".
  7877.  
  7878.    MatchFile FileSpec$, FileName$, IsMatch%
  7879.  
  7880. FileSpec$   master file pattern (may contain wildcards)
  7881. FileName$   name of file to test against the master pattern
  7882. -------
  7883. IsMatch%    0 if the filename doesn't match the filespec
  7884.  
  7885. Name  : MatShuffleD          (Matrix Shuffle Double-prec)
  7886. Class : Array
  7887. Level : Any
  7888.  
  7889. This routine shuffles the elements in a double-precision array,
  7890. efficiently randomizing their order. It relies on the RND
  7891. function, so you'd be advised to use the RANDOMIZE statement at
  7892. the top of your program unless you want the results to be
  7893. predictable. A good way of initializing the random number
  7894. generator is:
  7895.  
  7896.    RANDOMIZE TIMER
  7897.  
  7898. You can specify the starting and ending positions in the array
  7899. to shuffle, so you don't have to shuffle the entire array.
  7900.  
  7901. See also the string shuffle, ShuffleSt, and other array
  7902. shuffles: MatShuffleI, MatShuffleL, MatShuffleS, MatShuffleSt
  7903.  
  7904.    MatShuffleD Array#(), StartPosn%, EndPosn%
  7905.  
  7906. Array#()     array to shuffle
  7907. StartPosn%   element at which to begin shuffling
  7908. EndPosn%     element at which to stop shuffling
  7909. -------
  7910. Array#()     shuffled array
  7911.  
  7912. Name  : MatShuffleI          (Matrix Shuffle Integer)
  7913. Class : Array
  7914. Level : Any
  7915.  
  7916. This routine shuffles the elements in an integer array,
  7917. efficiently randomizing their order. It relies on the RND
  7918. function, so you'd be advised to use the RANDOMIZE statement at
  7919. the top of your program unless you want the results to be
  7920. predictable. A good way of initializing the random number
  7921. generator is:
  7922.  
  7923.    RANDOMIZE TIMER
  7924.  
  7925. You can specify the starting and ending positions in the array
  7926. to shuffle, so you don't have to shuffle the entire array.
  7927.  
  7928. See also the string shuffle, ShuffleSt, and other array
  7929. shuffles: MatShuffleD, MatShuffleL, MatShuffleS, MatShuffleSt
  7930.  
  7931.    MatShuffleI Array%(), StartPosn%, EndPosn%
  7932.  
  7933. Array%()     array to shuffle
  7934. StartPosn%   element at which to begin shuffling
  7935. EndPosn%     element at which to stop shuffling
  7936. -------
  7937. Array%()     shuffled array
  7938.  
  7939. Name  : MatShuffleL          (Matrix Shuffle Long integer)
  7940. Class : Array
  7941. Level : Any
  7942.  
  7943. This routine shuffles the elements in a long integer array,
  7944. efficiently randomizing their order. It relies on the RND
  7945. function, so you'd be advised to use the RANDOMIZE statement at
  7946. the top of your program unless you want the results to be
  7947. predictable. A good way of initializing the random number
  7948. generator is:
  7949.  
  7950.    RANDOMIZE TIMER
  7951.  
  7952. You can specify the starting and ending positions in the array
  7953. to shuffle, so you don't have to shuffle the entire array.
  7954.  
  7955. See also the string shuffle, ShuffleSt, and other array
  7956. shuffles: MatShuffleD, MatShuffleI, MatShuffleS, MatShuffleSt
  7957.  
  7958.    MatShuffleL Array&(), StartPosn%, EndPosn%
  7959.  
  7960. Array&()     array to shuffle
  7961. StartPosn%   element at which to begin shuffling
  7962. EndPosn%     element at which to stop shuffling
  7963. -------
  7964. Array&()     shuffled array
  7965.  
  7966. Name  : MatShuffleS          (Matrix Shuffle Single-prec)
  7967. Class : Array
  7968. Level : Any
  7969.  
  7970. This routine shuffles the elements in a single-precision array,
  7971. efficiently randomizing their order. It relies on the RND
  7972. function, so you'd be advised to use the RANDOMIZE statement at
  7973. the top of your program unless you want the results to be
  7974. predictable. A good way of initializing the random number
  7975. generator is:
  7976.  
  7977.    RANDOMIZE TIMER
  7978.  
  7979. You can specify the starting and ending positions in the array
  7980. to shuffle, so you don't have to shuffle the entire array.
  7981.  
  7982. See also the string shuffle, ShuffleSt, and other array
  7983. shuffles: MatShuffleD, MatShuffleI, MatShuffleL, MatShuffleSt
  7984.  
  7985.    MatShuffleS Array!(), StartPosn%, EndPosn%
  7986.  
  7987. Array!()     array to shuffle
  7988. StartPosn%   element at which to begin shuffling
  7989. EndPosn%     element at which to stop shuffling
  7990. -------
  7991. Array!()     shuffled array
  7992.  
  7993. Name  : MatShuffleSt         (Matrix Shuffle String)
  7994. Class : Array
  7995. Level : Any
  7996.  
  7997. This routine shuffles the elements in a string array,
  7998. efficiently randomizing their order. It relies on the RND
  7999. function, so you'd be advised to use the RANDOMIZE statement at
  8000. the top of your program unless you want the results to be
  8001. predictable. A good way of initializing the random number
  8002. generator is:
  8003.  
  8004.    RANDOMIZE TIMER
  8005.  
  8006. You can specify the starting and ending positions in the array
  8007. to shuffle, so you don't have to shuffle the entire array.
  8008.  
  8009. See also the string shuffle, ShuffleSt, and other array
  8010. shuffles: MatShuffleD, MatShuffleI, MatShuffleL, MatShuffleS
  8011.  
  8012.    MatShuffleSt Array$(), StartPosn%, EndPosn%
  8013.  
  8014. Array$()     array to shuffle
  8015. StartPosn%   element at which to begin shuffling
  8016. EndPosn%     element at which to stop shuffling
  8017. -------
  8018. Array$()     shuffled array
  8019.  
  8020. Name  : Max%                 (Maximum)
  8021. Class : Numeric
  8022. Level : Any
  8023.  
  8024. This function returns the larger of two integers. It can be
  8025. handy in sorting routines or for keeping a value within a
  8026. desired range.
  8027.  
  8028.    Larger% = Max%(First%, Second%)
  8029.  
  8030. First%     one integer
  8031. Second%    another integer
  8032. -------
  8033. Larger%    larger of the two integers
  8034.  
  8035. Name  : MaxD#                (Maximum Double precision)
  8036. Class : Numeric
  8037. Level : Any
  8038.  
  8039. This function returns the larger of two double-precision
  8040. numbers. It can be handy in sorting routines or for keeping a
  8041. value within a desired range.
  8042.  
  8043.    Larger# = MaxD#(First#, Second#)
  8044.  
  8045. First#     one number
  8046. Second#    another number
  8047. -------
  8048. Larger#    larger of the two numbers
  8049.  
  8050. Name  : MaxL&                (Maximum Long integer)
  8051. Class : Numeric
  8052. Level : Any
  8053.  
  8054. This function returns the larger of two long integers. It can be
  8055. handy in sorting routines or for keeping a value within a
  8056. desired range.
  8057.  
  8058.    Larger& = MaxL&(First&, Second&)
  8059.  
  8060. First&     one long integer
  8061. Second&    another long integer
  8062. -------
  8063. Larger&    larger of the two long integers
  8064.  
  8065. Name  : MaxS!                (Maximum Single precision)
  8066. Class : Numeric
  8067. Level : Any
  8068.  
  8069. This function returns the larger of two single-precision
  8070. numbers. It can be handy in sorting routines or for keeping a
  8071. value within a desired range.
  8072.  
  8073.    Larger! = MaxS!(First!, Second!)
  8074.  
  8075. First!     one number
  8076. Second!    another number
  8077. -------
  8078. Larger!    larger of the two numbers
  8079.  
  8080. Name  : MClickLoc            (Middle Click Location)
  8081. Class : Mouse
  8082. Level : BIOS
  8083.  
  8084. This routine returns the position of the mouse cursor at the
  8085. last click of the middle mouse button. It must be used after one
  8086. of the routines which check for mouse clicks, as they maintain
  8087. the click position. These routines include GetKey3 and MMClick3.
  8088.  
  8089. The values returned are in graphics coordinates (virtual
  8090. coordinates for SCREEN 0 through SCREEN 2, due to the nature of
  8091. the mouse driver).
  8092.  
  8093.    MClickLoc X%, Y%
  8094.  
  8095. -------
  8096. X%         horizontal coordinate at last middle click
  8097. Y%         vertical coordinate at last middle click
  8098.  
  8099. Name  : MeanAverageD         (Mean Average Double precision)
  8100. Class : Array management
  8101. Level : Any
  8102.  
  8103. This routine averages the specified range of elements in an
  8104. array of double precision numbers. The form of averaging used is
  8105. called the "mean", which is the sum of all of the elements
  8106. divided by the number of elements involved. This is the most
  8107. common method of averaging a list of numbers.
  8108.  
  8109.    MeanAverageD Array#(), First%, Last%, Average#, ErrCode%
  8110.  
  8111. Array#()    array to be averaged
  8112. First%      array element to start with
  8113. Last%       array element to end with
  8114. -------
  8115. Average#    average value of the specified elements
  8116. ErrCode%    0 if there was no error
  8117.  
  8118. Name  : MeanAverageI         (Mean Average Integer)
  8119. Class : Array management
  8120. Level : Any
  8121.  
  8122. This routine averages the specified range of elements in an
  8123. array of integer numbers. The form of averaging used is called
  8124. the "mean", which is the sum of all of the elements divided by
  8125. the number of elements involved. This is the most common method
  8126. of averaging a list of numbers.
  8127.  
  8128.    MeanAverageI Array%(), First%, Last%, Average%, ErrCode%
  8129.  
  8130. Array()     array to be averaged
  8131. First%      array element to start with
  8132. Last%       array element to end with
  8133. -------
  8134. Average%    average value of the specified elements
  8135. ErrCode%    0 if there was no error
  8136.  
  8137. Name  : MeanAverageL         (Mean Average Long integer)
  8138. Class : Array management
  8139. Level : Any
  8140.  
  8141. This routine averages the specified range of elements in an
  8142. array of long integer numbers. The form of averaging used is
  8143. called the "mean", which is the sum of all of the elements
  8144. divided by the number of elements involved. This is the most
  8145. common method of averaging a list of numbers.
  8146.  
  8147.    MeanAverageL Array&(), First%, Last%, Average&, ErrCode%
  8148.  
  8149. Array&()    array to be averaged
  8150. First%      array element to start with
  8151. Last%       array element to end with
  8152. -------
  8153. Average&    average value of the specified elements
  8154. ErrCode%    0 if there was no error
  8155.  
  8156. Name  : MeanAverageS         (Mean Average Single precision)
  8157. Class : Array management
  8158. Level : Any
  8159.  
  8160. This routine averages the specified range of elements in an
  8161. array of single precision numbers. The form of averaging used is
  8162. called the "mean", which is the sum of all of the elements
  8163. divided by the number of elements involved. This is the most
  8164. common method of averaging a list of numbers.
  8165.  
  8166.    MeanAverageS Array!(), First%, Last%, Average!, ErrCode%
  8167.  
  8168. Array!()    array to be averaged
  8169. First%      array element to start with
  8170. Last%       array element to end with
  8171. -------
  8172. Average!    average value of the specified elements
  8173. ErrCode%    0 if no error
  8174.  
  8175. Name  : MemSwap              (Memory Swap)
  8176. Class : Memory
  8177. Level : Any
  8178.  
  8179. MemSwap swaps the contents of one area of memory with another.
  8180. This can be used for a variety of things, from swapping a saved
  8181. screen with the actual screen to exchanging the contents of two
  8182. arrays.
  8183.  
  8184.    MemSwap DSeg1%, DOfs1%, DSeg2%, DOfs2%, Bytes%
  8185.  
  8186. DSeg1%     segment of first memory area
  8187. DOfs1%     offset of first memory area
  8188. DSeg2%     segment of second memory area
  8189. DOfs2%     offset of second memory area
  8190. Bytes%     bytes to swap
  8191.  
  8192. Name  : Min%                 (Minimum)
  8193. Class : Numeric
  8194. Level : Any
  8195.  
  8196. This function returns the smaller of two integers. It can be
  8197. handy in sorting routines or for keeping a value within a
  8198. desired range.
  8199.  
  8200.    Smaller% = Min%(First%, Second%)
  8201.  
  8202. First%     one integer
  8203. Second%    another integer
  8204. -------
  8205. Smaller%   smaller of the two integers
  8206.  
  8207. Name  : MinD#                (Minimum Double precision)
  8208. Class : Numeric
  8209. Level : Any
  8210.  
  8211. This function returns the smaller of two double-precision
  8212. numbers. It can be handy in sorting routines or for keeping a
  8213. value within a desired range.
  8214.  
  8215.    Smaller# = MinD#(First#, Second#)
  8216.  
  8217. First#     one number
  8218. Second#    another number
  8219. -------
  8220. Smaller#   smaller of the two numbers
  8221.  
  8222. Name  : MinL&                (Minimum Long integer)
  8223. Class : Numeric
  8224. Level : Any
  8225.  
  8226. This function returns the smaller of two long integers. It can
  8227. be handy in sorting routines or for keeping a value within a
  8228. desired range.
  8229.  
  8230.    Smaller& = MinL&(First&, Second&)
  8231.  
  8232. First&     one long integer
  8233. Second&    another long integer
  8234. -------
  8235. Smaller&   smaller of the two long integers
  8236.  
  8237. Name  : MinS!                (Minimum Single precision)
  8238. Class : Numeric
  8239. Level : Any
  8240.  
  8241. This function returns the smaller of two single-precision
  8242. numbers. It can be handy in sorting routines or for keeping a
  8243. value within a desired range.
  8244.  
  8245.    Smaller! = MinS!(First!, Second!)
  8246.  
  8247. First!     one number
  8248. Second!    another number
  8249. -------
  8250. Smaller!   smaller of the two numbers
  8251.  
  8252. Name  : MMButton             (Mouse Button)
  8253. Class : Mouse
  8254. Level : BIOS
  8255.  
  8256. The MMButton routine allows you to find out which mouse buttons
  8257. are pressed. Although it will work with any mouse, it is
  8258. designed specifically for a mouse with two buttons (see also
  8259. MMButton3). If you want to find out which buttons were pressed
  8260. in the past, rather than being pressed now, try MMClick instead.
  8261.  
  8262. This routine will not work properly if there is no mouse
  8263. available. Use the MMCheck routine if you are not sure.
  8264.  
  8265.    MMButton LeftB%, RightB%
  8266.  
  8267. -------
  8268. LeftB%     whether the left button is pressed
  8269. RightB%    whether the right button is pressed
  8270.  
  8271. Name  : MMButton3            (Mouse Button for 3-button mouse)
  8272. Class : Mouse
  8273. Level : BIOS
  8274.  
  8275. The MMButton3 routine allows you to find out which mouse buttons
  8276. are pressed. Although it will work with any mouse, it is
  8277. designed specifically for a mouse with three buttons (see also
  8278. MMButton). If you want to find out which buttons were pressed in
  8279. the past, rather than being pressed now, try MMClick3 instead.
  8280.  
  8281. This routine will not work properly if there is no mouse
  8282. available. Use the MMCheck routine if you are not sure.
  8283.  
  8284.    MMButton3 LeftB%, MiddleB%, RightB%
  8285.  
  8286. -------
  8287. LeftB%     whether the left button is pressed
  8288. MiddleB%   whether the middle button is pressed
  8289. RightB%    whether the right button is pressed
  8290.  
  8291. Name  : MMCheck              (Mouse Check and initialize)
  8292. Class : Mouse
  8293. Level : BIOS
  8294.  
  8295. This routine does a number of things. Primarily, it is intended
  8296. to let you check to see if a mouse is available. It returns a
  8297. zero if there is no mouse; if there is a mouse, the number of
  8298. mouse buttons is returned. The mouse status is also initialized,
  8299. so this is best used once at the beginning of your program.
  8300.  
  8301. All of the other mouse routines assume that a mouse is
  8302. available, so you should definitely use MMCheck if you're not
  8303. sure. Otherwise, results will be unusual at best, and the
  8304. computer may even lock up under some DOS versions.
  8305.  
  8306. There is also a function version of this routine, MMCheck2%.
  8307.  
  8308.    MMCheck Buttons%
  8309.  
  8310. -------
  8311. Buttons%   number of mouse buttons (0 if no mouse is installed)
  8312.  
  8313. Name  : MMCheck2%            (Mouse Check and initialize)
  8314. Class : Mouse
  8315. Level : BIOS
  8316.  
  8317. This function does a number of things. Primarily, it is intended
  8318. to let you check to see if a mouse is available. It returns a
  8319. zero if there is no mouse; if there is a mouse, the number of
  8320. mouse buttons is returned. The mouse status is also initialized,
  8321. so this is best used once at the beginning of your program.
  8322.  
  8323. All of the other mouse routines assume that a mouse is
  8324. available, so you should definitely use MMCheck2% if you're not
  8325. sure. Otherwise, results will be unusual at best, and the
  8326. computer may even lock up under some DOS versions.
  8327.  
  8328. There is also a sub version of this routine, MMCheck.
  8329.  
  8330.    Buttons% = MMCheck2%
  8331.  
  8332. -------
  8333. Buttons%   number of mouse buttons (0 if no mouse is installed)
  8334.  
  8335. Name  : MMClick              (Mouse Click)
  8336. Class : Mouse
  8337. Level : BIOS
  8338.  
  8339. The MMClick routine allows you to find out which mouse buttons
  8340. have been pressed since you last checked, and how many times
  8341. they were pressed. Although it will work with any mouse, it is
  8342. designed specifically for a mouse with two buttons (see also
  8343. MMClick3). If you want to find out which buttons are currently
  8344. being pressed, try MMButton instead.
  8345.  
  8346. See also the LClickLoc and RClickLoc routines, which allow you
  8347. to determine what the mouse position was at the last click.
  8348.  
  8349. This routine will not work properly if there is no mouse
  8350. available. Use the MMCheck routine if you are not sure.
  8351.  
  8352.    MMClick LeftB%, RightB%
  8353.  
  8354. -------
  8355. LeftB%     # of times left button was pressed since last check
  8356. RightB%    # of times right button was pressed since last check
  8357.  
  8358. Name  : MMClick3             (Mouse Click for 3-button mouse)
  8359. Class : Mouse
  8360. Level : BIOS
  8361.  
  8362. The MMClick3 routine allows you to find out which mouse buttons
  8363. have been pressed since you last checked, and how many times
  8364. they were pressed. Although it will work with any mouse, it is
  8365. designed specifically for a mouse with three buttons (see also
  8366. MMClick). If you want to find out which buttons are currently
  8367. being pressed, try MMButton3 instead.
  8368.  
  8369. See also the LClickLoc, MClickLoc and RClickLoc routines, which
  8370. allow you to determine what the mouse position was at the last
  8371. click.
  8372.  
  8373. This routine will not work properly if there is no mouse
  8374. available. Use the MMCheck routine if you are not sure.
  8375.  
  8376.    MMClick3 LeftB%, MiddleB%, RightB%
  8377.  
  8378. -------
  8379. LeftB%     # of times left button was pressed since last check
  8380. MiddleB%   # of times middle button was pressed since last look
  8381. RightB%    # of times right button was pressed since last check
  8382.  
  8383. Name  : MMCursorOff          (Mouse Cursor Off)
  8384. Class : Mouse
  8385. Level : BIOS
  8386.  
  8387. This routine makes the mouse cursor invisible. The mouse cursor
  8388. will still function as a location indicator, in the same way
  8389. that the normal cursor still functions when you make it
  8390. invisible.
  8391.  
  8392. Note that the mouse cursor is somewhat bizarre in that an
  8393. "invisibility level" is kept. Every time you use MMCursorOff,
  8394. the invisibility depth is increased; subsequent attempts to make
  8395. the cursor visible will not actually do so until the
  8396. invisibility depth reaches zero. In other words, if you call
  8397. MMCursorOff when the cursor is already invisible, the cursor
  8398. will not reappear until you've told it to reappear as many times
  8399. as you told it to disappear. This is fairly demented, but that's
  8400. the way Microsoft made it.
  8401.  
  8402. This routine will not work properly if no mouse is installed.
  8403. See MMCheck.
  8404.  
  8405.    MMCursorOff
  8406.  
  8407. Name  : MMCursorOn           (Mouse Cursor On)
  8408. Class : Mouse
  8409. Level : BIOS
  8410.  
  8411. This routine makes the mouse cursor visible, or tries to do
  8412. so...
  8413.  
  8414. The mouse cursor is somewhat bizarre in that an "invisibility
  8415. level" is kept. Every time you use MMCursorOff, the invisibility
  8416. depth is increased; subsequent attempts to make the cursor
  8417. visible will not actually do so until the invisibility depth
  8418. reaches zero. In other words, if you call MMCursorOff when the
  8419. cursor is already invisible, the cursor will not reappear until
  8420. you've told it to reappear (with MMCursorOn) as many times as
  8421. you told it to disappear. This is fairly demented, but that's
  8422. the way Microsoft made it.
  8423.  
  8424. Note that there is a flaw in BASIC such that a "mouse dropping"
  8425. may be left on the screen if your program is invoked at the
  8426. bottom of the DOS screen, causing a scroll while the mouse
  8427. cursor is visible. To avoid this, use VIEW PRINT at the
  8428. beginning of your program to remove the default "status line".
  8429. For the standard 80x25 text screen, this would be done like so:
  8430.  
  8431.    VIEW PRINT 1 TO 25
  8432.  
  8433. This routine will not work properly if no mouse is installed.
  8434. See MMCheck or MMCheck2%.
  8435.  
  8436.    MMCursorOn
  8437.  
  8438. Name  : MMGetLoc             (Mouse Get Location)
  8439. Class : Mouse
  8440. Level : BIOS
  8441.  
  8442. This routine allows you to get the current location of the mouse
  8443. cursor. It doesn't matter if the cursor is visible or invisible.
  8444.  
  8445. The mouse cursor location is somewhat perverse in CGA and text
  8446. modes, due to the sloppy design of Microsoft's original mouse
  8447. driver. In text modes and both CGA graphics modes, the cursor is
  8448. returned as if the screen is 640x200. To correct this for SCREEN
  8449. 1, divide the X coordinate by two. To correct this for text
  8450. modes, divide each coordinate by eight.
  8451.  
  8452. This routine will not work properly if there is no mouse
  8453. available. Use the MMCheck routine if you are not sure.
  8454.  
  8455. See also GetMouseLoc, which returns the appropriate coordinates
  8456. for text mode.
  8457.  
  8458.    MMGetLoc X%, Y%
  8459.  
  8460. -------
  8461. X%         X coordinate ("column")
  8462. Y%         Y coordinate ("row")
  8463.  
  8464. Name  : MMSetLoc             (Mouse Set Location)
  8465. Class : Mouse
  8466. Level : BIOS
  8467.  
  8468. This routine allows you to set the current location of the mouse
  8469. cursor. It doesn't matter if the cursor is visible or invisible.
  8470.  
  8471. The mouse cursor location is somewhat perverse in CGA and text
  8472. modes, due to the sloppy design of Microsoft's original mouse
  8473. driver. In text modes and both CGA graphics modes, the cursor is
  8474. returned as if the screen is 640x200. To correct this for SCREEN
  8475. 1, double the X coordinate. To correct this for text modes,
  8476. multiply each coordinate by eight and add four.
  8477.  
  8478. This routine will not work properly if there is no mouse
  8479. available. Use the MMCheck routine if you are not sure.
  8480.  
  8481. See also SetMouseLoc, which does the coordinate conversions for
  8482. you in text mode.
  8483.  
  8484.    MMSetLoc X%, Y%
  8485.  
  8486. X%         X coordinate ("column")
  8487. Y%         Y coordinate ("row")
  8488.  
  8489. Name  : MMSetRange           (Mouse Set Range)
  8490. Class : Mouse
  8491. Level : BIOS
  8492.  
  8493. This routine allows you to set the allowable range of mouse
  8494. cursor locations. The mouse cursor will not be permitted to go
  8495. outside this range. It doesn't matter if the cursor is visible
  8496. or invisible.
  8497.  
  8498. The mouse cursor location is somewhat perverse in CGA and text
  8499. modes, due to the sloppy design of Microsoft's original mouse
  8500. driver. In text modes and both CGA graphics modes, the cursor is
  8501. returned as if the screen is 640x200. To correct this for SCREEN
  8502. 1, double the X coordinate. To correct this for text modes,
  8503. multiply each coordinate by eight and add four.
  8504.  
  8505. This routine will not work properly if there is no mouse
  8506. available. Use the MMCheck routine if you are not sure.
  8507.  
  8508.    MMSetRange X1%, Y1%, X2%, Y2%
  8509.  
  8510. X1%       left   X coordinate (upper left "column")
  8511. Y1%       top    Y coordinate (upper left "row")
  8512. X2%       right  X coordinate (lower right "column")
  8513. Y2%       bottom Y coordinate (lower right "row")
  8514.  
  8515. Name  : Month0               (Month)
  8516. Class : String / Time
  8517. Level : Any
  8518.  
  8519. Given a month number, this routine tells you the name of the
  8520. month.
  8521.  
  8522.    MonthName$ = SPACE$(9)
  8523.    Month0 MonthName$, NameLen%, MonthNr%
  8524.    MonthName$ = LEFT$(MonthName$, NameLen)
  8525.  
  8526. MonthNr%    month number (1-12)
  8527. -------
  8528. MonthName$  name of the month.  Init to at least 9 characters.
  8529. NameLen%    length of the month name
  8530.  
  8531. Name  : MouseBuffer          (Mouse Buffer size)
  8532. Class : Mouse
  8533. Level : BIOS
  8534.  
  8535. This routine is used before MouseSave in order to find out how
  8536. many bytes are needed to save the mouse state.
  8537.  
  8538. This routine will not work properly if there is no mouse
  8539. available. Use the MMCheck routine if you are not sure.
  8540.  
  8541.    MouseBuffer Bytes%
  8542.    St$ = SPACE$(Bytes%)
  8543.    MouseSave St$
  8544.  
  8545. -------
  8546. Bytes%     number of bytes needed to save the state of the mouse
  8547.  
  8548. Name  : MouseCursor          (Mouse Cursor type)
  8549. Class : Mouse
  8550. Level : BIOS
  8551.  
  8552. The MouseCursor routine allows you to select one of a number of
  8553. graphics mouse cursors. The following types are supported:
  8554.  
  8555.     0   hourglass ("please wait" symbol)
  8556.     1   standard arrow pointer
  8557.     2   pointing hand
  8558.     3   crosshair
  8559.     4   target (box-in-a-box pointer)
  8560.     5   grabbing hand
  8561.  
  8562. If you'd like other shapes, please suggest a few! I'll be glad
  8563. to add them.
  8564.  
  8565.    MouseCursor CursorNr%
  8566.  
  8567. CursorNr%    type of mouse graphics cursor to use (see above)
  8568.  
  8569. Name  : MousePen             (Mouse light Pen emulation)
  8570. Class : Mouse
  8571. Level : BIOS
  8572.  
  8573. The mouse can be made to emulate a light pen, allowing you to
  8574. use BASIC's light pen routines to provide a certain minimal
  8575. level of support for both light pens and mice. This emulation is
  8576. on by default, but you can turn it off in case there is an
  8577. actual light pen attached.
  8578.  
  8579. This routine will not work properly if there is no mouse
  8580. available. Use the MMCheck routine if you are not sure.
  8581.  
  8582.    MousePen EmulatePen%
  8583.  
  8584. EmulatePen%   whether mouse should emulate light pen (0 no)
  8585.  
  8586. Name  : MouseRest            (Mouse status Restore)
  8587. Class : Mouse
  8588. Level : BIOS
  8589.  
  8590. This routine is for use in conjunction with MouseSave. It allows
  8591. you to restore the mouse settings to a state that was saved in
  8592. the past.
  8593.  
  8594. This routine will not work properly if there is no mouse
  8595. available. Use the MMCheck routine if you are not sure.
  8596.  
  8597.    MouseRest St$
  8598.  
  8599. St$        mouse state to restore
  8600.  
  8601. Name  : MouseSave            (Mouse status Save)
  8602. Class : Mouse
  8603. Level : BIOS
  8604.  
  8605. This one is handy for use in subprograms or when SHELLing to
  8606. other programs that may use the mouse. It allows you to save the
  8607. current mouse settings as a string. To find out how long the
  8608. string should be, use MouseBuffer.
  8609.  
  8610. This routine will not work properly if there is no mouse
  8611. available. Use the MMCheck routine if you are not sure.
  8612.  
  8613.    MouseBuffer Bytes%
  8614.    St$ = SPACE$(Bytes%)
  8615.    MouseSave St$
  8616.  
  8617. -------
  8618. St$        saved mouse state.  Init as shown above.
  8619.  
  8620. Name  : MPrint               (MS-DOS Print)
  8621. Class : Display
  8622. Level : BIOS
  8623.  
  8624. The MPrint routine displays text using mostly DOS services. This
  8625. allows it to handle ANSI codes if an ANSI driver is installed.
  8626. In addition, the output of MPrint is confined to a region of the
  8627. screen that you may select with MWindow. By default, the region
  8628. is 1,1 to 25,80: a full 80x25 text screen.
  8629.  
  8630. Using MPrint is similar to using PRINT followed by a semicolon.
  8631. It does not automatically move to the next line. To do so, you
  8632. must MPrint a carriage return and linefeed: CHR$(13) + CHR$(10).
  8633.  
  8634. To clear the MWindow region, MPrint a formfeed: CHR$(12).
  8635.  
  8636.    MPrint St$
  8637.  
  8638. St$         string to display
  8639.  
  8640. Name  : MulMatI              (Multiply Matrix by Integer)
  8641. Class : Array management
  8642. Level : Any
  8643.  
  8644. This routine multiplies as many elements of an integer array as
  8645. you like by a given number, starting at a specified place in the
  8646. array. If there was a numeric overflow at any point in the
  8647. operation, an error code will be returned.
  8648.  
  8649.    MulMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  8650.  
  8651. DSeg%      segment of the array element to start at
  8652. DOfs%      offset of the array element to start at
  8653. Elements%  number of array elements to process
  8654. Value%     value to multiply each array element by
  8655. -------
  8656. ErrCode%   error code: 0 if no error
  8657.  
  8658. Name  : MultiAND             (Multiple AND)
  8659. Class : String
  8660. Level : Any
  8661.  
  8662. The MultiAND routine performs an arithmetic "AND" operation on
  8663. each character in a string.
  8664.  
  8665. Among the varied uses for MultiAND is stripping the high bit
  8666. from characters, as you might want to do in telecommunications
  8667. or in converting WordStar files. In that case, you would use a
  8668. BitMask% of 127.
  8669.  
  8670.    MultiAND St$, BitMask%
  8671.  
  8672. St$        string to process
  8673. BitMask%   bit mask (0-255) with which to AND each character
  8674. -------
  8675. St$        processed string
  8676.  
  8677. Name  : MultiOR              (Multiple OR)
  8678. Class : String
  8679. Level : Any
  8680.  
  8681. The MultiOR routine performs an arithmetic "OR" operation on
  8682. each character in a string.
  8683.  
  8684.    MultiOR St$, BitMask%
  8685.  
  8686. St$        string to process
  8687. BitMask%   bit mask (0-255) with which to OR each character
  8688. -------
  8689. St$        processed string
  8690.  
  8691. Name  : MultiXOR             (Multiple XOR)
  8692. Class : String
  8693. Level : Any
  8694.  
  8695. The MultiXOR routine performs an arithmetic "XOR" operation on
  8696. each character in a string.
  8697.  
  8698.    MultiXOR St$, BitMask%
  8699.  
  8700. St$        string to process
  8701. BitMask%   bit mask (0-255) with which to XOR each character
  8702. -------
  8703. St$        processed string
  8704.  
  8705. Name  : MWindow              (MS-DOS Window)
  8706. Class : Display
  8707. Level : Any
  8708.  
  8709. The MWindow routine works in conjunction with MPrint. It defines
  8710. an area of the screen in which text displayed by MPrint must
  8711. stay. The default window is 1,1 to 25,80.
  8712.  
  8713.    MWindow TopRow%, LeftCol%, BottomRow%, RightCol%
  8714.  
  8715. TopRow%     top row
  8716. LeftCol%    left column
  8717. BottomRow%  bottom row
  8718. RightCol%   right column
  8719.  
  8720. Name  : NameCase             (Name Case)
  8721. Class : String
  8722. Level : Any
  8723.  
  8724. This routine provides a specialized uppercase/lowercase
  8725. converter designed especially for names. It converts the first
  8726. letter in each word in a string to uppercase, with the rest of
  8727. the word being converted to lowercase.
  8728.  
  8729. See also NameCase2, the FUNCTION version of this routine.
  8730.  
  8731.    NameCase St$
  8732.  
  8733. St$         string to process
  8734. -------
  8735. St$         processed string
  8736.  
  8737. Name  : NameCase2$           (Name Case)
  8738. Class : String
  8739. Level : Any
  8740.  
  8741. This routine provides a specialized uppercase/lowercase
  8742. converter designed especially for names. It converts the first
  8743. letter in each word in a string to uppercase, with the rest of
  8744. the word being converted to lowercase.
  8745.  
  8746. See also NameCase, the SUB version of this routine.
  8747.  
  8748.    Result$ = NameCase2$(St$)
  8749.  
  8750. St$         string to process
  8751. -------
  8752. Result$     processed string
  8753.  
  8754. Name  : Num2Phone$           (compressed phone# to string)
  8755. Class : Numeric String
  8756. Level : Any
  8757.  
  8758. This function takes a phone number (as encoded by Phone2Num&)
  8759. and converts it to unformatted string form. Depending on the
  8760. original number, the result may be 4, 7, or 10 characters in
  8761. length. An invalid code will result in a null string.
  8762.  
  8763. NOTE that this function will handle current US-style phone
  8764. numbers. It expects the first three digits of a 10-digit phone
  8765. number to represent an area code, where the middle digit of the
  8766. area code is always either zero or one. This convention is
  8767. expected to change as of 1994 or so, whereupon this function
  8768. will no longer be reliable <sigh>.
  8769.  
  8770.    Result$ = Num2Phone$(PhoneNumber&)
  8771.  
  8772. PhoneNumber&    encoded phone number
  8773. -------
  8774. Result$         phone number ("" if invalid number)
  8775.  
  8776. Name  : NumFormat            (Number Format)
  8777. Class : Numeric
  8778. Level : DOS
  8779.  
  8780. This works just like PRINT USING, but returns the results in a
  8781. string rather than sending them to the display or a file.
  8782.  
  8783. Note that an interaction between QuickBASIC, DOS and some
  8784. networks means that this routine will briefly access the default
  8785. drive. Strange but true.
  8786.  
  8787.    NumFormat Format$, Number#, Result$
  8788.  
  8789. Format$     numeric format
  8790. Number#     number to format
  8791. -------
  8792. Result$     formatted number
  8793.  
  8794. Name  : NumProc              (Numeric Processor)
  8795. Class : Equipment
  8796. Level : Any
  8797.  
  8798. NumProc returns the type of numeric coprocessor installed. I
  8799. haven't tried it with a 80486, but I would guess an 80486 always
  8800. appears to have an 80387 (unless it's one of those brain-damaged
  8801. 80486SX chips).
  8802.  
  8803. Results are returned as follows:
  8804.  
  8805.    0    no math chip
  8806.    1    8087
  8807.    2    80287
  8808.    3    80387
  8809.  
  8810. If anyone can tell me how to better handle a 486 here, I'd
  8811. appreciate it.
  8812.  
  8813.    NumProc ProcType%
  8814.  
  8815. -------
  8816. ProcType%    type of numeric coprocessor (see above)
  8817.  
  8818. Name  : NumProc2%            (Numeric Processor)
  8819. Class : Equipment
  8820. Level : Any
  8821.  
  8822. NumProc2% returns the type of numeric coprocessor installed. I
  8823. haven't tried it with a 80486, but I would guess an 80486 always
  8824. appears to have an 80387 (unless it's one of those brain-damaged
  8825. 80486SX chips).
  8826.  
  8827.  
  8828. Results are returned as follows:
  8829.  
  8830.    0    no math chip
  8831.    1    8087
  8832.    2    80287
  8833.    3    80387
  8834.  
  8835. If anyone can tell me how to better handle a 486 here, I'd
  8836. appreciate it.
  8837.  
  8838.    ProcType% = NumProc2%
  8839.  
  8840. -------
  8841. ProcType%    type of numeric coprocessor (see above)
  8842.  
  8843. Name  : ObjScan              (Object file Scan)
  8844. Class : Disk
  8845. Level : DOS
  8846.  
  8847. This routine returns information about a specified .OBJ file. It
  8848. returns the module name, public names, and external names. The
  8849. module name is generally the name of the original file which was
  8850. compiled to produce the .OBJ file. Public names are the names of
  8851. routines (and sometimes variables) that can be accessed by
  8852. outside programs. External names are the names of routines (and
  8853. variables) that the .OBJ file expects to be provided by outside
  8854. programs.
  8855.  
  8856. External names containing "$", starting with "_" or with
  8857. lowercase characters are screened out to avoid returning a huge
  8858. list of BASIC internal routines. For the same reason, routines
  8859. ending with "QQ" will also be screened out, as will
  8860. STRINGADDRESS, STRINGASSIGN, STRINGLENGTH, and STRINGRELEASE.
  8861. Y'know, it would be nice if Microsoft followed some sort of
  8862. standard for its names.
  8863.  
  8864. The public and external names are returned in string arrays.
  8865. ObjScan will fail with an error code if there is insufficient
  8866. space, so be sure to allow plenty of room. If scanning
  8867. subprograms, a DIM to 30 or 40 elements is probably ample. If
  8868. scanning large programs, you may need to increase the dimensions
  8869. substantially.
  8870.  
  8871. The ObjScan routine can be used as the basis for a simple ".OBJ
  8872. info" utility or for more complex applications, such as library
  8873. management.
  8874.  
  8875.    ObjScan ObjFile$, ModName$, Routine$(), External$(), ErrCode%
  8876.  
  8877. ObjFile$      name of .OBJ file
  8878. -------
  8879. ModName$      module name
  8880. Routine$()    public names
  8881. External$()   external names
  8882. ErrCode%      whether there was an error (0 no)
  8883.  
  8884. Name  : Odd%                 (Odd integer?)
  8885. Class : Numeric
  8886. Level : Any
  8887.  
  8888. This function returns whether an integer is odd. If so, it
  8889. returns -1, otherwise 0.
  8890.  
  8891.    Result% = Odd%(Number%)
  8892.  
  8893. Number%    number to test
  8894. -------
  8895. Result%    whether the number is odd
  8896.  
  8897. Name  : OddL%                 (Odd Long integer?)
  8898. Class : Numeric
  8899. Level : Any
  8900.  
  8901. This function returns whether a long integer is odd. If so, it
  8902. returns -1, otherwise 0.
  8903.  
  8904.    Result% = Odd%(Number&)
  8905.  
  8906. Number&    number to test
  8907. -------
  8908. Result%    whether the number is odd
  8909.  
  8910. Name  : OrSt                 (OR String)
  8911. Class : String
  8912. Level : Any
  8913.  
  8914. This routine ORs each byte in one string with the corresponding
  8915. byte in a second string. The strings must be the same length.
  8916.  
  8917.    OrSt St1$, St2$
  8918.  
  8919. St1$      string to OR
  8920. St2$      string to OR with
  8921. -------
  8922. St1$      result
  8923.  
  8924. Name  : ParseFSpec           (Parse File Specification)
  8925. Class : Disk
  8926. Level : Any
  8927.  
  8928. This routine splits a file specification into a drive,
  8929. subdirectory, and filename. You are expected to initialize the
  8930. return strings to reasonable values beforehand (1 for drive, 64
  8931. for subdirectory, 12 for filename). If the filespec may be
  8932. invalid, you may wish to leave additional space to avoid
  8933. potentially disastrous overflows. An alternative would be to use
  8934. ExtendFSpec beforehand to check and complete the file
  8935. specification. This is likely to be a good approach anyway--
  8936. these two routines complement each other nicely.
  8937.  
  8938.    Drive$ = SPACE$(1)
  8939.    Subdir$ = SPACE$(64)
  8940.    File$ = SPACE$(12)
  8941.    ParseFSpec FileSpec$, Drive$, DLen%, Subdir$, SLen%,
  8942.       File$, FLen%
  8943.    Drive$ = LEFT$(Drive$, DLen%)
  8944.    Subdir$ = LEFT$(Subdir$, SLen%)
  8945.    File$ = LEFT$(File$, FLen%)
  8946.  
  8947. FileSpec$   file specification
  8948. -------
  8949. Drive$      drive letter (init to 1+)
  8950. DLen%       length of Drive$
  8951. SubDir$     subdirectory (init to 64+)
  8952. SLen%       length of Subdir$
  8953. File$       file name (init to 12+)
  8954. FLen%       length of File$
  8955.  
  8956. Name  : PatchDone            (Patch Done)
  8957. Class : Disk
  8958. Level : DOS
  8959.  
  8960. This routine closes the file opened by FindPatch. You must use
  8961. PatchDone when you are finished patching the file.
  8962.  
  8963. Routines in this set include FindPatch, SetPatch, and PatchDone.
  8964.  
  8965.    PatchDone
  8966.  
  8967. Name  : PCDat$               (PC Date)
  8968. Class : Equipment
  8969. Level : Clone
  8970.  
  8971. The PCDat$ routine tells you the date of the BIOS ROM chip. This
  8972. date is not always available on some (mostly older) clones, in
  8973. which case "No Date" is returned.
  8974.  
  8975.    ROMDate$ = PCDat$
  8976.  
  8977. -------
  8978. ROMDate$   date of the BIOS ROM (xx/xx/xx).
  8979.  
  8980. Name  : PCDate               (PC Date)
  8981. Class : Equipment
  8982. Level : Clone
  8983.  
  8984. The PCDate routine tells you the date of the BIOS ROM chip. This
  8985. date is not always available on some (mostly older) clones, in
  8986. which case "No Date " is returned. See also PCDat, a function
  8987. version of this routine.
  8988.  
  8989.    ROMDate$ = SPACE$(8)
  8990.    PCDate ROMDate$
  8991.  
  8992. -------
  8993. ROMDate$   date of the BIOS ROM (xx/xx/xx).  Init to 8+ chars.
  8994.  
  8995. Name  : PCType               (PC Type)
  8996. Class : Equipment
  8997. Level : Clone
  8998.  
  8999. This routine returns the machine I.D. code. This code may not be
  9000. one of the listed values for some (mostly older) clones, but the
  9001. following is usually correct:
  9002.  
  9003.    I.D.  ....Machine....
  9004.    255   PC or XT
  9005.    254   XT
  9006.    253   PCjr
  9007.    252   PC AT
  9008.    251   XT
  9009.    250   PS/2 Model 30
  9010.    249   PC Convertible
  9011.    248   PS/2 Model 70 or 80
  9012.    154   Compaq Portable
  9013.     45   Compaq Portable
  9014.  
  9015. Note that, for identification purposes, a PC and XT are
  9016. essentially the same. The XT is simply a PC with an auto-boot
  9017. hard drive. New I.D. numbers come out more or less at random
  9018. from IBM, although they aren't as capricious about it as they
  9019. used to be. It is useful to identify Compaq Portables as
  9020. separate from PCs because those machines had an unusual display,
  9021. which acts like a CGA but has the resolution (in text modes) of
  9022. an MDA. Hence, the cursor size of a Compaq Portable is MDA-sized
  9023. in text mode, but CGA-sized in graphics modes, even though
  9024. ordinary tests will tell your program that a CGA is attached. If
  9025. you intend to alter the cursor size, this is an important
  9026. distinction, since the Compaq Portable was a great success and
  9027. is still in wide use. Current Compaq machines, like most other
  9028. clones, follow the standard IBM I.D. codes.
  9029.  
  9030. See also PCType2, a function version of this routine.
  9031.  
  9032.    PCType MachineID%
  9033.  
  9034. -------
  9035. MachineID%   type of computer
  9036.  
  9037. Name  : PCType2%             (PC Type)
  9038. Class : Equipment
  9039. Level : Clone
  9040.  
  9041. This routine returns the machine I.D. code. This code may not be
  9042. one of the listed values for some (mostly older) clones, but the
  9043. following is usually correct:
  9044.  
  9045.    I.D.  ....Machine....
  9046.    255   PC or XT
  9047.    254   XT
  9048.    253   PCjr
  9049.    252   PC AT
  9050.    251   XT
  9051.    250   PS/2 Model 30
  9052.    249   PC Convertible
  9053.    248   PS/2 Model 70 or 80
  9054.    154   Compaq Portable
  9055.     45   Compaq Portable
  9056.  
  9057. Note that, for identification purposes, a PC and XT are
  9058. essentially the same. The XT is simply a PC with an auto-boot
  9059. hard drive. New I.D. numbers come out more or less at random
  9060. from IBM, although they aren't as capricious about it as they
  9061. used to be. It is useful to identify Compaq Portables as
  9062. separate from PCs because those machines had an unusual display,
  9063. which acts like a CGA but has the resolution (in text modes) of
  9064. an MDA. Hence, the cursor size of a Compaq Portable is MDA-sized
  9065. in text mode, but CGA-sized in graphics modes, even though
  9066. ordinary tests will tell your program that a CGA is attached. If
  9067. you intend to alter the cursor size, this is an important
  9068. distinction, since the Compaq Portable was a great success and
  9069. is still in wide use. Current Compaq machines, like most other
  9070. clones, follow the standard IBM I.D. codes.
  9071.  
  9072.    MachineID% = PCType2%
  9073.  
  9074. -------
  9075. MachineID%   type of computer
  9076.  
  9077. Name  : Phone2Num&           (Phone# to Number)
  9078. Class : Numeric String
  9079. Level : Any
  9080.  
  9081. This function converts a U.S. or Canadian phone number from
  9082. string form to a long integer. It accepts phone numbers of 4, 7,
  9083. 10, or 11 digits. If there are 11 digits, the first digit must
  9084. be a 1. Non-numeric characters are ignored so that formatted
  9085. phone numbers can be used. If the phone number is of the wrong
  9086. length or otherwise does not appear to be valid, -1 is returned;
  9087. otherwise, the result is a long integer which represents the
  9088. phone number in a format that can be decoded by Num2Phone$.
  9089.  
  9090. This function will accept alphabetic phone numbers and convert
  9091. them to their numeric equivalents.
  9092.  
  9093. Since it only takes 4 bytes to store a long integer, as opposed
  9094. to 7 to 10 or more for the usual alphanumeric form, this can be
  9095. considered a compression routine as well as a validation
  9096. routine. At worst, for 4-digit phone numbers, it is exactly as
  9097. efficient as a character representation. For 7 or 10-digit phone
  9098. numbers, it roughly doubles your storage space.
  9099.  
  9100. A few words on how checking is done: obviously, there is no way
  9101. to tell whether a number is in use or is in fact whoever you
  9102. wished to call. However, there are certain regularities to
  9103. numeric phone numbers which can be used to detect blatantly
  9104. false numbers. Alphabetic phone numbers do not include all the
  9105. letters of the alphabet, either. This routine will check for any
  9106. obvious peculiarities and warn you accordingly.
  9107.  
  9108. NOTE that this function will handle current US-style phone
  9109. numbers. It expects the first three digits of a 10-digit phone
  9110. number to represent an area code, where the middle digit of the
  9111. area code is always either zero or one. This convention is
  9112. expected to change as of 1994 or so, whereupon this function
  9113. will no longer be reliable <sigh>.
  9114.  
  9115.    Result& = Phone2Num&(PhoneNumber$)
  9116.  
  9117. PhoneNumber$    phone number (may be formatted)
  9118. -------
  9119. Result&         encoded phone number (-1 if invalid number)
  9120.  
  9121. Name  : PrintBox             (Print a Box)
  9122. Class : Display
  9123. Level : Clone
  9124.  
  9125. This routine displays a box, filled with a character or string
  9126. of your choice. Only text modes are supported.
  9127.  
  9128.    PrintBox St$, TopRow%, LftCol%, BotRow%, RhtCol%, VAttr%, _
  9129.      Page%, Fast%
  9130.  
  9131. St$        string to fill box with (one or more chars)
  9132. TopRow%    top row of box
  9133. LftCol%    left column of box
  9134. BotRow%    bottom row of box
  9135. RhtCol%    right column of box
  9136. VAttr%     color/attribute of box (see CalcAttr)
  9137. Page%      display page (for color adapters)
  9138. Fast%      display speed (-1 fast, 0 slow for old CGAs)
  9139.  
  9140. Name  : PrinterInit          (Printer Initialize)
  9141. Class : Printer
  9142. Level : BIOS
  9143.  
  9144. This routine initializes a printer in the same way as if the
  9145. computer had been rebooted.
  9146.  
  9147. Note that this will not work on serial printers, even if the
  9148. MODE command was used to redirect the port. It works at the BIOS
  9149. level, so it doesn't know about any fooling around DOS does.
  9150.  
  9151.    PrinterInit Port%
  9152.  
  9153. Port%         parallel port number (1-3)
  9154.  
  9155. Name  : PrinterReady%        (Printer Ready)
  9156. Class : Printer
  9157. Level : BIOS
  9158.  
  9159. This function lets you know if a printer is ready. It checks to
  9160. make sure that the specified port exists, then makes sure a
  9161. printer is connected, turned on, and has paper in it.
  9162.  
  9163. Note that this will not work on serial printers, even if the
  9164. MODE command was used to redirect the port. It works at the BIOS
  9165. level, so it doesn't know about any fooling around DOS does.
  9166.  
  9167.    Ready% = PrinterReady%(Port%)
  9168.  
  9169. Port%         parallel port number (1-3)
  9170. -------
  9171. Ready%        whether there's a printer ready at that port
  9172.  
  9173. Name  : PrintFile            (Print File)
  9174. Class : Printer
  9175. Level : DOS
  9176.  
  9177. This routine sends a file to the printer. It does not paginate,
  9178. spool, or anything else fancy. The LPT1 or PRN device is used by
  9179. default, although you can change this using the PrtSwap routine.
  9180.  
  9181. The predefined device handle for stdprn is used, so don't use
  9182. FClose1 to free that handle if you expect to use this routine.
  9183. The results could be nasty.
  9184.  
  9185.    PrintFile FileName$, ErrCode%
  9186.  
  9187. FileName$     name of the file to print
  9188. -------
  9189. ErrCode%      whether there was an error (0 no, else DOS Error)
  9190.  
  9191. Name  : PrintScreen          (Print Screen)
  9192. Class : Display / Printer
  9193. Level : BIOS
  9194.  
  9195. Just like pressing the PrtSc/PrintScrn key on the keyboard, this
  9196. routine sends the contents of the display to the printer. It is
  9197. mostly designed for text modes, but use of the GRAPHICS TSR
  9198. provided with DOS will allow it to print out CGA graphics
  9199. displays as well. For some reason, the GRAPHICS utility does not
  9200. handle Hercules, EGA or VGA displays; however, alternative
  9201. utilities which provide such features may be obtained from your
  9202. local BBS.
  9203.  
  9204.    PrintScreen
  9205.  
  9206. Name  : Processor            (Processor)
  9207. Class : Equipment
  9208. Level : Any
  9209.  
  9210. Processor returns the type of processor (CPU) installed.
  9211.  
  9212. Results are returned as follows:
  9213.  
  9214.    0    NEC V20
  9215.    1    8088 or 8086
  9216.    2    80186
  9217.    3    80286
  9218.    4    80386
  9219.    5    80486
  9220.  
  9221. Note that, for most practical purposes, a NEC V20 works just
  9222. like an 80186.
  9223.  
  9224.    Processor ProcType%
  9225.  
  9226. -------
  9227. ProcType%    type of CPU (see above)
  9228.  
  9229. Name  : Processor2%          (Processor)
  9230. Class : Equipment
  9231. Level : Any
  9232.  
  9233. Processor returns the type of processor (CPU) installed.
  9234.  
  9235. Results are returned as follows:
  9236.  
  9237.    0    NEC V20
  9238.    1    8088 or 8086
  9239.    2    80186
  9240.    3    80286
  9241.    4    80386
  9242.    5    80486
  9243.  
  9244. Note that, for most practical purposes, a NEC V20 works just
  9245. like an 80186.
  9246.  
  9247.    ProcType% = Processor2%
  9248.  
  9249. -------
  9250. ProcType%    type of CPU (see above)
  9251.  
  9252. Name  : PrtSc                (Print Screen key)
  9253. Class : Input / Printer
  9254. Level : BIOS
  9255.  
  9256. This routine allows you to disable the "print screen" key. This
  9257. only affects the keyboard, not the PrintScreen routine in
  9258. PBClone.
  9259.  
  9260. When the print screen key is disabled, you can detect whether it
  9261. was pressed using the GetPrtSc% function. This provides a way of
  9262. using the key for your own purposes.
  9263.  
  9264. If you disable the print screen key, be sure to enable it again
  9265. before your program ends. Otherwise, the print screen key will
  9266. be left in an undefined state, probably causing the computer to
  9267. crash when it is next pressed.
  9268.  
  9269.    PrtSc Enable%
  9270.  
  9271. Enable%   whether print screen key should be enabled (0 if no)
  9272.  
  9273. Name  : PrtSwap              (Printer Swap)
  9274. Class : Printer
  9275. Level : Clone
  9276.  
  9277. It's handy to use LPRINT, but it isn't always practical. LPRINT
  9278. only works on the first printer available (PRN or LPT1). With
  9279. this routine, it doesn't matter. PrtSwap allows you to swap any
  9280. two printer ports.
  9281.  
  9282. Note that it's a good idea to swap the ports back to their
  9283. original locations before exiting your program. You could cause
  9284. major confusion otherwise!
  9285.  
  9286.    PrtSwap Port1%, Port2%
  9287.  
  9288. Port1%    number of the first port (1-3)
  9289. Port2%    number of the second port (1-3)
  9290.  
  9291. Name  : PSortD               (Pointer Sort Double precision)
  9292. Class : Array management
  9293. Level : Any
  9294.  
  9295. This routine sorts the elements in a double precision array...
  9296. well, actually, it doesn't change the position of anything in
  9297. the double precision array. It sorts the array using a set of
  9298. pointers to the array. You can then use the pointers to refer to
  9299. the array or to re-order the array yourself.
  9300.  
  9301. Why bother with pointers? Well, it's a lot faster than sorting
  9302. the numbers directly, since less information has to be swapped.
  9303. It has another major advantage, though-- it allows you to sort
  9304. an array without losing track of how it corresponds to any
  9305. related arrays.
  9306.  
  9307. The array is assumed to start at element 1. You may specify the
  9308. last element in the array, allowing you to sort only part of an
  9309. array if you like.
  9310.  
  9311. The pointer array must be initialized so that each element is
  9312. equal to its index. Either use InitPtr or do:
  9313.    FOR tmp% = 1 TO Elements%
  9314.       Ptr%(tmp%) = tmp%
  9315.    NEXT
  9316.  
  9317. After this routine, you can access the sorted array via the
  9318. pointer array. For instance, to print out a sorted double
  9319. precision array, you'd use:
  9320.    FOR tmp% = 1 TO Elements%
  9321.       PRINT Array#(Ptr%(tmp%))
  9322.    NEXT
  9323.  
  9324. If you would like the results to be last-to-first, rather than
  9325. first-to-last, just call ReverseI to reverse the pointer array
  9326. (after this routine).
  9327.  
  9328.    PSortD Ptr%(), Array#(), Elements%
  9329.  
  9330. Ptr%()      pointers to array to be sorted
  9331. Array#()    array to be sorted
  9332. Elements%   number of elements in array
  9333. -------
  9334. Ptr%()      pointers which allow accessing array in sorted order
  9335.  
  9336. Name  : PSortI               (Pointer Sort Integer)
  9337. Class : Array management
  9338. Level : Any
  9339.  
  9340. This routine sorts the elements in an integer array... well,
  9341. actually, it doesn't change the position of anything in the
  9342. integer array. It sorts the array using a set of pointers to the
  9343. array. You can then use the pointers to refer to the array or to
  9344. re-order the array yourself.
  9345.  
  9346. Why bother with pointers? It has a major advantage-- it allows
  9347. you to sort an array without losing track of how it corresponds
  9348. to any related arrays.
  9349.  
  9350. The array is assumed to start at element 1. You may specify the
  9351. last element in the array, allowing you to sort only part of an
  9352. array if you like.
  9353.  
  9354. The pointer array must be initialized so that each element is
  9355. equal to its index. Either use InitPtr or do:
  9356.    FOR tmp% = 1 TO Elements%
  9357.       Ptr%(tmp%) = tmp%
  9358.    NEXT
  9359.  
  9360. After this routine, you can access the sorted array via the
  9361. pointer array. For instance, to print out a sorted integer
  9362. array, you'd use:
  9363.    FOR tmp% = 1 TO Elements%
  9364.       PRINT Array%(Ptr%(tmp%))
  9365.    NEXT
  9366.  
  9367. If you would like the results to be last-to-first, rather than
  9368. first-to-last, just call ReverseI to reverse the pointer array
  9369. (after this routine).
  9370.  
  9371.    PSortI Ptr%(), Array%(), Elements%
  9372.  
  9373. Ptr%()      pointers to array to be sorted
  9374. Array%()    array to be sorted
  9375. Elements%   number of elements in array
  9376. -------
  9377. Ptr%()      pointers which allow accessing array in sorted order
  9378.  
  9379. Name  : PSortL               (Pointer Sort Long integer)
  9380. Class : Array management
  9381. Level : Any
  9382.  
  9383. This routine sorts the elements in a long integer array... well,
  9384. actually, it doesn't change the position of anything in the long
  9385. integer array. It sorts the array using a set of pointers to the
  9386. array. You can then use the pointers to refer to the array or to
  9387. re-order the array yourself.
  9388.  
  9389. Why bother with pointers? Well, it's a lot faster than sorting
  9390. the numbers directly, since less information has to be swapped.
  9391. It has another major advantage, though-- it allows you to sort
  9392. an array without losing track of how it corresponds to any
  9393. related arrays.
  9394.  
  9395. The array is assumed to start at element 1. You may specify the
  9396. last element in the array, allowing you to sort only part of an
  9397. array if you like.
  9398.  
  9399. The pointer array must be initialized so that each element is
  9400. equal to its index. Either use InitPtr or do:
  9401.    FOR tmp% = 1 TO Elements%
  9402.       Ptr%(tmp%) = tmp%
  9403.    NEXT
  9404.  
  9405. After this routine, you can access the sorted array via the
  9406. pointer array. For instance, to print out a sorted long integer
  9407. array, you'd use:
  9408.    FOR tmp% = 1 TO Elements%
  9409.       PRINT Array&(Ptr%(tmp%))
  9410.    NEXT
  9411.  
  9412. If you would like the results to be last-to-first, rather than
  9413. first-to-last, just call ReverseI to reverse the pointer array
  9414. (after this routine).
  9415.  
  9416.    PSortL Ptr%(), Array&(), Elements%
  9417.  
  9418. Ptr%()      pointers to array to be sorted
  9419. Array&()    array to be sorted
  9420. Elements%   number of elements in array
  9421. -------
  9422. Ptr%()      pointers which allow accessing array in sorted order
  9423.  
  9424. Name  : PSortS               (Pointer Sort Single precision)
  9425. Class : Array management
  9426. Level : Any
  9427.  
  9428. This routine sorts the elements in a single precision array...
  9429. well, actually, it doesn't change the position of anything in
  9430. the single precision array. It sorts the array using a set of
  9431. pointers to the array. You can then use the pointers to refer to
  9432. the array or to re-order the array yourself.
  9433.  
  9434. Why bother with pointers? Well, it's a lot faster than sorting
  9435. the numbers directly, since less information has to be swapped.
  9436. It has another major advantage, though-- it allows you to sort
  9437. an array without losing track of how it corresponds to any
  9438. related arrays.
  9439.  
  9440. The array is assumed to start at element 1. You may specify the
  9441. last element in the array, allowing you to sort only part of an
  9442. array if you like.
  9443.  
  9444. The pointer array must be initialized so that each element is
  9445. equal to its index. Either use InitPtr or do:
  9446.    FOR tmp% = 1 TO Elements%
  9447.       Ptr%(tmp%) = tmp%
  9448.    NEXT
  9449.  
  9450. After this routine, you can access the sorted array via the
  9451. pointer array. For instance, to print out a sorted single
  9452. precision array, you'd use:
  9453.    FOR tmp% = 1 TO Elements%
  9454.       PRINT Array!(Ptr%(tmp%))
  9455.    NEXT
  9456.  
  9457. If you would like the results to be last-to-first, rather than
  9458. first-to-last, just call ReverseI to reverse the pointer array
  9459. (after this routine).
  9460.  
  9461.    PSortS Ptr%(), Array!(), Elements%
  9462.  
  9463. Ptr%()      pointers to array to be sorted
  9464. Array!()    array to be sorted
  9465. Elements%   number of elements in array
  9466. -------
  9467. Ptr%()      pointers which allow accessing array in sorted order
  9468.  
  9469. Name  : PSortSt              (Pointer Sort String)
  9470. Class : Array management
  9471. Level : Any
  9472.  
  9473. This routine sorts the elements in a string array... well,
  9474. actually, it doesn't change the position of anything in the
  9475. string array. It sorts the array using a set of pointers to the
  9476. array. You can then use the pointers to refer to the array or to
  9477. re-order the array yourself.
  9478.  
  9479. Why bother with pointers? Well, it's a lot faster than sorting
  9480. the strings directly, since less information has to be swapped.
  9481. It has another major advantage, though-- it allows you to sort
  9482. an array without losing track of how it corresponds to any
  9483. related arrays. For instance, if you have one array holding
  9484. names and another holding phone numbers, this allows you to sort
  9485. on names without losing track of which phone numbers are which.
  9486.  
  9487. The array is assumed to start at element 1. You may specify the
  9488. last element in the array, allowing you to sort only part of an
  9489. array if you like. You can also specify whether the
  9490. capitalization of letters in a string should matter for sorting
  9491. purposes.
  9492.  
  9493. The pointer array must be initialized so that each element is
  9494. equal to its index. Either use InitPtr or do:
  9495.    FOR tmp% = 1 TO Elements%
  9496.       Ptr%(tmp%) = tmp%
  9497.    NEXT
  9498.  
  9499. After this routine, you can access the sorted array via the
  9500. pointer array. For instance, to print out a sorted string array,
  9501. you'd use:
  9502.    FOR tmp% = 1 TO Elements%
  9503.       PRINT Array$(Ptr%(tmp%))
  9504.    NEXT
  9505.  
  9506. If you would like the results to be last-to-first, rather than
  9507. first-to-last, just call ReverseI to reverse the pointer array
  9508. (after this routine).
  9509.  
  9510.    PSortSt Ptr%(), Array$(), Elements%, CapsCount%
  9511.  
  9512. Ptr%()      pointers to array to be sorted
  9513. Array$()    array to be sorted
  9514. CapsCount%  use 0 if uppercase/lowercase distinctions don't matter
  9515. Elements%   number of elements in array
  9516. -------
  9517. Ptr%()      pointers which allow accessing array in sorted order
  9518.  
  9519. Name  : PutScreen            (Put Screen)
  9520. Class : Display
  9521. Level : Clone
  9522.  
  9523. This routine restores a portion of the display (which was saved
  9524. to an array by DGetScreen or GetScreen) to the screen. Only text
  9525. modes are supported. If your program uses multiple display
  9526. pages, you can put the image onto any of those pages. A special
  9527. "slow" mode is supported for the CGA, to prevent flickering (a
  9528. problem only with some CGAs).
  9529.  
  9530. If you wish to restore the entire screen, you may find ScrRest
  9531. easier (see).
  9532.  
  9533.    PutScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  9534.  
  9535. Array%()   array from which to restore the image
  9536. TRow%      top row of the desired screen area
  9537. LCol%      left column of the desired screen area
  9538. BRow%      bottom row of the desired screen area
  9539. RCol%      right column of the desired screen area
  9540. Page%      page on which to restore the display
  9541. Fast%      whether to use fast mode (0 no)
  9542.  
  9543. Name  : QPrint               (Quick Print)
  9544. Class : Display
  9545. Level : Clone
  9546.  
  9547. This is a replacement for the PRINT statement. It is less
  9548. flexible in that it does not move the cursor or interpret
  9549. control codes, and because it uses the color that is already on
  9550. the screen instead of a specified color value. It also works
  9551. only in text modes.
  9552.  
  9553. In exchange, QPrint gives you much faster display speeds.
  9554.  
  9555. See also XQPrint, which is a bit more flexible (and somewhat
  9556. slower).
  9557.  
  9558. The results of this routine are not redirectable by DOS.
  9559.  
  9560.    QPrint St$, Row%, Column%, Page%, Fast%
  9561.  
  9562. St$        text to display
  9563. Row%       starting row
  9564. Column%    starting column
  9565. Page%      page on which to display
  9566. Fast%      whether to use fast mode (0 no)
  9567.  
  9568. Name  : Rand%                (Random number)
  9569. Class : Numeric
  9570. Level : Clone
  9571.  
  9572. This is a pseudo-random number function. It returns a "random"
  9573. number in a range you specify (e.g., if you pass it 10, it will
  9574. return 0-9). The number is less random than you'd get from the
  9575. BASIC function RND, and you can't set a random number seed a la
  9576. RANDOMIZE. There is one major advantage to Rand%, however: it
  9577. doesn't bring in BASIC's floating point support, which makes it
  9578. much faster than RND and may make your program much smaller.
  9579.  
  9580. See also RndI%, which is based on RND itself.
  9581.  
  9582.    Number% = Rand%(Range%)
  9583.  
  9584. Range%      range of desired pseudo-random number
  9585. -------
  9586. Number%     pseudo-random number from 0 to Range% - 1
  9587.  
  9588. Name  : RandFile$            (Random Filename)
  9589. Class : File
  9590. Level : DOS
  9591.  
  9592. This function returns a pseudo-random filename. The returned
  9593. string is based on the current time, to hundredths of a second,
  9594. and will be a dollar sign followed by up to seven characters and
  9595. digits, terminated by a space. This leaves you room to add your
  9596. own file extension, if you like.
  9597.  
  9598. The anticipated use for this function is creating temporary
  9599. files which will be used for a brief time by your program before
  9600. being deleted. The filename returned will be rather unlikely to
  9601. conflict with any existing files.
  9602.  
  9603.    FileName$ = RandFile$
  9604.  
  9605. -------
  9606. FileName$    pseudo-random filename (e.g., "$P382227.")
  9607.  
  9608. Name  : RClickLoc            (Right Click Location)
  9609. Class : Mouse
  9610. Level : BIOS
  9611.  
  9612. This routine returns the position of the mouse cursor at the
  9613. last click of the right mouse button. It must be used after one
  9614. of the routines which check for mouse clicks, as they maintain
  9615. the click position. These routines include GetKey, GetKey3,
  9616. MMClick, and MMClick3.
  9617.  
  9618. The values returned are in graphics coordinates (virtual
  9619. coordinates for SCREEN 0 through SCREEN 2, due to the nature of
  9620. the mouse driver).
  9621.  
  9622.    RClickLoc X%, Y%
  9623.  
  9624. -------
  9625. X%         horizontal coordinate at last right click
  9626. Y%         vertical coordinate at last right click
  9627.  
  9628. Name  : ReadBitF             (Read Bit Field)
  9629. Class : Numeric
  9630. Level : Any
  9631.  
  9632. This routine allows you to get an element of a virtual array.
  9633. The actual array can be any numeric type, as it is just being
  9634. used as a storage area. The virtual array is composed of numbers
  9635. of a bit length that you specify (1-8). This provides efficient
  9636. storage for numbers which have a limited range.
  9637.  
  9638. See also WriteBitF.
  9639.  
  9640.    ReadBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  9641.  
  9642. DSeg%        segment of actual array
  9643. DOfs%        offset of actual array
  9644. ElementNr&   virtual element number (starts at 0)
  9645. BitLen%      bits per virtual element (1-8)
  9646. -------
  9647. Value%       result (0-255 or less, depending on BitLen%)
  9648.  
  9649. Name  : ReadScreen           (Read Screen into string)
  9650. Class : Display
  9651. Level : Clone
  9652.  
  9653. This routine reads a string off the screen. The screen must be
  9654. in text mode.
  9655.  
  9656. See also GetLine, which reads a row of text from a virtual or
  9657. saved screen.
  9658.  
  9659.    Result$ = SPACE$(10)    ' init to desired length
  9660.    ReadScreen Result$, Row%, Column%, Page%
  9661.  
  9662. Result$      result string: init to desired length first
  9663. Row%         row (1-25, 1-43, etc [depends on screen mode])
  9664. Column%      column (1-40, 1-80, etc [depends on mode])
  9665. Page%        page (0, 0-3, etc [depends on display and mode])
  9666.  
  9667. Name  : Reboot               (Reboot)
  9668. Class : Miscellaneous
  9669. Level : Clone
  9670.  
  9671. This routine restarts the computer, just like typing
  9672. Control-Alt-Del at the keyboard.
  9673.  
  9674.    Reboot
  9675.  
  9676. Name  : Recolor              (Recolor)
  9677. Class : Display
  9678. Level : Clone
  9679.  
  9680. The Recolor routine changes all text in one color to another
  9681. color. It works only in text modes. The colors are specified as
  9682. attributes (see CalcAttr).
  9683.  
  9684.    Recolor OldAttr%, NewAttr%
  9685.  
  9686. OldAttr%   color to be changed
  9687. NewAttr%   color to which to change
  9688.  
  9689. Name  : RecolorArea          (Recolor Area)
  9690. Class : Display
  9691. Level : Clone
  9692.  
  9693. The RecolorArea routine changes a specified area of the screen
  9694. to a specified color. It works only in text modes. The color is
  9695. specified as an attribute (see CalcAttr).
  9696.  
  9697. See also HiLite, which provides an easier way of highlighting
  9698. between two columns on a single row.
  9699.  
  9700.    RecolorArea TRow%, LCol%, BRow%, RCol%, VAttr%, Page%, Fast%
  9701.  
  9702. TRow%       top row of area to recolor
  9703. LCol%       left column of area to recolor
  9704. BRow%       bottom row of area to recolor
  9705. RCol%       right column of area to recolor
  9706. VAttr%      desired color
  9707. Page%       display page (normally zero)
  9708. Fast%       whether to use fast mode (0 no)
  9709.  
  9710. Name  : RedirectIn%          (Redirect Input)
  9711. Class : Miscellaneous
  9712. Level : DOS
  9713.  
  9714. The RedirectIn% function allows you to determine whether input
  9715. has been redirected. This lets you know whether input is coming
  9716. from the keyboard or from a file or device.
  9717.  
  9718. Input that is done by BIOS key routines (e.g., BIOSInkey) is not
  9719. affected by redirection, so if you want to support redirection
  9720. it is best to avoid such routines unless there is something that
  9721. must come from the keyboard.
  9722.  
  9723.    Redir% = RedirectIn%
  9724.  
  9725. -------
  9726. Redir%     whether input has been redirected (0 no)
  9727.  
  9728. Name  : RedirectOut%         (Redirect Output)
  9729. Class : Miscellaneous
  9730. Level : DOS
  9731.  
  9732. The RedirectOut% function allows you to determine whether output
  9733. has been redirected. This lets you know whether output is going
  9734. to the display or to a file or device.
  9735.  
  9736. Output that is done by direct screen writes (e.g., XQPrint) is
  9737. not affected by redirection, so if you want to allow redirection
  9738. it is best to avoid such routines unless there is something that
  9739. must to go to the screen itself.
  9740.  
  9741.    Redir% = RedirectOut%
  9742.  
  9743. -------
  9744. Redir%     whether output has been redirected (0 no)
  9745.  
  9746. Name  : Rename               (Rename file)
  9747. Class : Disk
  9748. Level : DOS
  9749.  
  9750. This routine allows you to rename an ordinary file. See also
  9751. RenSub.
  9752.  
  9753.    Rename CurrentName$, NewName$, ErrCode%
  9754.  
  9755. CurrentName$   current name of the file
  9756. NewName$       desired name of the file
  9757. -------
  9758. ErrCode%       error code: 0 if no error, else DOS Error
  9759.  
  9760. Name  : RenSub               (Rename Subdirectory)
  9761. Class : Disk
  9762. Level : DOS
  9763.  
  9764. This routine provides a service that was inexplicably left out
  9765. of the DOS command shell. It allows you to rename a
  9766. subdirectory.
  9767.  
  9768. Note that renaming a subdirectory is only possible using
  9769. old-style FCB file handling. This means that the subdirectory
  9770. which you specify must be in the current directory (the routine
  9771. doesn't really understand subdirectories per se, but treats them
  9772. like any other file). In this implementation, no drive
  9773. specification is allowed either. Finally, if there is an error,
  9774. the error code may be a simple "255" instead of a useful disk
  9775. error number.
  9776.  
  9777.    RenSub CurrentSub$, NewSub$, ErrCode%
  9778.  
  9779. CurrentSub$   current name of the subdirectory
  9780. NewSub$       desired name of the subdirectory
  9781. -------
  9782. ErrCode%      error code: 0 if no error, else DOS Error
  9783.  
  9784. Name  : Replace              (Replace character)
  9785. Class : String
  9786. Level : Any
  9787.  
  9788. This routine replaces all occurrences of a given character in a
  9789. string with another character.
  9790.  
  9791.    Replace St$, CurCh$, NewCh$
  9792.  
  9793. St$         string to process
  9794. CurCh$      character to be replaced
  9795. NewCh$      character to replace with
  9796. -------
  9797. St$         processed string
  9798.  
  9799. Name  : ReplaceString        (Replace String)
  9800. Class : String
  9801. Level : Any
  9802.  
  9803. This routine replaces all occurrences of a given substring
  9804. within a string with another substring. The substrings may be of
  9805. any length.
  9806.  
  9807. An error code will be returned if the string to search for is
  9808. null.
  9809.  
  9810.    ReplaceString St$, Old$, New$, Found%, ErrCode%
  9811.  
  9812. St$         string to process
  9813. Old$        substring to be replaced
  9814. New$        substring to replace with
  9815. -------
  9816. Found%      whether a replacement was done (0 if no)
  9817. ErrCode%    whether there was an error (0 if no)
  9818.  
  9819. Name  : Retries              (Retries)
  9820. Class : Disk
  9821. Level : DOS 3.1+
  9822.  
  9823. This routine allows you to adjust the handling of file-sharing
  9824. errors. When such an error occurs, DOS normally retries 3 times,
  9825. with a wait of 1 between tries. This allows temporary
  9826. conditions, such as someone else using the file you want to
  9827. access, to clear up. In many cases, though, you may want to
  9828. change this delay. A shorter delay will improve response time,
  9829. allowing your program to handle the error more quickly. A longer
  9830. delay may be more suited for a busy network, allowing the
  9831. request to proceed after a reasonable waiting period.
  9832.  
  9833. The delay period between each retry is unfortunately
  9834. machine-dependent, i.e., you will need larger delays on faster
  9835. machines to achieve the same effect. This can only be considered
  9836. a flaw in DOS.
  9837.  
  9838. Note that shorter waiting periods will improve response time for
  9839. your program, but may adversely affect the network. Normally,
  9840. you should use the longest waiting period with which you feel
  9841. comfortable.
  9842.  
  9843.    Retries Times%, WaitTime%
  9844.  
  9845. Times%     # of times to retry if file-sharing violation occurs
  9846. WaitTime%  amount of time to delay between retries
  9847.  
  9848. Name  : Reverse              (Reverse)
  9849. Class : String
  9850. Level : Any
  9851.  
  9852. This little fellow reverses the order of the characters in a
  9853. string. It is one of the vital components of RInstr, but other
  9854. than that I see no real use for it. On the other hand, George
  9855. Boole thought that Boolean logic was of solely theoretical
  9856. interest, and yet without it there would be no computers. I
  9857. leave it to you to find the earth-shattering possibilities of
  9858. Reverse!
  9859.  
  9860.    Reverse St$
  9861.  
  9862. St$      string to be reversed
  9863. -------
  9864. St$      reversed string
  9865.  
  9866. Name  : ReverseD             (Reverse Double precision array)
  9867. Class : Array management
  9868. Level : Any
  9869.  
  9870. This routine reverses the elements in an array of
  9871. double-precision numbers. This will probably be most useful for
  9872. an array sorted by SortD, in case you want the numbers to go
  9873. from largest to smallest.
  9874.  
  9875. The array is assumed to start at element 1. You may specify the
  9876. last element in the array, allowing you to reverse only part of
  9877. an array if you like.
  9878.  
  9879.    ReverseD Array#(), Elements%
  9880.  
  9881. Array#()    array to be reversed
  9882. Elements%   number of elements in array
  9883. -------
  9884. Array#()    reversed array
  9885.  
  9886. Name  : ReverseI             (Reverse Integer array)
  9887. Class : Array management
  9888. Level : Any
  9889.  
  9890. This routine reverses the elements in an array of integers. This
  9891. will probably be most useful for an array sorted by SortI, or a
  9892. pointer array used in PSortD, PSortI, PSortL, PSortS, or
  9893. PSortSt, in case you want the values to go from largest to
  9894. smallest.
  9895.  
  9896. The array is assumed to start at element 1. You may specify the
  9897. last element in the array, allowing you to reverse only part of
  9898. an array if you like.
  9899.  
  9900.    ReverseI Array%(), Elements%
  9901.  
  9902. Array%()    array to be reversed
  9903. Elements%   number of elements in array
  9904. -------
  9905. Array%()    reversed array
  9906.  
  9907. Name  : ReverseL             (Reverse Long integer array)
  9908. Class : Array management
  9909. Level : Any
  9910.  
  9911. This routine reverses the elements in an array of long integers.
  9912. This will probably be most useful for an array sorted by SortL,
  9913. in case you want the values to go from largest to smallest.
  9914.  
  9915. The array is assumed to start at element 1. You may specify the
  9916. last element in the array, allowing you to reverse only part of
  9917. an array if you like.
  9918.  
  9919.    ReverseL Array&(), Elements%
  9920.  
  9921. Array&()    array to be reversed
  9922. Elements%   number of elements in array
  9923. -------
  9924. Array&()    reversed array
  9925.  
  9926. Name  : ReverseS             (Reverse Single precision array)
  9927. Class : Array management
  9928. Level : Any
  9929.  
  9930. This routine reverses the elements in an array of
  9931. single-precision numbers. This will probably be most useful for
  9932. an array sorted by SortS, in case you want the numbers to go
  9933. from largest to smallest.
  9934.  
  9935. The array is assumed to start at element 1. You may specify the
  9936. last element in the array, allowing you to reverse only part of
  9937. an array if you like.
  9938.  
  9939.    ReverseS Array!(), Elements%
  9940.  
  9941. Array!()    array to be reversed
  9942. Elements%   number of elements in array
  9943. -------
  9944. Array!()    reversed array
  9945.  
  9946. Name  : ReverseSt            (Reverse String array)
  9947. Class : Array management
  9948. Level : Any
  9949.  
  9950. This routine reverses the elements in a string array. This will
  9951. probably be most useful for an array sorted by SortSt, in case
  9952. you want the strings to be in reverse-alphabetical order.
  9953.  
  9954. The array is assumed to start at element 1. You may specify the
  9955. last element in the array, allowing you to reverse only part of
  9956. an array if you like.
  9957.  
  9958.    ReverseSt Array$(), Elements%
  9959.  
  9960. Array$()    array to be reversed
  9961. Elements%   number of elements in array
  9962. -------
  9963. Array$()    reversed array
  9964.  
  9965. Name  : RInstr               (Reverse INSTR)
  9966. Class : String
  9967. Level : Any
  9968.  
  9969. Like INSTR, this routine tells you the position of a substring
  9970. within a string. A "reverse" search is used, however-- whereas
  9971. INSTR tells you the first match, RInstr tells you the last
  9972. match. Similarly, whereas INSTR will tell you that a null search
  9973. string matches the main string at the first position, RInstr
  9974. will match on the last position. Of course, most of the time you
  9975. won't be searching for a null string!
  9976.  
  9977.    RInstr MainSt$, SeekSt$, Posn%
  9978.  
  9979. MainSt$    string to search
  9980. SeekSt$    string for which to search
  9981. -------
  9982. Posn%      position of substring within main string (0 no match)
  9983.  
  9984. Name  : RndI%                (Random Integer)
  9985. Class : Numeric
  9986. Level : Any
  9987.  
  9988. This function provides a shell around the BASIC function, RND.
  9989. It returns a "random" number in a range you specify (e.g., if
  9990. you pass it 10, it will return 0-9).
  9991.  
  9992. See also Rand%, which is entirely independent of RND.
  9993.  
  9994.    Number% = RndI%(Range%)
  9995.  
  9996. Range%      range of desired pseudo-random number
  9997. -------
  9998. Number%     pseudo-random number from 0 to Range% - 1
  9999.  
  10000. Name  : RolSt                (Rotate Left String of bits)
  10001. Class : String
  10002. Level : Any
  10003.  
  10004. This routine rotates the bits in a string left by a desired
  10005. amount. This may be helpful for manupulating strings containing
  10006. bit flags, images, et al.
  10007.  
  10008.    RolSt St$, Count%
  10009.  
  10010. St$       string to rotate left
  10011. Count%    bits by which to rotate
  10012. -------
  10013. St$       rotated string
  10014.  
  10015. Name  : RorSt                (Rotate Right String of bits)
  10016. Class : String
  10017. Level : Any
  10018.  
  10019. This routine rotates the bits in a string right by a desired
  10020. amount. This may be helpful for manupulating strings containing
  10021. bit flags, images, et al.
  10022.  
  10023.    RorSt St$, Count%
  10024.  
  10025. St$       string to rotate right
  10026. Count%    bits by which to rotate
  10027. -------
  10028. St$       rotated string
  10029.  
  10030. Name  : RotateL              (Rotate Left)
  10031. Class : Numeric
  10032. Level : Any
  10033.  
  10034. This routine rotates the bits in an integer left by a desired
  10035. amount.
  10036.  
  10037.    RotateL Value%, Count%
  10038.  
  10039. Value%    number to rotate left
  10040. Count%    bits by which to rotate
  10041. -------
  10042. Value%    rotated number
  10043.  
  10044. Name  : RotateLL             (Rotate Left Long)
  10045. Class : Numeric
  10046. Level : Any
  10047.  
  10048. This routine rotates the bits in a long integer left by a
  10049. desired amount.
  10050.  
  10051.    RotateLL Value&, Count%
  10052.  
  10053. Value&    number to rotate left
  10054. Count%    bits by which to rotate
  10055. -------
  10056. Value&    rotated number
  10057.  
  10058. Name  : RotateR              (Rotate Right)
  10059. Class : Numeric
  10060. Level : Any
  10061.  
  10062. This routine rotates the bits in an integer right by a desired
  10063. amount.
  10064.  
  10065.    RotateR Value%, Count%
  10066.  
  10067. Value%    number to rotate right
  10068. Count%    bits by which to rotate
  10069. -------
  10070. Value%    rotated number
  10071.  
  10072. Name  : RotateRL             (Rotate Right Long)
  10073. Class : Numeric
  10074. Level : Any
  10075.  
  10076. This routine rotates the bits in a long integer right by a
  10077. desired amount.
  10078.  
  10079.    RotateRL Value&, Count%
  10080.  
  10081. Value&    number to rotate right
  10082. Count%    bits by which to rotate
  10083. -------
  10084. Value&    rotated number
  10085.  
  10086. Name  : RRotate              (Right Rotate string)
  10087. Class : String
  10088. Level : Any
  10089.  
  10090. This routine rotates the characters in a string right once. I'll
  10091. admit that I haven't found a use for this myself, but people are
  10092. always coming up with new uses for things... and it complements
  10093. the more useful LRotate routine.
  10094.  
  10095. See also LRotate.
  10096.  
  10097.    RRotate St$
  10098.  
  10099. St$      string to be rotated right once
  10100. -------
  10101. St$      string after being rotated right once
  10102.  
  10103. Name  : RScroll              (Right Scroll)
  10104. Class : Display
  10105. Level : Clone
  10106.  
  10107. This routine scrolls any selected part of the display right. You
  10108. may scroll as many times as you like, or scroll "zero" times to
  10109. totally clear the selected part of the display.
  10110.  
  10111.    RScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  10112.  
  10113. TopRow%      top row of the area to scroll
  10114. LeftCol%     left column of the area to scroll
  10115. BottomRow%   top row of the area to scroll
  10116. RightCol%    left column of the area to scroll
  10117. Times%       number of times (or rows) to scroll
  10118.  
  10119. Name  : SBFreeHandles%       (SoundBlaster Free Handles)
  10120. Class : SoundBlaster
  10121. Level : BIOS
  10122.  
  10123. This function tells you how many SoundBlaster XMS handles are
  10124. available. In order for any such handles to be available, the
  10125. SBSIM driver must have been configured to use XMS (with the
  10126. SBSIM.CFG file-- see your SoundBlaster manual for details), and
  10127. XMS memory must also be available. XMS requires an AT-class
  10128. computer (80286 or better) with extended memory and an XMS
  10129. driver. XMS drivers are included with current versions of
  10130. MS-DOS, Windows, and memory managers such as QEMM and 386Max.
  10131.  
  10132. Routines in this set include:
  10133.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetBuffer,
  10134.    SBGetDrivers, SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile,
  10135.    SBInitSrcXMS, SBIsFree, SBLoadXMS, SBMapMIDI, SBPause,
  10136.    SBPlay, SBResume, SBSetVolume, SBStatus%, SBStop
  10137.  
  10138.    Free% = SBFreeHandles%
  10139.  
  10140. -------
  10141. Free%      number of free SBSIM XMS handles
  10142.  
  10143. Name  : SBFreeXMS            (SoundBlaster Free XMS handle)
  10144. Class : SoundBlaster
  10145. Level : BIOS
  10146.  
  10147. This routine frees an SBSIM XMS handle that you were using. It
  10148. returns the associated XMS memory to the system and releases the
  10149. handle. You should always free a handle when you're done using
  10150. it, as it takes up valuable system resources.
  10151.  
  10152. See PLAYVOC.BAS for an example.
  10153.  
  10154. Routines in this set include:
  10155.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10156.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10157.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10158.    SBSetVolume, SBStatus%, SBStop
  10159.  
  10160.    SBFreeXMS Handle%
  10161.  
  10162. Handle%     SBSIM XMS handle to release
  10163.  
  10164. Name  : SBGetActive          (SoundBlaster Get Active drivers)
  10165. Class : SoundBlaster
  10166. Level : BIOS
  10167.  
  10168. This routine tells you which SoundBlaster drivers are active.
  10169. Active drivers are those involved in playing something, so this
  10170. routine tells you when a sound is finished. You can terminate a
  10171. sound at any point with SBStop.
  10172.  
  10173. Routines in this set include:
  10174.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10175.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10176.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10177.    SBSetVolume, SBStatus%, SBStop
  10178.  
  10179. See PLAYVOC.BAS for an example.
  10180.  
  10181.    SBGetActive FM%, DskVoice%, MemVoice%, Auxiliary%, MIDI%
  10182.  
  10183. -------
  10184. FM%         whether FM driver (.CMF) is active (0 no)
  10185. DskVoice%   whether Disk Voice driver (.VOC) is active (0 no)
  10186. MemVoice%   whether Memory Voice driver (.VOC in XMS) is active
  10187. Auxiliary%  whether Auxiliary driver is active (0 no)
  10188. MIDI%       whether MIDI driver (.MID) is active (0 no)
  10189.  
  10190. Name  : SBGetDrivers         (SoundBlaster Get Drivers)
  10191. Class : SoundBlaster
  10192. Level : BIOS
  10193.  
  10194. This routine tells you which SoundBlaster drivers are installed.
  10195.  
  10196. Routines in this set include:
  10197.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10198.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10199.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10200.    SBSetVolume, SBStatus%, SBStop
  10201.  
  10202.    SBGetDrivers FM%, DskVoice%, MemVoice%, Auxiliary%, MIDI%
  10203.  
  10204. -------
  10205. FM%         whether FM driver (.CMF) is there (0 no)
  10206. DskVoice%   whether Disk Voice driver (.VOC) is there (0 no)
  10207. MemVoice%   whether Memory Voice driver (.VOC in XMS) is there
  10208. Auxiliary%  whether Auxiliary driver is there (0 no)
  10209. MIDI%       whether MIDI driver (.MID) is there (0 no)
  10210.  
  10211. Name  : SBGetVer             (SoundBlaster Get Version)
  10212. Class : SoundBlaster
  10213. Level : BIOS
  10214.  
  10215. This routine returns the version number of the SBSIM driver.
  10216.  
  10217. Routines in this set include:
  10218.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10219.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10220.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10221.    SBSetVolume, SBStatus%, SBStop
  10222.  
  10223.    SBGetVer MajorV%, MinorV%
  10224.  
  10225. -------
  10226. MajorV%     major version number (e.g., 1 for v1.20)
  10227. MinorV%     minor version number (e.g., 20 for v1.20)
  10228.  
  10229. Name  : SBGetVolume          (SoundBlaster Get Volume level)
  10230. Class : SoundBlaster
  10231. Level : BIOS
  10232.  
  10233. This routine allows you to get the volume level for specified
  10234. SBSIM devices. Stereo volume controls are provided for SBPro and
  10235. SB-16 adapters, which support stereo. For older mono
  10236. SoundBlasters, the "left" speaker is the active one.
  10237.  
  10238. You may select from any of the following SBSIM sound sources:
  10239.  
  10240.  Source   Description
  10241.  ------   ------------
  10242.    0      Master
  10243.    1      Voice
  10244.    2      FM
  10245.    3      CD
  10246.    4      Line in
  10247.    5      Microphone
  10248.    6      PC Speaker
  10249.  
  10250. Routines in this set include:
  10251.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10252.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10253.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10254.    SBSetVolume, SBStatus%, SBStop
  10255.  
  10256.    SBGetVolume Source%, LeftVol%, RightVol%
  10257.  
  10258. Source%     sound source
  10259. -------
  10260. LeftVol%    left volume (0-255)
  10261. RightVol%   right volume (0-255)
  10262.  
  10263. Name  : SBInitSrcFile        (SoundBlaster Init Source File)
  10264. Class : SoundBlaster
  10265. Level : BIOS
  10266.  
  10267. This routine prepares the SoundBlaster to play from a file. You
  10268. must specify which SBSIM driver to prepare. The driver may be
  10269. any of the following:
  10270.  
  10271.  Driver   File    Description
  10272.  ------   ----    ------------
  10273.    1      .CMF    FM synthesis
  10274.    2      .VOC    Disk voice
  10275.    5      .MID    MIDI
  10276.  
  10277. Don't forget to include the file extension. Also, be aware that
  10278. this routine doesn't start the sound playing-- that is
  10279. accomplished with SBPlay. See also SBLoadXMS, which allows you
  10280. to initialize from XMS memory instead of from a file.
  10281.  
  10282. See PLAYVOC.BAS for an example.
  10283.  
  10284. Routines in this set include:
  10285.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10286.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10287.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10288.    SBSetVolume, SBStatus%, SBStop
  10289.  
  10290.    SBInitSrcFile DriverNr%, FileName$, ErrCode%
  10291.  
  10292. DriverNr%   SoundBlaster driver to initialize
  10293. FileName$   file to play
  10294. -------
  10295. ErrCode%    error code (0 if initialization succeeded)
  10296.  
  10297. Name  : SBInitSrcXMS         (SoundBlaster Init Source XMS)
  10298. Class : SoundBlaster
  10299. Level : BIOS
  10300.  
  10301. This routine prepares the SoundBlaster to play from XMS. You
  10302. pass it the SBSIM XMS handle which was returned when the sound
  10303. file was loaded into XMS by SBLoadXMS. Note that this routine
  10304. doesn't start the sound playing-- that is accomplished with
  10305. SBPlay.
  10306.  
  10307. When you are done with an XMS handle, remember to free it using
  10308. SBFreeXMS.
  10309.  
  10310. Routines in this set include:
  10311.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10312.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10313.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10314.    SBSetVolume, SBStatus%, SBStop
  10315.  
  10316.    SBInitSrcXMS Handle%, ErrCode%
  10317.  
  10318. Handle%     SBSIM XMS handle of sound to play
  10319. -------
  10320. ErrCode%    error code (0 if initialization succeeded)
  10321.  
  10322. Name  : SBInt%               (SoundBlaster Interrupt)
  10323. Class : SoundBlaster
  10324. Level : BIOS
  10325.  
  10326. This function returns the software interrupt number used by the
  10327. SBSIM driver. Most people won't ever need to know the actual
  10328. number. However, this also works as an installation check, as
  10329. the function returns 0 if SBSIM is not installed.
  10330.  
  10331. Routines in this set include:
  10332.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10333.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10334.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10335.    SBSetVolume, SBStatus%, SBStop
  10336.  
  10337.    IntNr% = SBInt%
  10338.  
  10339. -------
  10340. IntNr%      interrupt number used by SBSIM (0 if no SBSIM)
  10341.  
  10342. Name  : SBIsFree%            (SoundBlaster handle Is Free)
  10343. Class : SoundBlaster
  10344. Level : BIOS
  10345.  
  10346. This function tells you whether a specified SBSIM XMS handle is
  10347. free.
  10348.  
  10349. Routines in this set include:
  10350.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10351.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10352.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10353.    SBSetVolume, SBStatus%, SBStop
  10354.  
  10355.    Free% = SBIsFree%(Handle%)
  10356.  
  10357. Handle%     SBSIM XMS handle to test
  10358. -------
  10359. Free%       whether handle is free (0 no, -1 yes)
  10360.  
  10361. Name  : SBLoadXMS            (SoundBlaster Load XMS)
  10362. Class : SoundBlaster
  10363. Level : BIOS
  10364.  
  10365. This routine is used to load a .VOC file into XMS. If you just
  10366. want to play directly from a file, see SBInitSrcFile instead.
  10367.  
  10368. Unlike SBInitSrcFile, you don't have to specify which SBSIM
  10369. driver to use. SBLoadXMS implicitly uses the Memory Voice
  10370. driver, which handles XMS sound data in .VOC file format.
  10371.  
  10372. You must pass this routine the handle of an SBSIM XMS area.
  10373. Normally, you will want to set the handle to zero, which tells
  10374. the routine to use the first available handle. A non-zero handle
  10375. will be returned for you to use with SBInitSrcXMS.
  10376.  
  10377. Don't forget to include the file extension. Also, be aware that
  10378. this routine doesn't start the sound playing-- that is
  10379. accomplished with SBPlay.
  10380.  
  10381. Routines in this set include:
  10382.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10383.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10384.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10385.    SBSetVolume, SBStatus%, SBStop
  10386.  
  10387.    SBLoadXMS FileName$, Handle%, ErrCode%
  10388.  
  10389. FileName$   file to play
  10390. Handle%     SBSIM XMS handle to use (set to 0; see above)
  10391. -------
  10392. Handle%     active SBSIM XMS handle
  10393. ErrCode%    error code (0 if initialization succeeded)
  10394.  
  10395. Name  : SBMapMIDI            (SoundBlaster Map MIDI)
  10396. Class : SoundBlaster
  10397. Level : BIOS
  10398.  
  10399. This routine sets the MIDI channel mapper. You may choose from
  10400. the following:
  10401.  
  10402.    0   General mapper
  10403.    1   Basic mapper
  10404.    2   Extended mapper
  10405.  
  10406. Routines in this set include:
  10407.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10408.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10409.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10410.    SBSetVolume, SBStatus%, SBStop
  10411.  
  10412.    SBMapMIDI MapNr%
  10413.  
  10414. MapNr%      desired MIDI channel mapping
  10415.  
  10416. Name  : SBPause              (SoundBlaster Pause)
  10417. Class : SoundBlaster
  10418. Level : BIOS
  10419.  
  10420. This routine pauses a playing driver. You may select from any of
  10421. the following SBSIM drivers:
  10422.  
  10423.  Driver   File    Description
  10424.  ------   ----    ------------
  10425.    1      .CMF    FM synthesis
  10426.    2      .VOC    Disk voice
  10427.    3      <XMS>   Memory voice
  10428.    5      .MID    MIDI
  10429.  
  10430. Routines in this set include:
  10431.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10432.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10433.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10434.    SBSetVolume, SBStatus%, SBStop
  10435.  
  10436.    SBPause Driver%
  10437.  
  10438. Driver%     driver to pause
  10439.  
  10440. Name  : SBPlay               (SoundBlaster Play)
  10441. Class : SoundBlaster
  10442. Level : BIOS
  10443.  
  10444. This routine plays a specified driver. The driver must have been
  10445. initialized beforehand by SBInitSrcFile or SBInitSrcXMS. You may
  10446. select from any of the following SBSIM drivers:
  10447.  
  10448.  Driver   File    Description
  10449.  ------   ----    ------------
  10450.    1      .CMF    FM synthesis
  10451.    2      .VOC    Disk voice
  10452.    3      <XMS>   Memory voice
  10453.    5      .MID    MIDI
  10454.  
  10455. Play can be paused with SBPause, resumed with SBResume, and
  10456. stopped with SBStop. You can tell which drivers are currently
  10457. playing with SBGetActive. You can read the status word with
  10458. SBStatus%, though most people won't need it.
  10459.  
  10460. Routines in this set include:
  10461.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10462.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10463.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10464.    SBSetVolume, SBStatus%, SBStop
  10465.  
  10466. See PLAYVOC.BAS for an example.
  10467.  
  10468.    SBPlay Driver%
  10469.  
  10470. Driver%     driver to play
  10471.  
  10472. Name  : SBResume             (SoundBlaster Resume)
  10473. Class : SoundBlaster
  10474. Level : BIOS
  10475.  
  10476. This routine resumes playing a paused driver. You may select
  10477. from any of the following SBSIM drivers:
  10478.  
  10479.  Driver   File    Description
  10480.  ------   ----    ------------
  10481.    1      .CMF    FM synthesis
  10482.    2      .VOC    Disk voice
  10483.    3      <XMS>   Memory voice
  10484.    5      .MID    MIDI
  10485.  
  10486. Routines in this set include:
  10487.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10488.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10489.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10490.    SBSetVolume, SBStatus%, SBStop
  10491.  
  10492.    SBResume Driver%
  10493.  
  10494. Driver%     driver to resume
  10495.  
  10496. Name  : SBSetVolume          (SoundBlaster Set Volume level)
  10497. Class : SoundBlaster
  10498. Level : BIOS
  10499.  
  10500. This routine allows you to set the volume level for specified
  10501. SBSIM devices. Stereo volume controls are provided for SBPro and
  10502. SB-16 adapters, which support stereo. For older mono
  10503. SoundBlasters, the "left" speaker is the active one.
  10504.  
  10505. You may select from any of the following SBSIM sound sources:
  10506.  
  10507.  Source   Description
  10508.  ------   ------------
  10509.    0      Master
  10510.    1      Voice
  10511.    2      FM
  10512.    3      CD
  10513.    4      Line in
  10514.    5      Microphone
  10515.    6      PC Speaker
  10516.  
  10517. Routines in this set include:
  10518.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10519.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10520.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10521.    SBSetVolume, SBStatus%, SBStop
  10522.  
  10523.    SBSetVolume Source%, LeftVol%, RightVol%
  10524.  
  10525. Source%     sound source
  10526. LeftVol%    left volume (0-255)
  10527. RightVol%   right volume (0-255)
  10528.  
  10529. Name  : SBStatus%            (SoundBlaster Status)
  10530. Class : SoundBlaster
  10531. Level : BIOS
  10532.  
  10533. This function returns the status word for a specified SBSIM
  10534. driver. The status generally seems to be -1 while a driver is
  10535. playing something and 0 when it isn't, but different status
  10536. values can be encoded into sound files. This is typically used
  10537. to synchronize video with the sound.
  10538.  
  10539. If you just want to know whether or not a specific driver is
  10540. busy, use SBGetActive instead.
  10541.  
  10542. You may select from any of the following SBSIM drivers:
  10543.  
  10544.  Driver   File    Description
  10545.  ------   ----    ------------
  10546.    1      .CMF    FM synthesis
  10547.    2      .VOC    Disk voice
  10548.    3      <XMS>   Memory voice
  10549.    5      .MID    MIDI
  10550.  
  10551. Routines in this set include:
  10552.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10553.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10554.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10555.    SBSetVolume, SBStatus%, SBStop
  10556.  
  10557.    Status% = SBStatus%(Driver%)
  10558.  
  10559. Driver%     driver to check
  10560.  
  10561. Name  : SBStop               (SoundBlaster Stop)
  10562. Class : SoundBlaster
  10563. Level : BIOS
  10564.  
  10565. This routine stops playing a paused driver. You may select from
  10566. any of the following SBSIM drivers:
  10567.  
  10568.  Driver   File    Description
  10569.  ------   ----    ------------
  10570.    1      .CMF    FM synthesis
  10571.    2      .VOC    Disk voice
  10572.    3      <XMS>   Memory voice
  10573.    5      .MID    MIDI
  10574.  
  10575. Routines in this set include:
  10576.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10577.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10578.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10579.    SBSetVolume, SBStatus%, SBStop
  10580.  
  10581. See PLAYVOC.BAS for an example.
  10582.  
  10583.    SBStop Driver%
  10584.  
  10585. Driver%     driver to stop
  10586.  
  10587. Name  : ScanKey              (Scan Keyboard)
  10588. Class : Input
  10589. Level : BIOS
  10590.  
  10591. This one's like INKEY$, but a little bit more subtle. It will
  10592. tell you if there's a key waiting (and if so, what key it is)
  10593. without actually getting the key. The key will remain available
  10594. for later retrieval.
  10595.  
  10596. Among the more common uses for this routine is to handle keys
  10597. like Control-S (pause the display) and Control-C (abort). You
  10598. can see if these keys have been pressed without disturbing
  10599. anything else the user might have typed. DOS uses exactly this
  10600. technique for handling these keys. Since BASIC doesn't go
  10601. through DOS I/O, though, the only way for you to support such
  10602. nice features is to write them into your program with ScanKey.
  10603.  
  10604.    ScanKey CharCode%, CharType%
  10605.  
  10606. -------
  10607. CharType%   key type: 0 none, 1 normal, 2 extended (scan code)
  10608. CharCode%   key ASCII or scan code
  10609.  
  10610. Name  : Scroll               (Scroll)
  10611. Class : Display
  10612. Level : BIOS
  10613.  
  10614. This routine scrolls any selected part of the display up. You
  10615. may scroll as many times as you like, or scroll "zero" times to
  10616. totally clear the selected part of the display.
  10617.  
  10618. Note that BIOS-level scrolling can cause the screen to flicker
  10619. on some CGAs due to a combination of unfortunate design factors.
  10620.  
  10621.    Scroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  10622.  
  10623. TopRow      top row of the area to scroll
  10624. LeftCol%    left column of the area to scroll
  10625. BottomRow   top row of the area to scroll
  10626. RightCol%   left column of the area to scroll
  10627. Times%      number of times (or rows) to scroll
  10628.  
  10629. Name  : ScrRest              (Screen Restore)
  10630. Class : Display
  10631. Level : Clone
  10632.  
  10633. The ScrRest routine restores a display that was saved using
  10634. ScrSave or a similar routine. It only works in text modes, and
  10635. expects an 80x25 screen. See PutScreen or DPutScreen if you need
  10636. to work with other screen sizes.
  10637.  
  10638.    ScrRest Array%(), Page%, Fast%
  10639.  
  10640. Array%()   array holding the display information
  10641. Page%      page on which to restore the display
  10642. Fast%      whether to use fast mode (0 no)
  10643.  
  10644. Name  : ScrSave              (Screen Save)
  10645. Class : Display
  10646. Level : Clone
  10647.  
  10648. The ScrSave routine saves the display to an integer array. Only
  10649. text modes are supported. For an 80x25 display, the array must
  10650. hold 4,000 bytes, so you would use DIM Array%(1 TO 2000).
  10651.  
  10652. ScrSave expects an 80x25 screen. Use GetScreen or DGetScreen if
  10653. you need to work with other screen sizes.
  10654.  
  10655.    ScrSave Array%(), Page%, Fast%
  10656.  
  10657. Page%      display page to get
  10658. Fast%      whether to use fast mode (0 no)
  10659. -------
  10660. Array%()   saved display information
  10661.  
  10662. Name  : SCrunch              (Screen Crunch)
  10663. Class : Display
  10664. Level : Any
  10665.  
  10666. This routine is designed to be used in conjunction with ScrSave
  10667. and the other routines which store an entire 80x25 text screen
  10668. in an array. It performs a "screen crunch", compressing the
  10669. original data into a new array. The average result is about 8x
  10670. smaller than the original screen, resulting in a vast savings in
  10671. memory (4,000 bytes vs 500 or so). The compression algorithm is
  10672. very fast and will not take any noticeable amount of time for
  10673. most purposes.
  10674.  
  10675. Besides saving main memory, this is great for storing screens as
  10676. disk files! The compression will not only make the file(s)
  10677. smaller, but will make disk access faster since there is less
  10678. information to transfer.
  10679.  
  10680. If you need to deal with text screen images of other than 80x25
  10681. in size, try the SCrunchSS routine instead.
  10682.  
  10683.    SCrunch DSeg%, DOfs%, CSeg%, COfs%, Bytes%
  10684.  
  10685. DSeg%     segment of the original screen image
  10686. DOfs%     offset of the original screen image
  10687. CSeg%     segment of array in which to store compressed image
  10688. COfs%     offset of array in which to store compressed image
  10689. -------
  10690. Bytes%    number of bytes in the compressed image
  10691.  
  10692. Name  : SCrunchSS            (Screen Crunch, Sized Screen)
  10693. Class : Display
  10694. Level : Any
  10695.  
  10696. This routine is designed to be used in conjunction with ScrSave
  10697. and the other routines which store a text screen in an array. It
  10698. performs a "screen crunch", compressing the original data into a
  10699. new array. The average result is about 8x smaller than the
  10700. original screen, resulting in a vast savings in memory. The
  10701. compression algorithm is very fast and will not take any
  10702. noticeable amount of time for most purposes.
  10703.  
  10704. Besides saving main memory, this is great for storing screens as
  10705. disk files! The compression will not only make the file(s)
  10706. smaller, but will make disk access faster since there is less
  10707. information to transfer.
  10708.  
  10709. If you only work with 80x25 text screen images, you may find it
  10710. more convenient to use the SCrunch routine instead.
  10711.  
  10712.    SCrunchSS DSeg%, DOfs%, Rows%, Cols%, CSeg%, COfs%, Bytes%
  10713.  
  10714. DSeg%     segment of the original screen image
  10715. DOfs%     offset of the original screen image
  10716. Rows%     rows in original screen image
  10717. Cols%     columns in original screen image
  10718. CSeg%     segment of array in which to store compressed image
  10719. COfs%     offset of array in which to store compressed image
  10720. -------
  10721. Bytes%    number of bytes in the compressed image
  10722.  
  10723. Name  : SDFlush              (SmartDrive Flush)
  10724. Class : Disk
  10725. Level : BIOS
  10726.  
  10727. This routine flushes SmartDrive disk caches, forcing it to write
  10728. any data in memory to the appropriate disk(s).
  10729.  
  10730. This routine requires SmartDrive 4.0 or later.
  10731.  
  10732. Routines in this set include:
  10733.    SDFlush, SDRCached%, SDReset, SDStats, SDVersion, SDWCached%
  10734.  
  10735.    SDFlush
  10736.  
  10737. Name  : SDVersion           (SmartDrive Version)
  10738. Class : Disk Equipment
  10739. Level : BIOS
  10740.  
  10741. This routine returns the SmartDrive version. It is known to work
  10742. with SmartDrive 4.0 and later. It should work with 3.x versions,
  10743. but I haven't been able to test it-- if you are using a version
  10744. of SmartDrive before 4.0, please let me know which version and
  10745. what results you get.
  10746.  
  10747. The other PBClone routines which access SmartDrive require
  10748. SmartDrive 4.0 or later to function. This is due to a radical
  10749. alteration of the SmartDrive interface as of v4.0, making it
  10750. incompatible with earlier versions-- more Microsoft craziness.
  10751.  
  10752. Routines in this set include:
  10753.    SDFlush, SDRCached%, SDReset, SDStats, SDVersion, SDWCached%
  10754.  
  10755.    SDVersion MajorV%, MinorV%
  10756.  
  10757. -------
  10758. MajorV%    major part of version number (e.g., 4 in v4.10)
  10759. MinorV%    minor part of version number (e.g., 10 in v4.10)
  10760.  
  10761. Name  : SDRCached%           (SmartDrive Read Cached)
  10762. Class : Disk
  10763. Level : BIOS
  10764.  
  10765. This function tells you whether a specified drive is being
  10766. read-cached by SmartDrive.
  10767.  
  10768. Note that, in the case of a doubled drive (DoubleSpace, Stacker,
  10769. etc), the virtual drive letter is not the one cached-- for
  10770. instance, my physical hard drive is mapped to H: by DoubleSpace,
  10771. leaving C: as a virtual drive. The virtual drive is not cached
  10772. as such, but the physical drive is-- for example, on my system,
  10773. C: is not cached, but H: is. So, be careful about what
  10774. conclusions you draw about the setup based on this routine. It
  10775. is useful for information and for helping safeguard against
  10776. problems if your program must run without cacheing, but it isn't
  10777. a panacea.
  10778.  
  10779. This routine requires SmartDrive 4.0 or later.
  10780.  
  10781. Routines in this set include:
  10782.    SDFlush, SDRCached%, SDReset, SDStats, SDVersion, SDWCached%
  10783.  
  10784.    Cached% = SDRCached% (Drive$)
  10785.  
  10786. Drive$     drive letter to examine ("" for default drive)
  10787. -------
  10788. Cached%    whether drive is read cached (0 no, -1 yes)
  10789.  
  10790. Name  : SDReset              (SmartDrive Reset)
  10791. Class : Disk
  10792. Level : BIOS
  10793.  
  10794. This routine resets SmartDrive disk caches, clearing them and
  10795. starting caching from a blank slate.
  10796.  
  10797. This routine requires SmartDrive 4.0 or later.
  10798.  
  10799. Routines in this set include:
  10800.    SDFlush, SDRCached%, SDReset, SDStats, SDVersion, SDWCached%
  10801.  
  10802.    SDReset
  10803.  
  10804. Name  : SDStats              (SmartDrive Statistics)
  10805. Class : Disk
  10806. Level : BIOS
  10807.  
  10808. This routine returns the hit/miss statistics for SmartDrive
  10809. cacheing. Hits are the number of times a disk request is
  10810. satisfied by the cache. Misses are the number of times a disk
  10811. request must be read from the disk itself.
  10812.  
  10813. This routine requires SmartDrive 4.0 or later.
  10814.  
  10815. Routines in this set include:
  10816.    SDFlush, SDRCached%, SDReset, SDStats, SDVersion, SDWCached%
  10817.  
  10818.    SDStats Hits&, Misses&
  10819.  
  10820. -------
  10821. Hits&      number of cache hits
  10822. Misses&    number of cache misses
  10823.  
  10824. Name  : SDWCached%           (SmartDrive Write Cached)
  10825. Class : Disk
  10826. Level : BIOS
  10827.  
  10828. This function tells you whether a specified drive is being
  10829. write-cached by SmartDrive.
  10830.  
  10831. Note that, in the case of a doubled drive (DoubleSpace, Stacker,
  10832. etc), the virtual drive letter is not the one cached-- for
  10833. instance, my physical hard drive is mapped to H: by DoubleSpace,
  10834. leaving C: as a virtual drive. The virtual drive is not cached
  10835. as such, but the physical drive is-- for example, on my system,
  10836. C: is not cached, but H: is. So, be careful about what
  10837. conclusions you draw about the setup based on this routine. It
  10838. is useful for information and for helping safeguard against
  10839. problems if your program must run without cacheing, but it isn't
  10840. a panacea.
  10841.  
  10842. This routine requires SmartDrive 4.0 or later.
  10843.  
  10844. Routines in this set include:
  10845.    SDFlush, SDRCached%, SDReset, SDStats, SDVersion, SDWCached%
  10846.  
  10847.    Cached% = SDWCached% (Drive$)
  10848.  
  10849. Drive$     drive letter to examine ("" for default drive)
  10850. -------
  10851. Cached%    whether drive is write cached (0 no, -1 yes)
  10852.  
  10853. Name  : Sec2Time$            (Seconds to Time)
  10854. Class : Time
  10855. Level : Any
  10856.  
  10857. This routine converts the number of seconds past midnight into a
  10858. time string.
  10859.  
  10860.    TimeSt$ = Sec2Time$(Seconds&)
  10861.  
  10862. Seconds&   number of seconds past midnight
  10863. -------
  10864. TimeSt$    time string (TIME$ format)
  10865.  
  10866. Name  : SetBit               (Set Bit)
  10867. Class : Numeric
  10868. Level : Any
  10869.  
  10870. This routine sets a single bit "on" in an integer. Bits are
  10871. numbered 0-15, with 0 being the least significant bit.
  10872.  
  10873.    SetBit Number%, BitNr%
  10874.  
  10875. Number%    number for which to set bit
  10876. BitNr%     bit number (0-15) to set
  10877. -------
  10878. Number%    number with the specified bit set
  10879.  
  10880. Name  : SetCGAColor          (Set CGA Color)
  10881. Class : Display
  10882. Level : Clone
  10883.  
  10884. This routine allows you to set certain aspects of CGA colors
  10885. which aren't available otherwise. It is very CGA-specific,
  10886. however, and may not work on EGA or VGA systems.
  10887.  
  10888. The color specified has different meanings in different CGA
  10889. modes. In the SCREEN 1 graphics mode, it changes the background
  10890. and border color. In SCREEN 2, however, it allows you to change
  10891. the foreground color. While you are still stuck with a single
  10892. foreground color, you can choose what that color will be.
  10893.  
  10894.    SetCGAColor Colour%
  10895.  
  10896. Colour%    color to set (see above)
  10897.  
  10898. Name  : SetComm              (Set Comm port)
  10899. Class : Serial
  10900. Level : DOS
  10901.  
  10902. Although QuickBASIC has a fair range of communications support,
  10903. it doesn't do the capabilities of the PC full justice. It's also
  10904. impossible to change the serial parameters "on the fly" without
  10905. risking disconnection, if BASIC alone is used. SetComm gets
  10906. around those limitations. It should be used -after- the
  10907. appropriate comm port is OPENed by BASIC.
  10908.  
  10909. Note that the true upper limits of the comm speed are determined
  10910. by your program and by the hardware being used. Some PC/XTs may
  10911. have trouble with 9,600 bps, for instance. The ability to set
  10912. the serial port to a high speed doesn't guarantee that the
  10913. hardware can handle it!
  10914.  
  10915.    SetComm CommPort%, Bps%, Parity%, WordLength%, StopBits%
  10916.  
  10917. CommPort%    serial port (1-4, though BASIC only uses 1-2)
  10918. Bps%         bits per second ("baud rate"):
  10919.                 0 for   300       5 for   9,600
  10920.                 1 for   600       6 for  19,200
  10921.                 2 for 1,200       7 for  38,400
  10922.                 3 for 2,400       8 for  57,600
  10923.                 4 for 4,800       9 for 115,200
  10924. Parity%      parity:
  10925.                 0  none
  10926.                 1  odd            3  mark  (always on)
  10927.                 2  even           4  space (always off)
  10928. WordLength%  word length (5-8)
  10929. StopBits%    stop bits (1-2; if WordLength=5, "2" means 1 1/2)
  10930.  
  10931. Name  : SetCommAddr          (Set Comm Address)
  10932. Class : Serial
  10933. Level : Clone
  10934.  
  10935. This routine allows you to set the base port address of a serial
  10936. port.
  10937.  
  10938. One use for SetCommAddr is to give QuickBASIC access to the comm
  10939. port on those unusual machines which have a COM2 but no COM1.
  10940. Use GetCommAddr to get the address of COM2, set the COM1 address
  10941. accordingly, and tell QuickBASIC to use COM1.
  10942.  
  10943. BASIC will normally handle COM1 and COM2, but not COM3 or COM4.
  10944. Although there is no way to use more two ports at once, you can
  10945. fool BASIC into using COM3 by swapping it with COM1, or COM4 by
  10946. swapping it with COM2.
  10947.  
  10948. Don't forget to set the ports back to their original values
  10949. before your program ends!
  10950.  
  10951.    SetCommAddr PortNr%, PortAddr%
  10952.  
  10953. PortNr%     COM port number (1-4)
  10954. PortAddr%   port address
  10955.  
  10956. Name  : SetDateAT            (Set Date of AT clock)
  10957. Class : Time
  10958. Level : BIOS (AT)
  10959.  
  10960. This routine sets the date of the hardware real-time clock in
  10961. AT-class computers. Depending on the DOS version, this date may
  10962. be partially or completely independent of the date kept by DOS
  10963. in software. DOS always reads the date from the hardware clock
  10964. when it starts up. However, use of the DATE command in DOS (and
  10965. the DATE$ function in QuickBASIC) may relate only to the
  10966. software copy of the date, which is not always guaranteed to be
  10967. the same as the date in the hardware clock due to certain
  10968. discrepancies in DOS.
  10969.  
  10970. You may express the year as either a two-digit or four-digit
  10971. number.
  10972.  
  10973. The ProBas and PBClone versions of this routine do not work the
  10974. same way in regards to the year. ProBas assumed that any
  10975. two-digit year was in the 1900s. In contrast, PBClone assumes
  10976. that years 80-99 should be converted to 1980-1999 and that 0-79
  10977. should be converted to 2000-2079. I consider the PBClone method
  10978. more appropriate, with the turn of the century moving closer.
  10979. The date format used does not allow dates before 1980 anyway, so
  10980. nothing is being lost by this change.
  10981.  
  10982.    SetDateAT MonthNr%, DayNr%, YearNr%
  10983.  
  10984. MonthNr%    month number (1-12)
  10985. DayNr%      day (1-31)
  10986. YearNr%     year (1980-2079; see above for two-digit years)
  10987.  
  10988. Name  : SetDrv               (Set default Drive)
  10989. Class : Disk
  10990. Level : DOS
  10991.  
  10992. This routine sets the default disk drive.
  10993.  
  10994. If the specified drive does not exist, the current default drive
  10995. will remain the default.
  10996.  
  10997.    SetDrv Drive$
  10998.  
  10999. Drive$    drive letter
  11000.  
  11001. Name  : SetError             (Set Error code)
  11002. Class : Miscellaneous
  11003. Level : DOS
  11004.  
  11005. The SetError routine allows you to set the "error level" to be
  11006. returned by DOS when your program ends. This is particularly
  11007. handy for returning information to batch files.
  11008.  
  11009. Note that SetError is best used just before your program ENDs,
  11010. to avoid complications.
  11011.  
  11012.    SetError ErrorLevel%
  11013.  
  11014. ErrorLevel%   exit code to be returned by your program
  11015.  
  11016. Name  : SetFAttr             (Set File Attribute)
  11017. Class : Disk
  11018. Level : DOS
  11019.  
  11020. This routine allows you to set the attribute of a file or
  11021. subdirectory. Any combination of the following may be set:
  11022.  
  11023.    Normal          0      (nothing special)
  11024.    Read Only       1      file can be read, but not written to
  11025.    Hidden          2      file will be "invisible"
  11026.    System          4      (for special DOS files-- leave alone)
  11027.    Archive        32      (used by some backup utils- leave be)
  11028.  
  11029. To set more than one attribute, just add the numbers for the
  11030. desired attributes together. The attributes marked "leave alone"
  11031. shouldn't be used casually, but if you're sure you know what
  11032. you're doing...
  11033.  
  11034.    SetFAttr FileName$, FAttr%
  11035.  
  11036. FileName$   name of the file (or subdirectory) to manipulate
  11037. FAttr%      attribute(s) to set
  11038.  
  11039. Name  : SetFTD               (Set File Time and Date)
  11040. Class : Disk
  11041. Level : DOS
  11042.  
  11043. This routine lets you set the time and date of a specified file.
  11044. You may give the year either as two digits or four digits.
  11045.  
  11046. The ProBas and PBClone versions of this routine do not work the
  11047. same way in regards to the year. ProBas assumed that any
  11048. two-digit year was in the 1900s. In contrast, PBClone assumes
  11049. that years 80-99 should be converted to 1980-1999 and that 0-79
  11050. should be converted to 2000-2079. I consider the PBClone method
  11051. more appropriate, with the turn of the century moving closer.
  11052. The DOS date format does not allow dates before 1980 anyway, so
  11053. nothing is being lost by this change.
  11054.  
  11055. Note that the Second% value, if odd, will be rounded down to an
  11056. even number. This is due to the way DOS compresses the time
  11057. format, rather than any limitation in this routine.
  11058.  
  11059.    SetFTD File$, MonthNr%, DayNr%, YearNr%, HourNr%, _
  11060.      MinuteNr%, SecondNr%
  11061.  
  11062. File$        name of file for which to set the time and date
  11063. MonthNr%     month number (1-12)
  11064. DayNr%       day (1-31)
  11065. YearNr%      year (1980-2079; see above for two-digit years)
  11066. HourNr%      hour (0-23)
  11067. MinuteNr%    minute (0-59)
  11068. SecondNr%    second (0-59; if odd, rounded down to even number)
  11069. -------
  11070. MonthNr%     -1 if there was an error, else unchanged
  11071.  
  11072. Name  : SetKbd               (Set Keyboard toggles)
  11073. Class : Input
  11074. Level : Clone
  11075.  
  11076. The SetKbd routine allows you to set the state of any of the
  11077. four keyboard toggles: Insert, Caps lock, Num lock, and Scroll
  11078. Lock. You can give your input routines a professional touch by
  11079. setting this toggles instead of making the user remember to do
  11080. so.
  11081.  
  11082. It's considered proper to restore the original keyboard toggles
  11083. before your program exits, unless of course the purpose of the
  11084. program is to leave the toggles in a particular state! The
  11085. GetKbd routine can be used in conjunction with SetKbd to do
  11086. this.
  11087.  
  11088.    SetKbd Insert%, Caps%, Num%, Scrl%
  11089.  
  11090. Insert%    whether to turn on "insert" mode (0 if no)
  11091. Caps%      whether to turn on "caps lock" (0 if no)
  11092. Num%       whether to put the keypad into numeric mode (0 no)
  11093. Scrl%      whether to turn on "scroll lock" (0 if no)
  11094.  
  11095. Name  : SetLabel             (Set disk volume Label)
  11096. Class : Disk
  11097. Level : DOS
  11098.  
  11099. This routine creates, renames or deletes a disk volume label.
  11100.  
  11101. Note that a disk volume label is essentially a file name without
  11102. an extension. It can contain any character that can normally be
  11103. in a file name, plus spaces and periods.
  11104.  
  11105.    SetLabel Drive$, Label$, ErrCode%
  11106.  
  11107. Drive$     drive to set label on (use "" for current drive)
  11108. Label$     label to install (use "" to delete current label)
  11109. -------
  11110. ErrCode%   whether there was an error (0 no)
  11111.  
  11112. Name  : SetLogiDrive         (Set Logical Drive)
  11113. Class : Disk
  11114. Level : DOS 3.2+
  11115.  
  11116. This routine is useful for systems which only have a single
  11117. floppy drive. In such cases, DOS connects both drive letters A:
  11118. and B: to the same drive. However, only one drive letter is
  11119. active, and when you try to access the "other" drive, DOS
  11120. displays the message:
  11121.  
  11122.   "Insert diskette for drive x: and press any key when ready."
  11123.  
  11124. By setting the active drive yourself, you can bypass this
  11125. message, and your program will look much more professional. See
  11126. also GetLogiDrive$, which allows you to determine which drive
  11127. letter is active for a given drive.
  11128.  
  11129.    SetLogiDrive Drive$, ErrCode%
  11130.  
  11131. Drive$     drive letter to select (use "" for current drive)
  11132. -------
  11133. ErrCode%   whether there was an error (0 no)
  11134.  
  11135. Name  : SetMatD              (Set Matrix to Double)
  11136. Class : Array
  11137. Level : Any
  11138.  
  11139. This routine sets as many elements of a double-precision array
  11140. as you like, starting at a specified place in the array. A good
  11141. use for it is to initialize an array (or a portion of it) to a
  11142. given value.
  11143.  
  11144.    SetMatD DSeg%, DOfs%, Elements%, Value#
  11145.  
  11146. DSeg%      segment of the first array element to add
  11147. DOfs%      offset of the first array element to add
  11148. Elements%  number of array elements to which to add
  11149. Value#     value to which to set each array element
  11150.  
  11151. Name  : SetMatI              (Set Matrix to Integer)
  11152. Class : Array
  11153. Level : Any
  11154.  
  11155. This routine sets as many elements of an integer array as you
  11156. like, starting at a specified place in the array. A good use for
  11157. it is to initialize an array (or a portion of it) to a given
  11158. value.
  11159.  
  11160.    SetMatI DSeg%, DOfs%, Elements%, Value%
  11161.  
  11162. DSeg%      segment of the first array element to add
  11163. DOfs%      offset of the first array element to add
  11164. Elements%  number of array elements to which to add
  11165. Value%     value to which to set each array element
  11166.  
  11167. Name  : SetMatL              (Set Matrix to Long)
  11168. Class : Array
  11169. Level : Any
  11170.  
  11171. This routine sets as many elements of an long integer array as
  11172. you like, starting at a specified place in the array. A good use
  11173. for it is to initialize an array (or a portion of it) to a given
  11174. value.
  11175.  
  11176.    SetMatL DSeg%, DOfs%, Elements%, Value&
  11177.  
  11178. DSeg%      segment of the first array element to add
  11179. DOfs%      offset of the first array element to add
  11180. Elements%  number of array elements to which to add
  11181. Value&     value to which to set each array element
  11182.  
  11183. Name  : SetMatS              (Set Matrix to Single)
  11184. Class : Array
  11185. Level : Any
  11186.  
  11187. This routine sets as many elements of a single-precision array
  11188. as you like, starting at a specified place in the array. A good
  11189. use for it is to initialize an array (or a portion of it) to a
  11190. given value.
  11191.  
  11192.    SetMatS DSeg%, DOfs%, Elements%, Value!
  11193.  
  11194. DSeg%      segment of the first array element to add
  11195. DOfs%      offset of the first array element to add
  11196. Elements%  number of array elements to which to add
  11197. Value!     value to which to set each array element
  11198.  
  11199. Name  : SetMouseLoc          (Set Mouse Location)
  11200. Class : Mouse
  11201. Level : BIOS
  11202.  
  11203. This routine allows you to set the current location of the mouse
  11204. cursor. It doesn't matter if the cursor is visible or invisible.
  11205. SetMouseLoc is only for use in text mode.
  11206.  
  11207. This routine will not work properly if there is no mouse
  11208. available. Use the MMCheck routine if you are not sure.
  11209.  
  11210. See also MMSetLoc, which is for use in graphics modes.
  11211.  
  11212.    SetMouseLoc Row%, Column%
  11213.  
  11214. Row%       mouse cursor row
  11215. Column%    mouse cursor column
  11216.  
  11217. Name  : SetPatch             (Set Patch information)
  11218. Class : Disk
  11219. Level : DOS
  11220.  
  11221. This routine is used after FindPatch. The FindPatch routine
  11222. finds the first DATA statement to be patched. SetPatch places
  11223. new information in that DATA statement and moves the file
  11224. pointer to the position of the next DATA statement. Note that
  11225. there must be only one item per DATA statement; this item must
  11226. be a quoted string. The string in the DATA statement and the
  11227. patch string must be the same length.
  11228.  
  11229. If you need this routine to be able to handle variable-length
  11230. strings, don't fret! Make the DATA string one character longer
  11231. than the maximum you need, and use the extra character to
  11232. indicate the actual string length:
  11233.  
  11234.    SetPatch CHR$(LEN(St$)) + St$
  11235.  
  11236. Then when you READ St$, decode it like so:
  11237.  
  11238.    St$ = MID$(St$, 2, ASC(St$))
  11239.  
  11240. Routines in this set include FindPatch, SetPatch, PatchDone.
  11241.  
  11242.    SetPatch St$
  11243.  
  11244. St$       string to patch into the current DATA statement
  11245.  
  11246. Name  : SetPath              (Set default Path)
  11247. Class : Disk
  11248. Level : DOS
  11249.  
  11250. This routine allows you to set the default path. You may specify
  11251. a drive and/or subdirectory:
  11252.  
  11253.    Path$ = "E:"           ' switch to drive E:
  11254.    Path$ = "\DOC\TECH"    ' switch to subdir \DOC\TECH
  11255.    Path$ = "C:\GAME"      ' switch to drive C:, subdir \GAME
  11256.  
  11257. The "." and ".." directories are not recognized. However, you
  11258. may specify either an absolute or relative path, as usual, and
  11259. can also use either slashes or backslashes as delimiters.
  11260.  
  11261. See also SetDrv, SetSub
  11262.  
  11263.    SetPath Path$, ErrCode%
  11264.  
  11265. Path$      path specification
  11266. -------
  11267. ErrCode%   error code: 0 if no error, else a DOS Error number
  11268.  
  11269. Name  : SetPrtAddr           (Set Printer Address)
  11270. Class : Printer
  11271. Level : Clone
  11272.  
  11273. This routine allows you to set the base port address of a
  11274. parallel port.
  11275.  
  11276. One use for this routine is to fool BASIC into using a different
  11277. port than LPT1 for LPRINT. See also PRTSWAP.
  11278.  
  11279. Note that PS/2 systems only have ports 1-3 available. They use
  11280. the fourth port data area for holding other information. It may
  11281. be a good idea to restrict yourself to ports 1-3 for
  11282. compatibility purposes, although other computers allow ports
  11283. 1-4.
  11284.  
  11285. Don't forget to set the ports back to their original values
  11286. before your program ends!
  11287.  
  11288.    SetPrtAddr PortNr%, PortAddr%
  11289.  
  11290. PortNr%     LPT port number (1-4 or 1-3 [see above])
  11291. PortAddr%   port address
  11292.  
  11293. Name  : SetSub               (Set default Subdirectory)
  11294. Class : Disk
  11295. Level : DOS
  11296.  
  11297. Just like the DOS CD (or CHDIR) command, this routine allows you
  11298. to change the current subdirectory. Unlike the corresponding DOS
  11299. command, you may not use a period or double period as shorthand
  11300. for a directory. However, you may specify either an absolute or
  11301. relative path, as usual, and can also use either slashes or
  11302. backslashes as delimiters.
  11303.  
  11304. You may specify a drive as part of the directory specification,
  11305. in which case the default directory on the specified drive will
  11306. be set (but the current default drive will not change).
  11307.  
  11308. See also SetPath.
  11309.  
  11310.    SetSub SubDir$, ErrCode%
  11311.  
  11312. SubDir$    subdirectory name
  11313. -------
  11314. ErrCode%   error code: 0 if no error, else a DOS Error number
  11315.  
  11316. Name  : SetTimeAT            (Set Time of AT clock)
  11317. Class : Time
  11318. Level : BIOS (AT)
  11319.  
  11320. This routine sets the time to the hardware real-time clock in
  11321. AT-class computers. Depending on the DOS version, this time may
  11322. be partially or completely independent of the time kept by DOS
  11323. in software. DOS always reads the time from the hardware clock
  11324. when it starts up. However, use of the TIME command in DOS (and
  11325. the TIME$ function in QuickBASIC) may relate only to the
  11326. software copy of the time, which is not always guaranteed to be
  11327. the same as the time in the hardware clock due to certain
  11328. discrepancies in DOS.
  11329.  
  11330.    SetTimeAT HourNr%, MinuteNr%, SecondNr%
  11331.  
  11332. HourNr%      hour (0-23)
  11333. MinuteNr%    minute
  11334. SecondNr%    second
  11335.  
  11336. Name  : SetVerify            (Set Verify state)
  11337. Class : Disk
  11338. Level : DOS
  11339.  
  11340. The SetVerify routine allows you to set the state of the DOS
  11341. VERIFY flag. When VERIFY is on, some checking is done to make
  11342. sure that writing to the disk works as requested. The checks are
  11343. not very good, however, and VERIFY slows down disk handling, so
  11344. it is usually better to have VERIFY off.
  11345.  
  11346.    SetVerify VerifyOn%
  11347.  
  11348. VerifyOn%   whether to turn VERIFY on (0 if no)
  11349.  
  11350. Name  : SetVGAColor          (Set VGA Color)
  11351. Class : Display
  11352. Level : BIOS
  11353.  
  11354. This routine sets the color associated with a given color
  11355. number. The color is specified as a combination of red, green,
  11356. and blue intensities. Each intensity may range from off (0) to
  11357. very bright (63).
  11358.  
  11359. If you are dealing with more than one color at a time, you may
  11360. find SetVGAPalette more appropriate.
  11361.  
  11362.    SetVGAColor ColorNr%, Red%, Green%, Blue%
  11363.  
  11364. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  11365. Red%       red intensity (0-63)
  11366. Green%     green intensity (0-63)
  11367. Blue%      blue intensity (0-63)
  11368.  
  11369. Name  : SetVGAPalette        (Set VGA Palette)
  11370. Class : Display
  11371. Level : BIOS
  11372.  
  11373. This routine allows you to set any number of the VGA palette
  11374. values from a TYPEd array. The TYPE for the array should be
  11375. defined like this:
  11376.  
  11377.    TYPE Palet
  11378.       IRed AS STRING * 1
  11379.       IBlue AS STRING * 1
  11380.       IGreen AS STRING * 1
  11381.    END TYPE
  11382.  
  11383. This type holds a CHR$-encoded representation of the intensity
  11384. of each component of the color. The values range from 0-63.
  11385.  
  11386. You can change many palette settings at a time, very quickly,
  11387. with this routine. This routine is sufficiently faster than the
  11388. BASIC PALETTE statement as to make palette animation (and some
  11389. stupendous special effects) possible. It may cause flickering on
  11390. displays with less well-designed video BIOS chips, however.
  11391.  
  11392. If you only need to set a few colors, you may find SetVGAColor
  11393. more convenient.
  11394.  
  11395.    SetVGAPalette DSeg%, DOfs%, Start%, Colors%
  11396.  
  11397. DSeg%      segment of the palette array
  11398. DOfs%      offset of the palette array
  11399. Start%     color number to start with
  11400. Colors%    number of colors to set
  11401.  
  11402. Name  : SFRead               (String File Read)
  11403. Class : Disk / String
  11404. Level : DOS
  11405.  
  11406. This routine reads a string from a file that was opened by
  11407. FOpen1 or FCreate. The length of the string you provide
  11408. determines how many characters should be read. If it wasn't
  11409. possible to read all the characters desired, an error code will
  11410. be returned and the BytesRead% value will tell you how many
  11411. characters were actually retrieved.
  11412.  
  11413.    St$ = SPACE$(BytesToRead%)
  11414.    SFRead Handle%, St$, BytesRead%, ErrCode%
  11415.  
  11416. Handle%     handle of the file from which to read
  11417. -------
  11418. St$         data read from the file.  Init to # of chars wanted
  11419. BytesRead%  number of bytes read from the file (if error)
  11420. ErrCode%    error code: 0 if no error, else DOS Error
  11421.  
  11422. Name  : SFWrite              (String File Write)
  11423. Class : Disk / String
  11424. Level : DOS
  11425.  
  11426. This routine writes a string to a file that was opened by FOpen1
  11427. or FCreate. The length of the string you provide determines how
  11428. many characters will be written. If it wasn't possible to write
  11429. the entire string to the file, an error code will be returned
  11430. and the BytesWrit% value will tell you how many characters were
  11431. actually written.
  11432.  
  11433.    SFWrite Handle%, St$, BytesWrit%, ErrCode%
  11434.  
  11435. Handle%     handle of the file to which to write
  11436. St$         data to write to the file.
  11437. -------
  11438. BytesWrit%  number of bytes written to the file (if error)
  11439. ErrCode%    error code: 0 if no error, else DOS Error
  11440.  
  11441. Name  : ShiftL               (Shift Left)
  11442. Class : Numeric
  11443. Level : Any
  11444.  
  11445. This routine shifts the bits in an integer left by a desired
  11446. amount. The effect of this is similar to multiplying the number
  11447. by a power of two, if the number is positive, but is much
  11448. faster.
  11449.  
  11450.    ShiftL Value%, Count%
  11451.  
  11452. Value%    number to shift left
  11453. Count%    bits by which to shift
  11454. -------
  11455. Value%    shifted number
  11456.  
  11457. Name  : ShiftLL              (Shift Left Long)
  11458. Class : Numeric
  11459. Level : Any
  11460.  
  11461. This routine shifts the bits in a long integer left by a desired
  11462. amount. The effect of this is similar to multiplying the number
  11463. by a power of two, if the number is positive, but is much
  11464. faster.
  11465.  
  11466.    ShiftLL Value&, Count%
  11467.  
  11468. Value&    number to shift left
  11469. Count%    bits by which to shift
  11470. -------
  11471. Value&    shifted number
  11472.  
  11473. Name  : ShiftR               (Shift Right)
  11474. Class : Numeric
  11475. Level : Any
  11476.  
  11477. This routine shifts the bits in an integer right by a desired
  11478. amount. The effect of this is similar to dividing the number by
  11479. a power of two, if the number is positive, but is much faster.
  11480.  
  11481.    ShiftR Value%, Count%
  11482.  
  11483. Value%    number to shift right
  11484. Count%    bits by which to shift
  11485. -------
  11486. Value%    shifted number
  11487.  
  11488. Name  : ShiftRL              (Shift Right Long)
  11489. Class : Numeric
  11490. Level : Any
  11491.  
  11492. This routine shifts the bits in a long integer right by a
  11493. desired amount. The effect of this is similar to dividing the
  11494. number by a power of two, if the number is positive, but is much
  11495. faster.
  11496.  
  11497.    ShiftRL Value&, Count%
  11498.  
  11499. Value&    number to shift right
  11500. Count%    bits by which to shift
  11501. -------
  11502. Value&    shifted number
  11503.  
  11504. Name  : ShlSt                (Shift Left String of bits)
  11505. Class : String
  11506. Level : Any
  11507.  
  11508. This routine shifts the bits in a string left by a desired
  11509. amount. This may be helpful for manupulating strings containing
  11510. bit flags, images, et al.
  11511.  
  11512.    ShlSt St$, Count%
  11513.  
  11514. St$       string to shift left
  11515. Count%    bits by which to shift
  11516. -------
  11517. St$       shifted string
  11518.  
  11519. Name  : ShowBMP              (Show Bitmap)
  11520. Class : Display File
  11521. Level : BIOS
  11522.  
  11523. This routine displays a bitmap file (MS Windows .BMP format) on
  11524. the screen. The display must be in SCREEN 13 mode (MCGA or VGA,
  11525. 320x200, 256 colors). You can specify a starting X,Y coordinate,
  11526. or use -1,-1 to scale the image to the screen. Scaling allows
  11527. you to display images larger than 320x200.
  11528.  
  11529. Only 256-color bitmaps are supported. The palette will be
  11530. changed according to the directions in the bitmap file. If
  11531. scaling is chosen and the image is larger than 320x200, the
  11532. screen coordinates will be altered with WINDOW SCREEN to let the
  11533. image fit. Proportional scaling is used to avoid having a
  11534. flattened or stretched image.
  11535.  
  11536.    ShowBMP FileName$, X%, Y%, ErrCode%
  11537.  
  11538. FileName$   name of bitmap file
  11539. X%          X coordinate (0-319, or -1 for scaling)
  11540. Y%          Y coordinate (0-199, or -1 for scaling)
  11541. -------
  11542. ErrCode%    error code (0 if none; >0, DOS error; <0, bad .BMP)
  11543.  
  11544. Name  : ShowIcon             (Show Icon)
  11545. Class : Display File
  11546. Level : BIOS
  11547.  
  11548. This routine displays an icon file (MS Windows .ICO format) on
  11549. the screen. The display mode may be any of the EGA or VGA
  11550. graphics modes, and you can specify a starting X,Y coordinate.
  11551.  
  11552. Only the standard icon format is supported. These icons are
  11553. 32x32 pixels and are contained in 766-byte .ICO files. Note that
  11554. colors are translated from Windows colors, which are a close
  11555. (but not exact) match for BASIC colors.
  11556.  
  11557.    ShowIcon FileName$, X%, Y%, ErrCode%
  11558.  
  11559. FileName$   name of icon file
  11560. X%          X coordinate (0-319 or 0-639 depending on mode)
  11561. Y%          Y coordinate (0-199, -349, etc; depends on mode)
  11562. -------
  11563. ErrCode%    error code (0 if none; >0, DOS error; <0, not .ICO)
  11564.  
  11565. Name  : ShrSt                (Shift Right String of bits)
  11566. Class : String
  11567. Level : Any
  11568.  
  11569. This routine shifts the bits in a string right by a desired
  11570. amount. This may be helpful for manupulating strings containing
  11571. bit flags, images, et al.
  11572.  
  11573.    ShrSt St$, Count%
  11574.  
  11575. St$       string to shift right
  11576. Count%    bits by which to shift
  11577. -------
  11578. St$       shifted string
  11579.  
  11580. Name  : ShuffleSt            (Shuffle String)
  11581. Class : String
  11582. Level : Any
  11583.  
  11584. This routine shuffles the characters in a string, efficiently
  11585. randomizing their order. It relies on the RND function, so you'd
  11586. be advised to use the RANDOMIZE statement at the top of your
  11587. program unless you want the results to be predictable. A good
  11588. way of initializing the random number generator is:
  11589.  
  11590.    RANDOMIZE TIMER
  11591.  
  11592. See also the array shuffles: MatShuffleD, MatShuffleI,
  11593. MatShuffleL, MatShuffleS, MatShuffleSt
  11594.  
  11595.    ShuffleSt St$
  11596.  
  11597. St$       string to shuffle
  11598. -------
  11599. St$       shuffled string
  11600.  
  11601. Name  : SInput               (String Input)
  11602. Class : Input
  11603. Level : Clone
  11604.  
  11605. This is a flexible line input routine which supports WordStar
  11606. and DOS-style editing, default entries, key screening, and any
  11607. number of other options. To keep SInput manageable, the less
  11608. volatile parameters are set with separate routines instead of
  11609. being passed directly.
  11610.  
  11611. The St$ parameter must be set to the maximum desired input
  11612. length. It may also contain a default entry, in which case SLen%
  11613. should be set to the length of the default entry (set SLen% to
  11614. zero if there is no default entry).
  11615.  
  11616. Character screening is done through selection of valid character
  11617. types. This may be any combination of the following (add the
  11618. desired types together):
  11619.  
  11620.     1    letters
  11621.     2    digits
  11622.     4    symbols
  11623.    16    graphics (ASCII 128-255)
  11624.    32    spaces
  11625.  
  11626. You can use -1 to allow any character. You can also make use of
  11627. the NOT operator, e.g. NOT 2 allows everything but digits.
  11628.  
  11629. The ExitCode% returns the key used to terminate input. This will
  11630. normally be 13 (return) or 27 (esc), but other results may be
  11631. returned depending on how you use the various SInputSet
  11632. routines. Note that the cursor position is not altered when
  11633. SInput exits, to avoid accidentally scrolling your screen. You
  11634. are left with full control over the cursor.
  11635.  
  11636. The SInput routine is designed with the idea of input forms and
  11637. windows in mind. It is not capable of handling more than one
  11638. line of text at a time. It also doesn't know how to wrap at the
  11639. edge of the screen.
  11640.  
  11641. Routines in this series include:
  11642.    SInput, SInputSet, SInputSet1, SInputSet2
  11643.  
  11644. Since everyone has their own ideas about the perfect input
  11645. routine, I have recoded SInput largely in BASIC to allow you to
  11646. modify it easily. I've gotten a huge number of requests for
  11647. SInput modifications in the past; hopefully this will be the
  11648. best solution!
  11649.  
  11650.    SInput St$, SLen%, Valid%, MustFill%, VAttr%, ExitCode%
  11651.  
  11652. St$         init to max length of input (may hold default)
  11653. SLen%       length of default entry (0 if none)
  11654. Valid%      valid character types (see above)
  11655. MustFill%   whether input field must be totally filled (0 no)
  11656. VAttr%      color/attribute for input (see CalcAttr)
  11657. -------
  11658. St$         entered string
  11659. SLen%       length of entered string
  11660. ExitCode%   key used to exit (13 for <CR> or 27 for <ESC>)
  11661.  
  11662. Name  : SInputSet            (String Input Settings)
  11663. Class : Input
  11664. Level : Clone
  11665.  
  11666. This is one of a number of routines which allow you to modify
  11667. the default operation of SInput.
  11668.  
  11669. If you allow extended keys (like Alt keys and function keys) to
  11670. exit SInput, the ExitCode% parameter will return the negative
  11671. scan code of the key.
  11672.  
  11673. Routines in this series include:
  11674.    SInput, SInputSet, SInputSet1, SInputSet2
  11675.  
  11676.    SInputSet FillCh$, ExtExit%, BadBeep%, FullBeep%, Fast%
  11677.  
  11678. FillCh$     character used to show field length (default "_")
  11679. ExtExit%    extended keys can be used to exit (default 0, no)
  11680. BadBeep%    beep on invalid keys (default 0, no)
  11681. FullBeep%   beep when input field is full (default 0, no)
  11682. Fast%       use fast display, may make CGA flicker (def 0, no)
  11683.  
  11684. Name  : SInputSet1           (String Input Settings)
  11685. Class : Input
  11686. Level : Clone
  11687.  
  11688. This is one of a number of routines which allow you to modify
  11689. the default operation of SInput.
  11690.  
  11691. If you give SInput a default entry, it will normally place the
  11692. cursor at the end of that entry when input begins. The CurPosn%
  11693. option here allows you to place the cursor where you want it
  11694. (1 - LEN(St$), or 0 for end of entry).
  11695.  
  11696. Routines in this series include:
  11697.    SInput, SInputSet, SInputSet1, SInputSet2
  11698.  
  11699.    SInputSet1 CurPosn%, FullExit%
  11700.  
  11701. CurPosn%    starting cursor posn within input field (default 0)
  11702. FullExit%   auto-exit when input field is full (default 0, no)
  11703.  
  11704. Name  : SInputSet2           (String Input Settings)
  11705. Class : Input
  11706. Level : Clone
  11707.  
  11708. This is one of a number of routines which allow you to modify
  11709. the default operation of SInput.
  11710.  
  11711. If you allow tabs to exit SInput, the ExitCode% may return an
  11712. additional value: 9 (tab). A "back tab", by the way, can be
  11713. retrieved if you use SInputSet to allow extended keys to exit
  11714. (back tab would return -15).
  11715.  
  11716. Routines in this series include:
  11717.    SInput, SInputSet, SInputSet1, SInputSet2
  11718.  
  11719.    SInputSet2 Capitalize%, TabExit%
  11720.  
  11721. Capitalize%   whether to capitalize letters (default 0, no)
  11722. TabExit%      whether tab key can to exit (default 0, no)
  11723.  
  11724. Name  : SortD                (Sort Double precision)
  11725. Class : Array management
  11726. Level : Any
  11727.  
  11728. This routine sorts the elements in an array of double-precision
  11729. numbers.
  11730.  
  11731. The array is assumed to start at element 1. You may specify the
  11732. last element in the array, allowing you to sort only part of an
  11733. array if you like.
  11734.  
  11735. If you would like the results to be largest-to-smallest, rather
  11736. than smallest-to-largest, just call ReverseD after this routine.
  11737.  
  11738.    SortD Array#(), Elements%
  11739.  
  11740. Array#()    array to be sorted
  11741. Elements%   number of elements in array
  11742. -------
  11743. Array#()    sorted array
  11744.  
  11745. Name  : SortI                (Sort Integer)
  11746. Class : Array management
  11747. Level : Any
  11748.  
  11749. This routine sorts the elements in an array of integers.
  11750.  
  11751. The array is assumed to start at element 1. You may specify the
  11752. last element in the array, allowing you to sort only part of an
  11753. array if you like.
  11754.  
  11755. If you would like the results to be largest-to-smallest, rather
  11756. than smallest-to-largest, just call ReverseI after this routine.
  11757.  
  11758.    SortI Array%(), Elements%
  11759.  
  11760. Array%()    array to be sorted
  11761. Elements%   number of elements in array
  11762. -------
  11763. Array%()    sorted array
  11764.  
  11765. Name  : SortL                (Sort Long integer)
  11766. Class : Array management
  11767. Level : Any
  11768.  
  11769. This routine sorts the elements in an array of long integers.
  11770.  
  11771. The array is assumed to start at element 1. You may specify the
  11772. last element in the array, allowing you to sort only part of an
  11773. array if you like.
  11774.  
  11775. If you would like the results to be largest-to-smallest, rather
  11776. than smallest-to-largest, just call ReverseL after this routine.
  11777.  
  11778.    SortL Array&(), Elements%
  11779.  
  11780. Array&()    array to be sorted
  11781. Elements%   number of elements in array
  11782. -------
  11783. Array&()    sorted array
  11784.  
  11785. Name  : SortS                (Sort Single precision)
  11786. Class : Array management
  11787. Level : Any
  11788.  
  11789. This routine sorts the elements in an array of single-precision
  11790. numbers.
  11791.  
  11792. The array is assumed to start at element 1. You may specify the
  11793. last element in the array, allowing you to sort only part of an
  11794. array if you like.
  11795.  
  11796. If you would like the results to be largest-to-smallest, rather
  11797. than smallest-to-largest, just call ReverseS after this routine.
  11798.  
  11799.    SortS Array!(), Elements%
  11800.  
  11801. Array!()    array to be sorted
  11802. Elements%   number of elements in array
  11803. -------
  11804. Array!()    sorted array
  11805.  
  11806. Name  : SortSt               (Sort String)
  11807. Class : Array management
  11808. Level : Any
  11809.  
  11810. This routine sorts the elements in a string array.
  11811.  
  11812. The array is assumed to start at element 1. You may specify the
  11813. last element in the array, allowing you to sort only part of an
  11814. array if you like. You can also specify whether the
  11815. capitalization of letters in a string should matter for sorting
  11816. purposes.
  11817.  
  11818. If you would like the results to be last-to-first, rather than
  11819. first-to-last, just call ReverseSt after this routine.
  11820.  
  11821.    SortSt Array$(), Elements%, CapsCount%
  11822.  
  11823. Array$()    array to be sorted
  11824. CapsCount%  use 0 if uppercase/lowercase doesn't matter
  11825. Elements%   number of elements in array
  11826. -------
  11827. Array$()    sorted array
  11828.  
  11829. Name  : Soundex              (Soundex code)
  11830. Class : String
  11831. Level : Any
  11832.  
  11833. This is a string comparison routine which returns a code that is
  11834. loosely based on the "sound" of a word. It removes the vowels
  11835. and repeated characters from a word, then converts it into a
  11836. numeric code. Any words with the same code are considered to
  11837. sound alike.
  11838.  
  11839. While not perfect, this algorithm does a fast and reasonably
  11840. good job. It can be helpful in applications like spelling
  11841. checkers and phone books, where a search based on exact text may
  11842. not be appropriate.
  11843.  
  11844.    Code$ = St$
  11845.    Soundex St$, Code$, CodeLen%
  11846.    Code$ = LEFT$(St$, CodeLen%)
  11847.  
  11848. St$       string to be encoded
  11849. -------
  11850. Code$     result code.  Init to >= length of original string.
  11851. CodeLen%  length of the result code
  11852.  
  11853. Name  : SpeedKey             (Speed up Keyboard)
  11854. Class : Input
  11855. Level : BIOS (AT)
  11856.  
  11857. This routine provides control over the keyboard repeat rate for
  11858. AT-class machines. Increasing the repeat rate can make the
  11859. computer seem a lot more responsive and pleasant to deal with.
  11860.  
  11861.   RepDelay%   Delay Time
  11862.      0        250 milliseconds
  11863.      1        500 ms
  11864.      2        750 ms
  11865.      3        1 second
  11866.  
  11867.   RepRate% is the key repeat rate, 0-31 (from around 30 cps to
  11868.   around 2 cps)
  11869.  
  11870.    SpeedKey RepDelay%, RepRate%
  11871.  
  11872. RepDelay%   delay before starting to repeat (0-3, default 1)
  11873. RepRate%    rate at which to repeat key (0-31, default 11)
  11874.  
  11875. Name  : Split                (Split screen image)
  11876. Class : Display
  11877. Level : Clone
  11878.  
  11879. This provides an elegant way to clear a text-mode screen. It
  11880. splits the display into four parts, scrolling each part up or
  11881. down until it slides off the screen.
  11882.  
  11883.    Split
  11884.  
  11885. Name  : Spooler              (check for print Spooler)
  11886. Class : Printer
  11887. Level : DOS
  11888.  
  11889. The Spooler routine allows you to see whether the print spooler
  11890. (installed by the DOS PRINT utility) is available.
  11891.  
  11892.    Spooler Status%
  11893.  
  11894. -------
  11895. Status%   spooler status:
  11896.              -1   it's installed
  11897.               0   it isn't installed, but can be
  11898.               1   it isn't installed, and can't be
  11899.  
  11900. Name  : SSrch                (String Search)
  11901. Class : String
  11902. Level : Any
  11903.  
  11904. This is a string search routine which tells you whether one
  11905. string can be found inside another. Uppercase/lowercase
  11906. distinctions are ignored. Leading and trailing spaces in the
  11907. string for which to search are also ignored.
  11908.  
  11909. Note that the positions of the main string and search string
  11910. parameters are in the reverse of the order you might expect.
  11911.  
  11912.    SSrch Search$, MainSt$, Found%
  11913.  
  11914. Search$   string for which to search
  11915. MainSt$   string to be searched
  11916. -------
  11917. Found%    whether a match was found (0 if no)
  11918.  
  11919. Name  : StrDel               (String Delete)
  11920. Class : String
  11921. Level : Any
  11922.  
  11923. StrDel deletes a character from a string. Actually, it doesn't
  11924. make the string any shorter, but it acts like a delete. The end
  11925. of the string is filled with a space.
  11926.  
  11927.    StrDel St$, Posn%
  11928.  
  11929. St$       string from which to delete a character
  11930. Posn%     position of the character to delete (1-LEN(St$))
  11931. -------
  11932. St$       processed string
  11933.  
  11934. Name  : StrIns               (String Insert)
  11935. Class : String
  11936. Level : Any
  11937.  
  11938. StrIns inserts a space into a string. Actually, it doesn't make
  11939. the string any longer, but it acts like an insert. The former
  11940. end of the string is discarded.
  11941.  
  11942.    StrIns St$, Posn%
  11943.  
  11944. St$       string in which to insert a space
  11945. Posn%     where to insert the space (1-LEN(St$))
  11946. -------
  11947. St$       processed string
  11948.  
  11949. Name  : Strip                (Strip spaces)
  11950. Class : String
  11951. Level : Any
  11952.  
  11953. This routine strips both leading and trailing white space from a
  11954. string. This includes control characters as well as blanks
  11955. (anything below CHR$(33)).
  11956.  
  11957.    Strip St$
  11958.  
  11959. St$      string to process
  11960. -------
  11961. St$      processed string
  11962.  
  11963. Name  : Strip2$              (Strip Spaces)
  11964. Class : String
  11965. Level : Any
  11966.  
  11967. This routine strips both leading and trailing white space from a
  11968. string. It works just like Strip, but is a function rather than
  11969. a subprogram. White space includes control characters as well as
  11970. blanks (anything below CHR$(33)).
  11971.  
  11972.    Result$ = Strip2$(St$)
  11973.  
  11974. St$       string to process
  11975. -------
  11976. Result$   processed string
  11977.  
  11978. Name  : StripBlanks          (Strip Blanks)
  11979. Class : String
  11980. Level : Any
  11981.  
  11982. This routine strips leading and/or trailing white space from a
  11983. string. This includes control characters as well as blanks
  11984. (anything below CHR$(33)).
  11985.  
  11986. See also StripSpaces.
  11987.  
  11988.    StripBlanks St$, Which%, StLen%
  11989.    St$ = LEFT$(St$, StLen%)
  11990.  
  11991. St$      string to process
  11992. Which%   1: strip left, 2: strip right, 3: strip left and right
  11993. -------
  11994. St$      processed string
  11995. StLen    length of processed string
  11996.  
  11997. Name  : StripChar            (Strip Characters)
  11998. Class : String
  11999. Level : Any
  12000.  
  12001. This routine strips all occurrences of a given list of
  12002. characters out of a string. Among the uses for this are cleaning
  12003. up user-entered values. For instance, a strip list of "$," would
  12004. remove commas and dollar signs from a number, and "()- " will
  12005. remove telephone delimiters.
  12006.  
  12007.    StripChar St$, StripList$, StLen%
  12008.    St$ = LEFT$(St$, StLen%)
  12009.  
  12010. St$         string to process
  12011. StripList$  characters to remove from the string
  12012. -------
  12013. St$         processed string
  12014. StLen%      length of processed string
  12015.  
  12016. Name  : StripRange           (Strip Range of characters)
  12017. Class : String
  12018. Level : Any
  12019.  
  12020. This routine strips an inclusive range of characters out of a
  12021. string. The range is specified as the first and last ASCII codes
  12022. to strip. For instance, using a low character of "0" and a high
  12023. of "9" would remove all digits from a string.
  12024.  
  12025.    StripRange St$, ASC(LowChar$), ASC(HighChar$), StLen%
  12026.    St$ = LEFT$(St$, StLen%)
  12027.  
  12028. St$         string to process
  12029. LowChar$    lowest character to strip
  12030. HighChar$   highest character to strip
  12031. -------
  12032. St$         processed string
  12033. StLen%      length of processed string
  12034.  
  12035. Name  : StripSpaces          (Strip Spaces)
  12036. Class : String
  12037. Level : Any
  12038.  
  12039. This routine strips leading and/or trailing spaces from a
  12040. string.
  12041.  
  12042. See also StripBlanks.
  12043.  
  12044.    StripSpaces St$, Which%, StLen%
  12045.    St$ = LEFT$(St$, StLen%)
  12046.  
  12047. St$      string to process
  12048. Which%   1: strip left, 2: strip right, 3: strip left and right
  12049. -------
  12050. St$      processed string
  12051. StLen%   length of processed string
  12052.  
  12053. Name  : StrSqu$              (String Squish)
  12054. Class : String
  12055. Level : Any
  12056.  
  12057. This is a text compression routine which uses 2-gram and 3-gram
  12058. compression to shrink a string. It combines the best of the
  12059. StrSqu2 and StrSqu3 routines with additional ease of use. The
  12060. one limitation is that only plain text may be compressed; the
  12061. text may not contain CHR$(128) through CHR$(255), as these codes
  12062. are used by the compression algorithm.
  12063.  
  12064. The compressed text can be restored to original form with the
  12065. StrUnsq$ function.
  12066.  
  12067.    Result$ = StrSqu$(St$)
  12068.  
  12069. St$       string to compress
  12070. -------
  12071. Result$   compressed string
  12072.  
  12073. Name  : StrSqu2              (String Squish, 2-gram)
  12074. Class : String
  12075. Level : Any
  12076.  
  12077. This is a text compression routine which uses a 2-gram algorithm
  12078. to compress common pairs of characters out of a string. You can
  12079. reasonably expect to reduce the text size by about a third with
  12080. this routine. Compression is quite fast. The one limitation is
  12081. that only plain text may be compressed; the text may not contain
  12082. CHR$(128) through CHR$(255), as these codes are used by the
  12083. compression algorithm.
  12084.  
  12085. You must use StrSquLen2 before this routine to determine the
  12086. proper length to which to initialize the result string.
  12087.  
  12088. The compressed text can be restored to original form with
  12089. StrUnsqu2.
  12090.  
  12091.    StrSquLen2 St$, ResultLen%
  12092.    Result$ = SPACE$(ResultLen%)
  12093.    StrSqu2 St$, Result$
  12094.  
  12095. St$       string to compress
  12096. -------
  12097. Result$   compressed string
  12098.  
  12099. Name  : StrSqu3              (String Squish, 3-gram)
  12100. Class : String
  12101. Level : Any
  12102.  
  12103. This is a text compression routine which uses a 3-gram algorithm
  12104. to compress common triplets of characters out of a string. You
  12105. can reasonably expect to reduce the text size by about a third
  12106. with this routine. Compression is quite fast. The one limitation
  12107. is that only plain text may be compressed; the text may not
  12108. contain CHR$(128) through CHR$(255), as these codes are used by
  12109. the compression algorithm.
  12110.  
  12111. You must use StrSquLen3 before this routine to determine the
  12112. proper length to which to initialize the result string.
  12113.  
  12114. The compressed text can be restored to original form with
  12115. StrUnsqu3.
  12116.  
  12117.    StrSquLen3 St$, ResultLen%
  12118.    Result$ = SPACE$(ResultLen%)
  12119.    StrSqu3 St$, Result$
  12120.  
  12121. St$       string to compress
  12122. -------
  12123. Result$   compressed string
  12124.  
  12125. Name  : StrSquLen2           (String Squished Length, 2-gram)
  12126. Class : String
  12127. Level : Any
  12128.  
  12129. This routine is used in conjunction with the StrSqu2 text
  12130. compressor. It tells you what size the resulting text will be.
  12131. See StrSqu2 for further information.
  12132.  
  12133.    StrSquLen2 St$, ResultLen%
  12134.    Result$ = SPACE$(ResultLen%)
  12135.    StrSqu2 St$, Result$
  12136.  
  12137. St$          string to compress
  12138. -------
  12139. ResultLen%   length of the compressed string
  12140.  
  12141. Name  : StrSquLen3           (String Squished Length, 3-gram)
  12142. Class : String
  12143. Level : Any
  12144.  
  12145. This routine is used in conjunction with the StrSqu3 text
  12146. compressor. It tells you what size the resulting text will be.
  12147. See StrSqu3 for further information.
  12148.  
  12149.    StrSquLen3 St$, ResultLen%
  12150.    Result$ = SPACE$(ResultLen%)
  12151.    StrSqu3 St$, Result$
  12152.  
  12153. St$          string to compress
  12154. -------
  12155. ResultLen%   length of the compressed string
  12156.  
  12157. Name  : StrUnsq$             (String Unsquish)
  12158. Class : String
  12159. Level : Any
  12160.  
  12161. This routine decompresses text which was compressed by the
  12162. StrSqu$ function.
  12163.  
  12164.    Result$ = StrUnsq$(St$)
  12165.  
  12166. St$       string to decompress
  12167. -------
  12168. Result$   decompressed string
  12169.  
  12170. Name  : StrUnsqu2            (String Unsquish, 2-gram)
  12171. Class : String
  12172. Level : Any
  12173.  
  12174. This routine decompresses text which was compressed by StrSqu2.
  12175. Text is decompressed at lightning speed, as this routine has no
  12176. overhead to speak of.
  12177.  
  12178. You must use StrUnsquLen2 before this routine to determine the
  12179. proper length to which to initialize the result string.
  12180.  
  12181.    StrUnsquLen2 St$, ResultLen%
  12182.    Result$ = SPACE$(ResultLen%)
  12183.    StrUnsqu2 St$, Result$
  12184.  
  12185. St$       string to decompress
  12186. -------
  12187. Result$   decompressed string
  12188.  
  12189. Name  : StrUnsqu3            (String Unsquish, 3-gram)
  12190. Class : String
  12191. Level : Any
  12192.  
  12193. This routine decompresses text which was compressed by StrSqu3.
  12194. Text is decompressed at lightning speed, as this routine has no
  12195. overhead to speak of.
  12196.  
  12197. You must use StrUnsquLen3 before this routine to determine the
  12198. proper length to which to initialize the result string.
  12199.  
  12200.    StrUnsquLen3 St$, ResultLen%
  12201.    Result$ = SPACE$(ResultLen%)
  12202.    StrUnsqu3 St$, Result$
  12203.  
  12204. St$       string to decompress
  12205. -------
  12206. Result$   decompressed string
  12207.  
  12208. Name  : StrUnsquLen2         (String Unsquished Length, 2-gram)
  12209. Class : String
  12210. Level : Any
  12211.  
  12212. This routine is used in conjunction with the StrUnsqu2 text
  12213. decompressor. It tells you what size the resulting text will be.
  12214. See StrUnsqu2 for further information.
  12215.  
  12216.    StrUnsquLen2 St$, ResultLen%
  12217.    Result$ = SPACE$(ResultLen%)
  12218.    StrUnsqu2 St$, Result$
  12219.  
  12220. St$          string to decompress
  12221. -------
  12222. ResultLen%   length of the decompressed string
  12223.  
  12224. Name  : StrUnsquLen3         (String Unsquished Length, 3-gram)
  12225. Class : String
  12226. Level : Any
  12227.  
  12228. This routine is used in conjunction with the StrUnsqu3 text
  12229. decompressor. It tells you what size the resulting text will be.
  12230. See StrUnsqu3 for further information.
  12231.  
  12232.    StrUnsquLen3 St$, ResultLen%
  12233.    Result$ = SPACE$(ResultLen%)
  12234.    StrUnsqu3 St$, Result$
  12235.  
  12236. St$          string to decompress
  12237. -------
  12238. ResultLen%   length of the decompressed string
  12239.  
  12240. Name  : SubExist             (Subdirectory Existence)
  12241. Class : Disk
  12242. Level : DOS
  12243.  
  12244. This routine lets you see if a given drive and/or subdirectory
  12245. actually exists.
  12246.  
  12247. See also SubExist2, the FUNCTION version of this routine.
  12248.  
  12249.    SubExist SubDir$, Found%
  12250.  
  12251. SubDir$   name of the path to check
  12252. -------
  12253. Found%    whether the path exists (0 if no, -1 if yes)
  12254.  
  12255. Name  : SubExist2%           (Subdirectory Existence)
  12256. Class : Disk
  12257. Level : DOS
  12258.  
  12259. This routine lets you see if a given drive and/or subdirectory
  12260. actually exists.
  12261.  
  12262. See also SubExist, the SUB version of this routine.
  12263.  
  12264.    Found% = SubExist2%(SubDir$)
  12265.  
  12266. SubDir$   name of the path to check
  12267. -------
  12268. Found%    whether the path exists (0 if no, -1 if yes)
  12269.  
  12270. Name  : Time2Int             (Time to Integer)
  12271. Class : Time
  12272. Level : Any
  12273.  
  12274. This routine compresses a time into a single integer. Note that
  12275. this integer is not in a format that lends itself to simple
  12276. computation-- you cannot subtract one from another to find out
  12277. the length of time between them. If that's what you want, try
  12278. the Elapsed routine.
  12279.  
  12280. Note that odd numbers of seconds will be rounded down to the
  12281. previous even number. This is a result of the storage format
  12282. used.
  12283.  
  12284.    Time2Int HourNr%, MinuteNr%, SecondNr%, IntTimeNr%
  12285.  
  12286. HourNr%      hour (0-23)
  12287. MinuteNr%    minute
  12288. SecondNr%    second
  12289. -------
  12290. IntTime%     time compressed into an integer
  12291.  
  12292. Name  : Time2Sec&            (Time to Seconds)
  12293. Class : Time
  12294. Level : Any
  12295.  
  12296. This routine converts a time string into the number of seconds
  12297. past midnight. This is convenient if you want to find the
  12298. difference between two times or to calculate what time it will
  12299. be after a given interval.
  12300.  
  12301.    Seconds& = Time2Sec&(TimeSt$)
  12302.  
  12303. TimeSt$    time string (TIME$ format)
  12304. -------
  12305. Seconds&   number of seconds past midnight
  12306.  
  12307. Name  : TimeN2S              (Time Numbers to String)
  12308. Class : Time
  12309. Level : Any / DOS
  12310.  
  12311. Many of the PBClone routines return the time as a set of
  12312. numbers. This routine provides an easy way to convert those
  12313. numbers into string form. The time format used (whether seconds
  12314. are included) will be based on the length of the string which
  12315. you pass to the routine. For instance, a string like "xx:xx"
  12316. would return a time like "21:35", whereas "xx:xx:xx" would
  12317. return "21:35:08".
  12318.  
  12319.    TimeSt$ = "xx:xx:xx"
  12320.    TimeN2S HourNr%, MinuteNr%, SecondNr%, TimeSt$
  12321.  
  12322. HourNr%     hour (0-23)
  12323. MinuteNr%   minute
  12324. SecondNr%   second
  12325. -------
  12326. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  12327.  
  12328. Name  : TimeS2N              (Time String to Numbers)
  12329. Class : Time
  12330. Level : Any
  12331.  
  12332. Many of the PBClone routines need to be passed the time as a set
  12333. of numbers. This routine provides an easy way to convert a time
  12334. from string form into numbers. You may use either "xx:xx:xx" or
  12335. "xx:xx" form to specify the time (the string length is
  12336. important, but the delimiter and contents of the string are
  12337. ignored). If the 5-character short form is used, the Second%
  12338. value will be zero.
  12339.  
  12340.    TimeS2N HourNr%, MinuteNr%, SecondNr%, TimeSt$
  12341.  
  12342. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  12343. -------
  12344. HourNr%     hour (0-23)
  12345. MinuteNr%   minute
  12346. SecondNr%   second (0 if 5-char format)
  12347.  
  12348. Name  : TInstr               (Typed INSTR)
  12349. Class : String
  12350. Level : Any
  12351.  
  12352. As you might guess from the "Instr" part of the name, this
  12353. routine searches a string. Instead of searching for a specific
  12354. character or substring, though, it looks for a specific type of
  12355. character-- letters, numbers, control codes, or whatever. You
  12356. can search for the first of a combination of types, too, which
  12357. also allows searching for "anything but" a specific type.
  12358.  
  12359. The character type code is specified by adding any of the
  12360. following:
  12361.  
  12362.     1    alphabetic
  12363.     2    numeric
  12364.     4    symbolic
  12365.     8    control
  12366.    16    graphics
  12367.    32    space
  12368.  
  12369. The TInstr routine is handy for parsing and cleaning up user
  12370. input, among other uses.
  12371.  
  12372.    TInstr St$, ChrType%, Place%
  12373.  
  12374. St$          string to search
  12375. ChrType%     type of character(s) to search for
  12376. -------
  12377. Place%       position of first char of desired type, or 0
  12378.  
  12379. Name  : ToPostal$            (To Postal Abbreviation)
  12380. Class : String
  12381. Level : Any
  12382.  
  12383. This function returns the two-letter U.S. postal abbreviation
  12384. corresponding to a given place name. It handles all valid
  12385. abbreviations, including states (e.g., "AZ" = "Arizona") and a
  12386. number of other countries (e.g., "PR" = "Puerto Rico").
  12387.  
  12388. A null string ("") is returned if the specified place can't be
  12389. abbreviated. Capitalization is not important, but spelling is.
  12390. This function is best used with validated input. If you have
  12391. control of the input method, consider using a "pick list" menu.
  12392. Otherwise, a fuzzy scanner would be appropriate, using perhaps
  12393. the Bickel and/or Soundex routines to find the closest match if
  12394. a perfect match is not found.
  12395.  
  12396. The conversion can also be done the other way around-- see the
  12397. FromPostal$ function.
  12398.  
  12399.    Abbrev$ = ToPostal$(PlaceName$)
  12400.  
  12401. PlaceName$   place name to abbreviate
  12402. -------
  12403. Abbrev$      two-letter postal abbreviation
  12404.  
  12405. Name  : TVIdle               (TopView Idle)
  12406. Class : Miscellaneous
  12407. Level : BIOS
  12408.  
  12409. If your program is running under TopView or a compatible
  12410. multitasker, such as DESQview, it can take advantage of this
  12411. routine to give up the rest of its time slice. This would
  12412. normally done at a point where the program is liable to be idle
  12413. for a brief while, such as during user input.
  12414.  
  12415. The advantage of giving up part of your program's time when you
  12416. can afford it is that any other running programs will be able to
  12417. make use of it, hence improving overall system performance.
  12418.  
  12419.    TVIdle
  12420.  
  12421. Name  : TypeIn               (Type In)
  12422. Class : Input
  12423. Level : Clone
  12424.  
  12425. This is an unusual routine which combines both output and input.
  12426. It sends a string to the keyboard buffer, where it acts as if it
  12427. had been typed in by someone. The string may be up to 15 key
  12428. codes in length (anything past 15 keys will be ignored, due to
  12429. the limited length of the keyboard buffer).
  12430.  
  12431. Normal keys can be put into the string simply as characters.
  12432. Extended keys, like Alt-key combinations, arrow keys, and
  12433. function keys, must be encoded as CHR$(0) + CHR$(ScanCode),
  12434. where the ScanCode is the key's scan code. You can look up such
  12435. scan codes in your BASIC manual or use GetKey to find out what
  12436. they are. Extended keys, although apparently taking up two
  12437. characters, only take up one space in the keyboard buffer. The
  12438. TypeIn routine allows for this fact.
  12439.  
  12440. Among other things, this routine can be used to provide default
  12441. answers to input routines, or to execute another program once
  12442. your program exits.
  12443.  
  12444.    TypeIn St$
  12445.  
  12446. St$     keys to be "typed" into the keyboard buffer
  12447.  
  12448. Name  : TypePrint            (Type Print)
  12449. Class : Display
  12450. Level : Clone
  12451.  
  12452. TypePrint displays a string as if it was being typed. The string
  12453. is displayed a character at a time, with a delay between each
  12454. character. You may choose one color to highlight the
  12455. just-displayed character and another color for the character to
  12456. turn after the delay is done.
  12457.  
  12458.    TypePrint St$, Row%, Column%, WaitTime%, TmpAttr%, _
  12459.       VAttr%, Fast%
  12460.  
  12461. St$        string to display
  12462. Row%       row at which to display string
  12463. Column%    column at which to display string
  12464. WaitTime%  delay between chars (milliseconds; 20-60 is decent)
  12465. TmpAttr%   color/attribute for just-displayed character
  12466. VAttr%     color/attribute for character after the delay is up
  12467. Fast%      whether to use fast displays (0 no)
  12468.  
  12469. Name  : UnCalcAttr           (Undo Calculated Attribute)
  12470. Class : Display
  12471. Level : Any
  12472.  
  12473. Many of the display routines in this library require an
  12474. "attribute" rather than foreground and background colors. An
  12475. attribute is a combination of the foreground and background
  12476. colors in a format which is used by all types of displays when
  12477. in text mode. The UnCalcAttr routine allows you to decode the
  12478. original colors given the attribute.
  12479.  
  12480. Foreground colors are usually specified as 0-31, with
  12481. backgrounds as 0-7. If you turn blinking off (see Blink), it may
  12482. be more convenient to express the same thing as foreground 0-15,
  12483. background 0-15. The CalcAttr routine will accept either way of
  12484. expressing it.
  12485.  
  12486. Note, however, that UnCalcAttr will always return the former
  12487. pair of results, since it has no way of knowing whether Blink
  12488. has been used (foreground 0-31, background 0-15). The below
  12489. routine shows how to get around this, if needed.
  12490.  
  12491.    UnCalcAttr Foreground%, Background%, VAttr%
  12492.    ' the following is optional and may not be desired...
  12493.    ' it converts colors to "no blink" equivalents (see above)
  12494.    IF Foreground% AND 16 THEN
  12495.       Foreground% = Foreground% - 16
  12496.       Background% = Background% + 8
  12497.    END IF
  12498.  
  12499. VAttr%        color "attribute"
  12500. -------
  12501. Foreground%   foreground color
  12502. Background%   background color
  12503.  
  12504. Name  : UnSCrunch            (Undo Screen Crunch)
  12505. Class : Display
  12506. Level : Any
  12507.  
  12508. This routine is designed to be used in conjunction with ScrRest
  12509. and the other routines which restore an entire 80x25 text screen
  12510. from an array. It expands screens that were compressed by
  12511. SCrunch to their full original size. The uncompression algorithm
  12512. is very fast and will not take any noticeable amount of time for
  12513. most purposes.
  12514.  
  12515. If your original screen was not 80x25 in size, use the
  12516. UnSCrunchSS routine instead.
  12517.  
  12518.    REDIM FullScreen%(1 TO 2000)
  12519.    DSeg% = VARSEG(FullScreen%(1))
  12520.    DOfs% = VARPTR(FullScreen%(1))
  12521.    UnSCrunch DSeg%, DOfs%, CSeg%, COfs%
  12522.  
  12523. DSeg%     segment of array in which to store expanded image
  12524. DOfs%     offset of array in which to store expanded image
  12525. CSeg%     segment of the compressed image
  12526. COfs%     offset of the compressed image
  12527.  
  12528. Name  : UnSCrunchSS          (Undo Screen Crunch Sized Screen)
  12529. Class : Display
  12530. Level : Any
  12531.  
  12532. This routine is designed to be used in conjunction with ScrRest
  12533. and the other routines which restore a text screen from an
  12534. array. It expands screens that were compressed by SCrunchSS or
  12535. SCrunch to their full original size. The uncompression algorithm
  12536. is very fast and will not take any noticeable amount of time for
  12537. most purposes.
  12538.  
  12539. If your original screen was 80x25 in size, you may find it
  12540. convenient to use the UnSCrunch routine instead.
  12541.  
  12542.    REDIM FullScreen%(1 TO Rows% * Cols%)
  12543.    DSeg% = VARSEG(FullScreen%(1))
  12544.    DOfs% = VARPTR(FullScreen%(1))
  12545.    UnSCrunchSS DSeg%, DOfs%, Rows%, Cols%, CSeg%, COfs%
  12546.  
  12547. DSeg%     segment of array in which to store expanded image
  12548. DOfs%     offset of array in which to store expanded image
  12549. Rows%     rows in image
  12550. Cols%     columns in image
  12551. CSeg%     segment of the compressed image
  12552. COfs%     offset of the compressed image
  12553.  
  12554. Name  : UnSplit              (Undo Split)
  12555. Class : Display
  12556. Level : Clone
  12557.  
  12558. This routine does the opposite of Split-- instead of clearing
  12559. the screen by scrolling it in different directions, it puts text
  12560. on the screen by scrolling it on from different locations. The
  12561. effect is quite stunning.
  12562.  
  12563. The information to place on the screen comes from an array that
  12564. you specify which contains a saved screen. Only 80x25 text modes
  12565. are supported. Any of the screen save routines (e.g., ScrSave)
  12566. may be used to load the array. In a typical case, you will use
  12567. this routine with screens that were created in advance and
  12568. stored to disk for use by your program.
  12569.  
  12570.    UnSplit Scrn%(), Fast%
  12571.  
  12572. Scrn%()   array containing the text to display
  12573. Fast%     whether to use fast mode (0 no)
  12574.  
  12575. Name  : Upcase               (Uppercase)
  12576. Class : String
  12577. Level : Any
  12578.  
  12579. This routine, like BASIC's UCASE$ function, converts a string to
  12580. uppercase. Since it doesn't have to create a new return string
  12581. (a fairly slow process), it's faster than the BASIC equivalent.
  12582.  
  12583. The Upcase routine is designed for the U.S. character set. If
  12584. your program is intended for distribution, you would be well
  12585. advised to use Upcase1 instead, as it supports international
  12586. character sets.
  12587.  
  12588.    Upcase St$
  12589.  
  12590. St$     string to be capitalized
  12591. -------
  12592. St$     capitalized string
  12593.  
  12594. Name  : Upcase1              (Uppercase)
  12595. Class : String
  12596. Level : DOS
  12597.  
  12598. This routine, like BASIC's UCASE$ function, converts a string to
  12599. uppercase. It converts letters in the extended character set as
  12600. well as the usual letters, making it well suited for text which
  12601. may not be in English.
  12602.  
  12603. Note that DOS 5.0 is required for optimal performance. With
  12604. older DOS versions, this routine makes assumptions about the
  12605. character set which may not be appropriate.
  12606.  
  12607.    Upcase1 St$
  12608.  
  12609. St$     string to be capitalized
  12610. -------
  12611. St$     capitalized string
  12612.  
  12613. Name  : UpcaseI%             (Uppercase Integer char)
  12614. Class : Numeric
  12615. Level : Any
  12616.  
  12617. This function converts a character to uppercase. Rather than
  12618. taking a string parameter, though, UpcaseI% works on an integer
  12619. which contains an ASCII code.
  12620.  
  12621. The UpcaseI% function is designed for the U.S. character set. If
  12622. your program is intended for distribution, you would be well
  12623. advised to use UpcaseI1% instead, as it supports international
  12624. character sets.
  12625.  
  12626.    CapCh% = UpcaseI%(Ch%)
  12627.  
  12628. Ch%      character to be capitalized
  12629. -------
  12630. CapCh%   capitalized character
  12631.  
  12632. Name  : UpcaseI1%            (Uppercase Integer char)
  12633. Class : Numeric
  12634. Level : DOS
  12635.  
  12636. This function converts a character to uppercase. Rather than
  12637. taking a string parameter, though, UpcaseI% works on an integer
  12638. which contains an ASCII code.
  12639.  
  12640. Note that DOS 5.0 is required for optimal performance. With
  12641. older DOS versions, this routine makes assumptions about the
  12642. character set which may not be appropriate.
  12643.  
  12644.    CapCh% = UpcaseI1%(Ch%)
  12645.  
  12646. Ch%      character to be capitalized
  12647. -------
  12648. CapCh%   capitalized character
  12649.  
  12650. Name  : UpdTVScreen          (Update TopView Screen)
  12651. Class : Display
  12652. Level : BIOS
  12653.  
  12654. UpdTVScreen tells a TopView-compatible multitasker to update the
  12655. screen using a specified screen buffer (use GetTVScreen to get
  12656. the buffer location). Some multitaskers will do this
  12657. automatically, but some won't. It's safe to use this routine
  12658. either way.
  12659.  
  12660. See also GetDView, GetTView, GetTVScreen.
  12661.  
  12662.    UpdTVScreen DSeg%, DOfs%
  12663.  
  12664. DSeg%       segment of screen buffer
  12665. DOfs%       offset of screen buffer
  12666.  
  12667. Name  : ValidSt%             (Valid String)
  12668. Class : String
  12669. Level : Any
  12670.  
  12671. This function is used for string validation. It lets you make
  12672. sure that a string contains only approved characters. If the
  12673. string contains any characters that aren't in the approved list,
  12674. 0 is returned; otherwise, -1 is returned.
  12675.  
  12676.    IsValid% = ValidSt%(St$, GoodCh$)
  12677.  
  12678. St$          string to validate
  12679. GoodCh$      characters which may be in the string
  12680. -------
  12681. IsValid%     whether the string is valid (0 no, -1 yes)
  12682.  
  12683. Name  : VerticalPrint        (Vertical Print)
  12684. Class : Display
  12685. Level : Clone
  12686.  
  12687. This routine displays a string in a column, from top to bottom,
  12688. rather than from left to right. Display handling is done in
  12689. BASIC, so all SCREEN modes work, and the cursor is updated
  12690. appropriately.
  12691.  
  12692.    VerticalPrint St$
  12693.  
  12694. St$       string to display
  12695.  
  12696. Name  : VGARest13            (VGA Restore for SCREEN 13)
  12697. Class : Display
  12698. Level : Clone
  12699.  
  12700. This routine allows you to restore a SCREEN 13 (VGA, 320x200,
  12701. 256 color) display that was saved using VGASave13 (see).
  12702.  
  12703.    VGARest13 DSeg%, DOfs%
  12704.  
  12705. DSeg%        segment of storage array, returned by VARSEG
  12706. DOfs%        offset  of storage array, returned by VARPTR
  12707.  
  12708. Name  : VGASave13            (VGA Save of SCREEN 13)
  12709. Class : Display
  12710. Level : Clone
  12711.  
  12712. This routine allows you to save a SCREEN 13 (VGA, 320x200, 256
  12713. color) display that can be restored using VGARest13 (see).
  12714.  
  12715. The array used to hold the screen must contain 64,000 bytes. For
  12716. an integer array, this means that you must create the array by
  12717. DIM Array%(1 TO 32000).
  12718.  
  12719.    VGASave13 DSeg%, DOfs%
  12720.  
  12721. DSeg%        segment of storage array, returned by VARSEG
  12722. DOfs%        offset  of storage array, returned by VARPTR
  12723.  
  12724. Name  : Weekday0             (Weekday)
  12725. Class : Time
  12726. Level : DOS
  12727.  
  12728. This routine tells you what the day of the week is, just the
  12729. thing for calendar programs and whatnot. The day is returned as
  12730. a number from 1-7, which identifies a day from Sunday through
  12731. Saturday.
  12732.  
  12733.    Weekday0 DayNr%
  12734.  
  12735. -------
  12736. DayNr%     current day
  12737.  
  12738. Name  : Weekday1             (Weekday)
  12739. Class : Time
  12740. Level : Any
  12741.  
  12742. This routine tells you the day of the week for any given date. A
  12743. shortcut is available if you just want the day of the week for
  12744. today's date-- use zero (or less) for the MonthNr% or DayNr%
  12745. values.
  12746.  
  12747.    Weekday1 MonthNr%, DayNr%, YearNr%, DayName$
  12748.  
  12749. MonthNr%     month number (1-12)
  12750. DayNr%       day number (1-31)
  12751. YearNr%      year number (1900 on)
  12752. -------
  12753. DayName$     day of the week (e.g., "Tuesday")
  12754.  
  12755. Name  : WinCheck             (Windows Check)
  12756. Class : Equipment
  12757. Level : BIOS
  12758.  
  12759. The WinCheck routine tells you what version of Microsoft Windows
  12760. is in use, if any. It returns the results as two integers
  12761. containing the major and minor version numbers. For instance,
  12762. Windows 3.0 would return a major number of 3, minor 0.
  12763. Windows/386 v2.x will be identified as 2.0. If Windows is not
  12764. running, 0.0 will be returned. NOTE that this routine is not
  12765. able to detect Windows 1.x versions!
  12766.  
  12767.    WinCheck MajorV%, MinorV%
  12768.  
  12769. -------
  12770. MajorV%   major part of the Windows version
  12771. MinorV%   minor part of the Windows version
  12772.  
  12773. Name  : WindowMan2           (Window Manager)
  12774. Class : Display
  12775. Level : Clone
  12776.  
  12777. This routine is identical to WindowManager but for the fact that
  12778. it allows you to design your own custom window frames. Please
  12779. see the description of WindowManager for general information.
  12780.  
  12781. These are the additional frame types:
  12782.     6   custom frame composed of a single character
  12783.     7   custom frame composed of the specified 7-character list:
  12784.         top left corner, top middle, top right corner,
  12785.         left middle, right middle,
  12786.         bottom left corner, bottom middle, bottom right corner
  12787.  
  12788.  /------------------------------------------------------------\
  12789.  | A custom frame like this would be defined as frame type 7, |
  12790.  | with a frame string of "/-\||\-/", for instance.           |
  12791.  \------------------------------------------------------------/
  12792.  
  12793.  *************************************************
  12794.  * On the other hand, a frame like this would be *
  12795.  * frame type 6, with a frame string of "*".     *
  12796.  *************************************************
  12797.  
  12798. Note that this routine differs from the ProBas equivalent in
  12799. that it supports full frame definitions through frame type 7.
  12800. Differences mentioned under WindowManager are also relevant.
  12801.  
  12802.    WindowMan2 TRow%, LCol%, BRow%, RCol%, Frame%, FSt$,
  12803.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  12804.  
  12805. TRow%       top row of window
  12806. LCol%       left column of window
  12807. BRow%       bottom row of window
  12808. RCol%       right column of window
  12809. Frame%      frame type (see above)
  12810. FSt$        frame definition string (see above)
  12811. Fore%       frame foreground color
  12812. Back%       frame background color
  12813. Grow%       window growing option (see above)
  12814. Shade%      window shadow option (see above)
  12815. TFore%      title foreground color
  12816. Title$      window title ("" if none)
  12817. Page%       display page (normally zero)
  12818. Fast%       whether to use fast mode (0 no)
  12819.  
  12820. Name  : WindowMan3           (Window Manager)
  12821. Class : Display
  12822. Level : Clone
  12823.  
  12824. This routine is identical in function to WindowManager. The
  12825. parameters are mostly passed as an array, however, instead of
  12826. one by one. Please see the description of WindowManager for
  12827. general information.
  12828.  
  12829.    WindowMan3 Parm%(), Title$
  12830.  
  12831. Parm%(1)    top row of window
  12832. Parm%(2)    left column of window
  12833. Parm%(3)    bottom row of window
  12834. Parm%(4)    right column of window
  12835. Parm%(5)    frame type (see above)
  12836. Parm%(6)    frame foreground color
  12837. Parm%(7)    frame background color
  12838. Parm%(8)    window growing option (see above)
  12839. Parm%(9)    window shadow option (see above)
  12840. Parm%(10)   title foreground color
  12841. Parm%(11)   display page (normally zero)
  12842. Parm%(12)   whether to use fast mode (0 no)
  12843. Title$      window title ("" if none)
  12844.  
  12845. Name  : WindowMan4           (Window Manager)
  12846. Class : Display
  12847. Level : Clone
  12848.  
  12849. This is an extremely cut-down version of WindowManager,
  12850. providing no more than a simple frame generator.
  12851.  
  12852. These are the available frame types:
  12853.     0   no frame
  12854.     1   single lines
  12855.     2   double lines
  12856.     3   single horizontal, double vertical lines
  12857.     4   double horizontal, single vertical lines
  12858.     5   block graphic lines
  12859.  
  12860.    WindowMan4 TRow%, LCol%, BRow%, RCol%, Frame%, VAttr%, _
  12861.       Page%, Fast%
  12862.  
  12863. TRow%       top row of window
  12864. LCol%       left column of window
  12865. BRow%       bottom row of window
  12866. RCol%       right column of window
  12867. Frame%      frame type (see above)
  12868. VAttr%      frame color/attribute (use CalcAttr)
  12869. Page%       display page (normally zero)
  12870. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  12871.  
  12872. Name  : WindowManager        (Window Manager)
  12873. Class : Display
  12874. Level : Clone
  12875.  
  12876. WindowManager displays a pop-up window according to your
  12877. specifications. The window may have any of a variety of frames,
  12878. a title, or a shadow, and it may appear instantly or "grow" onto
  12879. the screen. Only text mode is supported.
  12880.  
  12881. These are the available frame types:
  12882.     0   no frame
  12883.     1   single lines
  12884.     2   double lines
  12885.     3   single horizontal, double vertical lines
  12886.     4   double horizontal, single vertical lines
  12887.     5   block graphic lines
  12888.  
  12889. These are the available shadows:
  12890.    -3   transparent shadow on the right
  12891.    -2   transparent shadow on the left
  12892.    -1   solid black shadow on the left
  12893.     0   no shadow
  12894.    1+   shadow attribute (use CalcAttr) for a colored shadow
  12895.  
  12896. Options for growing windows are as follows:
  12897.    -1   grow as fast as possible
  12898.     0   pop onto the screen
  12899.    1+   grow with delay given in milliseconds (15 works for me)
  12900.  
  12901. Note that this routine is different from its ProBas equivalent
  12902. in a number of respects. The grow delay time is different.
  12903. Growing is done more smoothly. The shadow and title parameters
  12904. are not changed by this routine. A new frame type (5) was added.
  12905. If a title is too long, it is truncated instead of being ignored
  12906. completely. Using a -1 as the title foreground color will not
  12907. turn off the title; instead, use a null title string.
  12908.  
  12909.    WindowManager TRow%, LCol%, BRow%, RCol%, Frame%,
  12910.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  12911.  
  12912. TRow%       top row of window
  12913. LCol%       left column of window
  12914. BRow%       bottom row of window
  12915. RCol%       right column of window
  12916. Frame%      frame type (see above)
  12917. Fore%       frame foreground color
  12918. Back%       frame background color
  12919. Grow%       window growing option (see above)
  12920. Shade%      window shadow option (see above)
  12921. TFore%      title foreground color
  12922. Title$      window title ("" if none)
  12923. Page%       display page (normally zero)
  12924. Fast%       whether to use fast mode (0 no)
  12925.  
  12926. Name  : WriteBitF            (Write Bit Field)
  12927. Class : Numeric
  12928. Level : Any
  12929.  
  12930. This routine allows you to set an element of a virtual array.
  12931. The actual array can be any numeric type, as it is just being
  12932. used as a storage area. The virtual array is composed of numbers
  12933. of a bit length that you specify (1-8). This provides efficient
  12934. storage for numbers which have a limited range.
  12935.  
  12936. Here's how you DIM the actual array, assuming an integer array
  12937. is used:
  12938.    DIM Array%(1 TO (VirtElements * VirtBits + 15) \ 16)
  12939.  
  12940. "VirtElements" is the number of elements in the virtual array
  12941. and "VirtBits" is the number of bits per element.
  12942.  
  12943. See also ReadBitF.
  12944.  
  12945.    WriteBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  12946.  
  12947. DSeg%        segment of actual array
  12948. DOfs%        offset of actual array
  12949. ElementNr&   virtual element number (starts at 0)
  12950. BitLen%      bits per virtual element (1-8)
  12951. Value%       value to set element to (range depends on BitLen%)
  12952.  
  12953. Name  : Xlate                (Translate)
  12954. Class : String
  12955. Level : Any
  12956.  
  12957. The Xlate routine allows for translating a string, character by
  12958. character, very quickly. It uses a translation table that you
  12959. provide. This table is 256 bytes long, one byte for each
  12960. character in the ASCII table. The translation is done by
  12961. position-- for instance, if the original character was "A"
  12962. (ASCII 65), the translated character will be whatever is in the
  12963. translation table at position 66. Why 66, when "A" is 65?
  12964. Because ASCII runs from 0-255, but the translation string is
  12965. 1-256: everything is one higher in the string than the ASCII
  12966. character it represents.
  12967.  
  12968. Translation capabilities are handy in communications software.
  12969. They can also be used in other things. One simple use would be
  12970. to set up a translation table where all lowercase characters
  12971. would be converted to uppercase. You might ask why, since BASIC
  12972. has a UCASE$ function and PBClone has an Upcase routine. Well,
  12973. Upcase is faster than UCASE$, since it doesn't have to create a
  12974. return string; but Xlate would be even faster, since it
  12975. translates every character directly instead of deciding whether
  12976. it's a lowercase letter!
  12977.  
  12978. Simple encoding, WordStar file decryption, string reversal,
  12979. uppercase / lowercase conversion, and many other things can be
  12980. done with Xlate.
  12981.  
  12982. Remember to initialize all 256 characters in the translation
  12983. table!
  12984.  
  12985.    Xlate St$, XlateTable$
  12986.  
  12987. St$          string to translate
  12988. XlateTable$  translation table
  12989. -------
  12990. St$          translated string
  12991.  
  12992. Name  : XMPrint              (Translate and MS-DOS Print)
  12993. Class : Display
  12994. Level : DOS
  12995.  
  12996. A combination of the Xlate and DMPrint routines, this 'un allows
  12997. you to display using DOS services while being able to translate
  12998. or screen out characters. Each character of the string to
  12999. display is passed through a translation table you provide (256
  13000. bytes, where each position corresponds directly to the ASCII
  13001. code of the same number [0-255]). If the result is 0, the
  13002. character is not displayed. Otherwise, the translated character
  13003. is displayed using DOS display services. The new cursor position
  13004. is returned so you can inform BASIC about it.
  13005.  
  13006. Note that the new cursor position may not be accurate! Some ANSI
  13007. drivers do not update the BIOS cursor position info, in which
  13008. case the results won't be useful. That's a hazard of using DOS
  13009. output.
  13010.  
  13011.    XMPrint St$, XlateTable$, Row%, Column%
  13012.    LOCATE Row%, Column%
  13013.  
  13014. St$          string to display
  13015. XlateTable$  translation table
  13016. -------
  13017. Row%         current row
  13018. Column%      current column
  13019.  
  13020. Name  : XorSt                (XOR String)
  13021. Class : String
  13022. Level : Any
  13023.  
  13024. This routine XORs each byte in one string with the corresponding
  13025. byte in a second string. The strings must be the same length.
  13026.  
  13027.    XorSt St1$, St2$
  13028.  
  13029. St1$      string to XOR
  13030. St2$      string to XOR with
  13031. -------
  13032. St1$      result
  13033.  
  13034. Name  : XQPrint              (Extended Quick Print)
  13035. Class : Display
  13036. Level : Clone
  13037.  
  13038. This routine provides a rather crude, but very fast, display
  13039. capability. It works like the PRINT statement in BASIC, except
  13040. that it doesn't move the cursor or process control codes. It
  13041. works only in text modes.
  13042.  
  13043. See also QPrint, a slightly less flexible (but even faster)
  13044. routine.
  13045.  
  13046. The results of this routine are not redirectable by DOS.
  13047.  
  13048.    XQPrint St$, Row%, Column%, VAttr%, Page%, Fast%
  13049.  
  13050. St$       string to display
  13051. Row%      starting row
  13052. Column%   starting column
  13053. VAttr%    color/attribute (see CalcAttr)
  13054. Page%     display page (unused on MDA/Herc; normally 0)
  13055. Fast%     whether to use fast mode (0 no)
  13056.  
  13057. Name  : XQPrintOver          (Extended Quick Print Overwrite)
  13058. Class : Display
  13059. Level : Clone
  13060.  
  13061. This routine provides a rather crude, but very fast, display
  13062. capability. It works like the PRINT statement in BASIC, except
  13063. that it doesn't move the cursor or process control codes. It
  13064. works only in text modes.
  13065.  
  13066. This is a slightly unusual variant on a print routine. It
  13067. displays all characters except spaces. If your string contains a
  13068. space, that position on the screen will be skipped. In other
  13069. words, it acts kind of like an overlay. This can be handy when
  13070. you have text in alternating colors.
  13071.  
  13072. I came up with this routine when I designed a program with a
  13073. function key display at the bottom of the screen-- the names of
  13074. the function keys were one color and the associated definitions
  13075. were another color. It was obvious that the easiest way of
  13076. handling that would be to use an "overlay" approach. The
  13077. function key definitions were laid down with XQPrint. I then
  13078. overlaid the line with the function key names in a different
  13079. color, using XQPrintOver.
  13080.  
  13081. If you need a "solid" space, rather than a "transparent" space,
  13082. use CHR$(255) instead of CHR$(32).
  13083.  
  13084. The results of this routine are not redirectable by DOS.
  13085.  
  13086.    XQPrintOver St$, Row%, Column%, VAttr%, Page%, Fast%
  13087.  
  13088. St$       string to display
  13089. Row%      starting row
  13090. Column%   starting column
  13091. VAttr%    color/attribute (see CalcAttr)
  13092. Page%     display page (unused on MDA/Herc; normally 0)
  13093. Fast%     whether to use fast mode (0 no)
  13094.  
  13095.