home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / pbc22a.zip / PBCLONE.MAN < prev    next >
Text File  |  1993-04-26  |  430KB  |  13,096 lines

  1.        PBClone 2.2  (c) 1990-1993  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
  10. value).  If there was a numeric overflow at any point in the
  11. operation, 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
  29. negative value).  If there was a numeric overflow at any point
  30. in the 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)
  47. routine at boot time.  This does not tell you how much extended
  48. memory is actually available, since extended memory may be
  49. carved up by users of BIOS-level extended memory or XMS memory,
  50. converted to expanded memory, etc.  It only tells you the
  51. amount of physical 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,
  66. such as INKEY$ or the CheckKey and GetKey routines.  Given the
  67. ASCII code and scan code of a key, AltKey returns the
  68. associated key letter, if any.  For instance, it returns "A" if
  69. you pass it ASCII code 0 and scan code 30, because those codes
  70. represent 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
  84. corresponding byte in a second string.  The strings must be the
  85. same length.
  86.  
  87.    AndSt St1$, St2$
  88.  
  89. St1$      string to AND
  90. St2$      string to AND with
  91. -------
  92. St1$      result
  93.  
  94. Name  : Any2Dec              (Any to Decimal)
  95. Class : Numeric
  96. Level : Any
  97.  
  98. This routine converts a number in any base to a normal (base
  99. 10) integer.  It works like the &H and &O prefixes in BASIC,
  100. but rather than working only in hexadecimal (base 16) and octal
  101. (base 8), it can be used for binary, octal, or almost anything
  102. else.  The base may range from 2-35.
  103.  
  104. The input number may be in either signed or unsigned integer
  105. form, and will be converted to a signed integer.  For example,
  106. the base 16 (hexadecimal) number FFFF would be converted to -1,
  107. as would the base 10 (decimal) number 65535.  This may not seem
  108. to make sense if you're not familiar with the internal format
  109. for integers, but is the standard approach to converting
  110. unsigned numbers (0-65535) to signed numbers (-32768 to 32767).
  111. BASIC always uses signed integers, so the numbers will always
  112. be what you expect so long as they are kept in the range -32768
  113. to 32767.  They "wrap around" for 32768 to 65535.
  114.  
  115. The most common bases used on computers are base 2 (binary),
  116. base 8 (octal), base 10 (decimal), and base 16 (hexadecimal).
  117.  
  118.    Any2Dec Number$, NrBase%, DecNr%, ErrCode%
  119.  
  120. Number$   any-base number to convert to an integer
  121. NrBase%   number base to convert from
  122. -------
  123. DecNr%    resulting integer
  124. ErrCode%  error code: 0 if no error
  125.  
  126. Name  : AscI%                (ASC Integer)
  127. Class : String
  128. Level : Any
  129.  
  130. This is a replacement for the ASC function provided by BASIC.
  131. It is smaller than ASC, however, and also somewhat faster.
  132.  
  133. Unlike BASIC or ProBas, the PBClone AscI function returns -1 as
  134. an error condition if you try to use it on a null string.  This
  135. convention owes its origin to the similar routine in Crescent's
  136. libraries.
  137.  
  138. See also AscM%, which returns the ASCII code of a character at
  139. a specific location within a string.
  140.  
  141.    Value% = AscI%(St$)
  142.  
  143. St$        string for which to return ASCII code
  144. -------
  145. Value%     code of the first string char or -1 if null string
  146.  
  147. Name  : AscM%                (ASC MID$)
  148. Class : String
  149. Level : Any
  150.  
  151. This function works like a combination of the BASIC functions
  152. ASC and MID$.  It returns the ASCII code of a character at a
  153. specified position in a string.  If the specified position is
  154. outside the string, -1 will be returned.
  155.  
  156. See also AscI%, which returns the ASCII code of the character
  157. at the beginning of a string.
  158.  
  159.    Value% = AscM%(St$, Posn%)
  160.  
  161. St$        string to examine
  162. Posn%      character position to examine
  163. -------
  164. Value%     code of the specified character or -1 if error
  165.  
  166. Name  : BarMenu              (Bar Menu)
  167. Class : Input
  168. Level : Clone
  169.  
  170. This is a bar menu routine.  It allows the user to select one
  171. of a list of items given on a single menu row or "bar".  The
  172. current item is highlighted in your choice of colors; user
  173. selection can be done either by moving this highlight and
  174. pressing return or by entering the letter associated with the
  175. desired item.  Only text mode is supported.
  176.  
  177. The highlight may be moved with the left and right arrow keys,
  178. tab and backtab, or space and backspace.  Selection is done
  179. with <CR>, the enter key.
  180.  
  181. The letter used to select an item is the first character of the
  182. item that is not lowercase or a space.  If the item is all
  183. lowercase, the first character of the item will be used.  For
  184. example, suppose you want the user to select one of "list" or
  185. "log".  By passing the options to BarMenu as "List" and "lOg",
  186. you allow the user to press "L" for "List" and "O" for "lOg".
  187.  
  188. The user's choice will be returned to you as a number, with the
  189. first choice being numbered 1.  If <ESC> was pressed, 0 will be
  190. returned.
  191.  
  192.    BarMenu Pick$(), Row%, LCol%, RCol%, VAttr%, HiAttr%, Prompt$
  193.  
  194. Pick$()       list of items to choose from
  195. Row%          row on which to display the bar
  196. LCol%         leftmost column of the bar
  197. RCol%         rightmost column of the bar (use -1 for autosize)
  198. VAttr%        bar color/attribute (see CalcAttr)
  199. HiAttr%       bar highlight color/attribute (see CalcAttr)
  200. Prompt$       prompt text (displayed at left side of the bar)
  201. -------
  202. Row%          # of the chosen item (1-items, or 0 if <ESC>)
  203.  
  204. Name  : BarMenuM             (Bar Menu with Mouse)
  205. Class : Input, Mouse
  206. Level : Clone
  207.  
  208. This is a bar menu routine.  It functions just like BarMenu,
  209. but supports the use of a mouse as well as the keyboard.  Make
  210. sure the mouse cursor is visible before calling this routine!
  211.  
  212.    BarMenuM PickList$(), Row%, LeftCol%, RightCol%, VAttr%, _
  213.       HiAttr%, Prompt$, Mouse%, ShowCursor%
  214.  
  215. PickList$()   list of items to choose from
  216. Row%          row on which to display the bar
  217. LeftCol%      leftmost column of the bar
  218. RightCol%     rightmost column of the bar (use -1 for auto-sizing)
  219. VAttr%        bar color/attribute (see CalcAttr)
  220. HiAttr%       bar highlight color/attribute (see CalcAttr)
  221. Prompt$       prompt text (displayed at the left side of the bar)
  222. Mouse%        whether a mouse is available (0 no)
  223. ShowCursor%   not used
  224. -------
  225. Row%          number of the chosen item (1-items, or 0 if <ESC>)
  226.  
  227. Name  : Bickel               (Bickel comparison)
  228. Class : String
  229. Level : Any
  230.  
  231. A string comparison routine, Bickel allows you to see how
  232. closely two strings match.  The better the match, the larger
  233. the returned value will be.  Since there is no constant minimum
  234. or maximum value, this routine is best used for applications
  235. involving dictionary searches.  You would scan the dictionary
  236. and make a list of the best matches.  This is appropriate for a
  237. spelling checker, for instance.
  238.  
  239. See also Bickel2%, the function version of this routine.
  240.  
  241.    Bickel St1$, St2$, Result%
  242.  
  243. St1$      first string to compare
  244. St2$      second string to compare
  245. -------
  246. Result%   resulting "match magnitude" value
  247.  
  248. Name  : Bickel2%             (Bickel comparison)
  249. Class : String
  250. Level : Any
  251.  
  252. A string comparison function, Bickel2% allows you to see how
  253. closely two strings match.  The better the match, the larger
  254. the returned value will be.  Since there is no constant minimum
  255. or maximum value, this routine is best used for applications
  256. involving dictionary searches.  You would scan the dictionary
  257. and make a list of the best matches.  This is appropriate for a
  258. spelling checker, for instance.
  259.  
  260. See also Bickel, the subprogram version of this routine.
  261.  
  262.    Result% = Bickel2%(St1$, St2$)
  263.  
  264. St1$      first string to compare
  265. St2$      second string to compare
  266. -------
  267. Result%   resulting "match magnitude" value
  268.  
  269. Name  : BigPrint             (Big Print)
  270. Class : Display
  271. Level : BIOS
  272.  
  273. As the name suggests, this routine displays text in large
  274. characters.  How large?  Eight times as high and as wide as
  275. normal!  Each "big character" will be composed of many
  276. normal-sized characters.  You may choose the normal character
  277. used to create the big characters (the default is a CHR$(219)
  278. solid block character, if you pass a null string here).
  279.  
  280. You should avoid using CHR$(128) to CHR$(255) when in either of
  281. the CGA graphics modes, as many CGAs are unable to display
  282. these characters when in graphics mode.
  283.  
  284.    BigPrint St$, FormCh$, Row%, Column%, VAttr%
  285.  
  286. St$       string to display in big characters
  287. FormCh$   character used to compose the big characters
  288. Row%      starting row
  289. Column%   starting column
  290. VAttr%    color/attribute of big characters (see CalcAttr)
  291.  
  292. Name  : BinSeekD             (Binary Seek Double precision)
  293. Class : Array management
  294. Level : Any
  295.  
  296. This routine uses binary search techniques to locate a specific
  297. number in a sorted double-precision array.  Each number in the
  298. array must be unique (no duplicates) for this to work.  This is
  299. a very, very fast routine and is especially handy for look-up
  300. tables.
  301.  
  302. The array is expected to begin at element 1.  You may specify
  303. the maximum element to search, allowing use of only part of an
  304. array.
  305.  
  306. A single number is returned in Posn%.  If Posn% is greater than
  307. zero, the target number was found and Posn% is the position in
  308. the array where it was found.  If Posn% is negative, the target
  309. number was not found, but it could be inserted into the array
  310. at the -Posn% element.  If the number is zero, the target
  311. number was not found and there is no room in the array to add
  312. any more values.
  313.  
  314.    BinSeekD Array#(), Elements%, Target#, Posn%
  315.  
  316. Array#()    array of sorted, unique values to search
  317. Elements%   maximum array element to search
  318. Target#     value to look for
  319. -------
  320. Posn%       whether and where the target was found (see above)
  321.  
  322. Name  : BinSeekI             (Binary Seek Integer)
  323. Class : Array management
  324. Level : Any
  325.  
  326. This routine uses binary search techniques to locate a specific
  327. number in a sorted integer array.  Each number in the array
  328. must be unique (no duplicates) for this to work.  This is a
  329. very, very fast routine and is especially handy for look-up
  330. tables.
  331.  
  332. The array is expected to begin at element 1.  You may specify
  333. the maximum element to search, allowing use of only part of an
  334. array.
  335.  
  336. A single number is returned in Posn%.  If Posn% is greater than
  337. zero, the target number was found and Posn% is the position in
  338. the array where it was found.  If Posn% is negative, the target
  339. number was not found, but it could be inserted into the array
  340. at the -Posn% element.  If the number is zero, the target
  341. number was not found and there is no room in the array to add
  342. any more values.
  343.  
  344.    BinSeekI Array%(), Elements%, Target%, Posn%
  345.  
  346. Array%()    array of sorted, unique values to search
  347. Elements%   maximum array element to search
  348. Target%     value to look for
  349. -------
  350. Posn%       whether and where the target was found (see above)
  351.  
  352. Name  : BinSeekL             (Binary Seek Long integer)
  353. Class : Array management
  354. Level : Any
  355.  
  356. This routine uses binary search techniques to locate a specific
  357. number in a sorted long integer array.  Each number in the
  358. array must be unique (no duplicates) for this to work.  This is
  359. a very, very fast routine and is especially handy for look-up
  360. tables.
  361.  
  362. The array is expected to begin at element 1.  You may specify
  363. the maximum element to search, allowing use of only part of an
  364. array.
  365.  
  366. A single number is returned in Posn%.  If Posn% is greater than
  367. zero, the target number was found and Posn% is the position in
  368. the array where it was found.  If Posn% is negative, the target
  369. number was not found, but it could be inserted into the array
  370. at the -Posn% element.  If the number is zero, the target
  371. number was not found and there is no room in the array to add
  372. any more values.
  373.  
  374.    BinSeekL Array&(), Elements%, Target&, Posn%
  375.  
  376. Array&()    array of sorted, unique values to search
  377. Elements%   maximum array element to search
  378. Target&     value to look for
  379. -------
  380. Posn%       whether and where the target was found (see above)
  381.  
  382. Name  : BinSeekS             (Binary Seek Single precision)
  383. Class : Array management
  384. Level : Any
  385.  
  386. This routine uses binary search techniques to locate a specific
  387. number in a sorted single-precision array.  Each number in the
  388. array must be unique (no duplicates) for this to work.  This is
  389. a very, very fast routine and is especially handy for look-up
  390. tables.
  391.  
  392. The array is expected to begin at element 1.  You may specify
  393. the maximum element to search, allowing use of only part of an
  394. array.
  395.  
  396. A single number is returned in Posn%.  If Posn% is greater than
  397. zero, the target number was found and Posn% is the position in
  398. the array where it was found.  If Posn% is negative, the target
  399. number was not found, but it could be inserted into the array
  400. at the -Posn% element.  If the number is zero, the target
  401. number was not found and there is no room in the array to add
  402. any more values.
  403.  
  404.    BinSeekS Array!(), Elements%, Target!, Posn%
  405.  
  406. Array!()    array of sorted, unique values to search
  407. Elements%   maximum array element to search
  408. Target!     value to look for
  409. -------
  410. Posn%       whether and where the target was found (see above)
  411.  
  412. Name  : BinSeekSt            (Binary Seek String)
  413. Class : Array management
  414. Level : Any
  415.  
  416. This routine uses binary search techniques to locate a specific
  417. string in a sorted string array.  Each string in the array must
  418. be unique (no duplicates) for this to work.  This is a very,
  419. very fast routine and is especially handy for look-up tables.
  420.  
  421. The string array is expected to begin at element 1.  You may
  422. specify the maximum element to search, allowing use of only
  423. part of an array.  You must specify whether capitalization
  424. matters-- set CapsCount% to 0 if it doesn't.
  425.  
  426. A single number is returned in Posn%.  If the number is greater
  427. than zero, the target string was found, and the number is the
  428. position in the array where it was found.  If the number is
  429. negative, the target string was not found, but it could be
  430. inserted into the array at the -Posn% element.  If the number
  431. is zero, the target string was not found and there is no room
  432. in the array to add any more values.
  433.  
  434.    BinSeekSt Array$(), Elements%, Target$, CapsCount%, Posn%
  435.  
  436. Array$()    array of sorted, unique values to search
  437. Elements%   maximum array element to search
  438. Target$     string to look for
  439. CapsCount%  0 if capitalization doesn't matter
  440. -------
  441. Posn%       whether and where the target was found (see above)
  442.  
  443. Name  : BIOSInkey            (BIOS INKEY$)
  444. Class : Input
  445. Level : BIOS
  446.  
  447. BIOSInkey works like INKEY$, but it gets its key directly by
  448. asking the BIOS. The primary advantage of this is that you get
  449. the "scan" code as well as the ASCII code of the key.  The scan
  450. code is independent of the shift status-- for instance, the
  451. scan code for "A" is the same as the scan code for "a" or
  452. Control-A or Alt-A.  This can be very handy.
  453.  
  454. If there is no key available, both the scan code and ASCII code
  455. will be zero.
  456.  
  457.    BIOSInkey AscCode%, ScanCode%
  458.  
  459. -------
  460. AscCode%    ASCII code of the key, if any
  461. ScanCode%   scan code of the key, if any
  462.  
  463. Name  : BkScroll             (Backward Scroll)
  464. Class : Display
  465. Level : BIOS
  466.  
  467. This routine scrolls any selected part of the display down-- it
  468. does a backwards scroll.  You may scroll as many times as you
  469. like, or scroll "zero" times to totally clear the selected part
  470. of the display.
  471.  
  472. Note that BIOS-level scrolling can cause the screen to flicker
  473. on some CGAs due to a combination of unfortunate design factors.
  474.  
  475.    BkScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  476.  
  477. TopRow%      top row of the area to scroll
  478. LeftCol%     left column of the area to scroll
  479. BottomRow%   top row of the area to scroll
  480. RightCol%    left column of the area to scroll
  481. Times%       number of times (or rows) to scroll
  482.  
  483. Name  : BkSpace              (Backspace)
  484. Class : Display
  485. Level : BIOS
  486.  
  487. Although CHR$(8) is supposed to mean "backspace", it shows up
  488. as a graphics character when BASIC prints it.  This routine
  489. does an actual backspace with full wrap-- if it's at the
  490. beginning of the line, it will move back to the previous line
  491. (if there is one).  It backspaces destructively (erasing the
  492. previous character) from the current cursor position.  The new
  493. cursor is returned to you, since QuickBASIC may ignore the new
  494. status.
  495.  
  496.    BkSpace Row%, Column%       ' do the backspace
  497.    LOCATE Row%, Column%        ' inform QuickBASIC
  498.  
  499. -------
  500. Row%      new row
  501. Column%   new column
  502.  
  503. Name  : Blink                (Blink toggle)
  504. Class : Display
  505. Level : BIOS / Clone (see text)
  506.  
  507. It is possible to make characters in text mode blink by giving
  508. them an appropriate "color".  I wouldn't mention something so
  509. obvious but for another possibility which is less widely known:
  510. blinking can be turned off, in which case the characters that
  511. would have otherwise blinked will instead have a bright
  512. background.  In other words, turn off blinking, and you double
  513. the possible number of background colors.
  514.  
  515. This technique will always work with EGA and VGA displays.  It
  516. can also be used with MDA/Hercules and CGA displays, on which
  517. it will almost always work... unfortunately, on some
  518. less-than-perfect PC clones, it will cause the computer to lock
  519. up instead.  So, be careful with this one!
  520.  
  521.    Blink SetBlink%
  522.  
  523. SetBlink%    use blink (-1) or intense backgrounds (0)
  524.  
  525. Name  : BlockMove            (Block memory Move)
  526. Class : Memory
  527. Level : Clone
  528.  
  529. This routine allows you to copy or "move" a block of data from
  530. one memory location to another.  It isn't very bright, so if
  531. the memory areas overlap, you will have to tell the routine to
  532. "move backwards" instead of forwards. In that case, you will
  533. also have to change the offsets to point to the ends of the
  534. memory areas instead of the beginnings.
  535.  
  536. Normally, you can use forward moves.  In that case, the offsets
  537. you specify are those of the beginning of the memory areas.  If
  538. backward moves are required, the offsets specified are those of
  539. the end of the memory areas.
  540.  
  541. If you are familiar with assembly language, you may recognize
  542. this as a straightforward implementation of the "REP MOVSB"
  543. instruction.
  544.  
  545. You may move up to 65,520 bytes at a time, provided that the
  546. addresses are in normalized form (if you don't know what this
  547. means, you probably don't need to worry about it).
  548.  
  549. This routine can be used to copy information to an array from
  550. any area of memory (the BIOS data area, the screen, another
  551. array, etc), or vice versa. It can also be used to do things
  552. like insert/delete elements from an array, scroll the screen,
  553. fill the screen with a specified character, and so on.
  554.  
  555.    BlockMove FromSeg%, FromOfs%, ToSeg%, ToOfs%, Bytes&, Dirn%
  556.  
  557. FromSeg%    segment of the area from which to copy
  558. FromOfs%    offset of the area from which to copy
  559. ToSeg%      segment of the area to which to copy
  560. ToOfs%      offset of the area to which to copy
  561. Bytes&      number of bytes to copy (0-65,520)
  562. Dirn%       direction to copy (0 if forward, else backward)
  563.  
  564. Name  : BootDrive            (get Boot Drive)
  565. Class : Disk
  566. Level : DOS
  567.  
  568. This routine tells you which drive was used to boot the
  569. system.  See also BootDrive2, a function version of this
  570. routine.
  571.  
  572. One use for BootDrive would be in installation programs, to
  573. determine the most likely destination drive for your software.
  574.  
  575.    Drive$ = "x"
  576.    BootDrive Drive$
  577.  
  578. -------
  579. Drive$   boot drive-- set it to at least one char beforehand!
  580.  
  581. Name  : BootDrive2$          (get Boot Drive)
  582. Class : Disk
  583. Level : DOS
  584.  
  585. This routine tells you which drive was used to boot the system.
  586.  
  587. One use for BootDrive2 would be in installation programs, to
  588. determine the most likely destination drive for your software.
  589.  
  590.    Drive$ = BootDrive2$
  591.  
  592. -------
  593. Drive$   boot drive (null if wrong DOS version)
  594.  
  595. Name  : BoxMenu              (Box Menu)
  596. Class : Input
  597. Level : Clone
  598.  
  599. This routine displays a list of items you pass it as a string
  600. array.  The list is displayed in a window in a single column.
  601. If there are more items than will fit in the window, the items
  602. may be scrolled as necessary.  The user may pick a single item
  603. from the list.
  604.  
  605. Many of the usual WindowManager parameters are used here-- top
  606. row, left column, and bottom row (right column is calculated
  607. for you), window frame color and frame type, growth, shadow,
  608. title string and title color-- see the WindowManager routine
  609. for details.
  610.  
  611. If you allow using the mouse, be sure the mouse is initialized
  612. (MMCheck or MMCheck2%) and the mouse cursor is visible
  613. (MMCursorOn) before calling this routine.
  614.  
  615. This routine automatically saves and restores the underlying
  616. screen.
  617.  
  618. See CalcAttr if you're not familiar with color/attributes.  See
  619. also BoxMenu1 if you need to allow multiple selections.
  620.  
  621.    BoxMenu Mouse%, PickList$(), TopRow%, LeftCol%, _
  622.       BottomRow%, Frame%, FrameAttr%, ItemListAttr%, _
  623.       HiliteAttr%, TitleFore%, Title$, Grow%, Shade%, Result%
  624.  
  625. Mouse%          whether to support the mouse (0 no, -1 yes)
  626. PickList$()     items to pick from (starting at PickList$(1))
  627. TopRow%         top row of pick window
  628. LeftCol%        left column of pick window
  629. BottomRow%      bottom row of pick window
  630. Frame%          frame type
  631. FrameAttr%      frame color/attribute
  632. ItemListAttr%   item list color/attribute
  633. HiliteAttr%     highlight bar color/attribute
  634. TitleFore%      title foreground color (backgnd is frame color)
  635. Title$          title (use "" for no title)
  636. Grow%           window growth
  637. Shade%          window shadow
  638. -------
  639. Result%         number of item picked (0 if none)
  640.  
  641. Name  : BoxMenu1             (Box Menu variant 1)
  642. Class : Input
  643. Level : Clone
  644.  
  645. This routine displays a list of items you pass it as a string
  646. array.  The list is displayed in a window in a single column.
  647. If there are more items than will fit in the window, the items
  648. may be scrolled as necessary.  The user may pick multiple items
  649. from the list, using the space bar to toggle selection.  All
  650. items may be selected with Ctrl-Enter, or deselected with
  651. Ctrl-Backspace.
  652.  
  653. Many of the usual WindowManager parameters are used here-- top
  654. row, left column, and bottom row (right column is calculated
  655. for you), window frame color and frame type, growth, shadow,
  656. title string and title color-- see the WindowManager routine
  657. for details.
  658.  
  659. If you allow using the mouse, be sure the mouse is initialized
  660. (MMCheck or MMCheck2%) and the mouse cursor is visible
  661. (MMCursorOn) before calling this routine.
  662.  
  663. BoxMenu1 automatically saves and restores the underlying screen.
  664.  
  665. See CalcAttr if you're not familiar with color/attributes.  See
  666. also BoxMenu if you only need single-item selection.
  667.  
  668. You must pass an integer array corresponding to the pick list
  669. array.  Each of the integers flags whether the corresponding
  670. item is picked-- 0 if no, -1 if yes.  You may initialize this
  671. array according to the selection defaults you prefer.
  672.  
  673. The Marker$ value is two characters which specify the left and
  674. right characters to use to mark an item as selected.  If you
  675. leave Marker$ = "", the default will be "<>".
  676.  
  677.    BoxMenu1 Mouse%, PickList$(), Picked%(), Marker$, TopRow%, _
  678.       LeftCol%, BottomRow%, Frame%, FrameAttr%, _
  679.       ItemListAttr%, HiliteAttr%, TitleFore%, Title$, Grow%, _
  680.       Shade%, Picks%
  681.  
  682. Mouse%          whether to support the mouse (0 no, -1 yes)
  683. PickList$()     items to pick from (starting at PickList$(1))
  684. Picked%()       if corresponding PickList$() item is picked
  685. Marker$         left and right pick markers ("" for default)
  686. TopRow%         top row of pick window
  687. LeftCol%        left column of pick window
  688. BottomRow%      bottom row of pick window
  689. Frame%          frame type
  690. FrameAttr%      frame color/attribute
  691. ItemListAttr%   item list color/attribute
  692. HiliteAttr%     highlight bar color/attribute
  693. TitleFore%      title foreground color (backgnd is frame color)
  694. Title$          title (use "" for no title)
  695. Grow%           window growth
  696. Shade%          window shadow
  697. -------
  698. Picked%()       if corresponding PickList$() item is picked
  699. Picks%          number of items picked (0 if none)
  700.  
  701. Name  : BRead                (Byte Read)
  702. Class : Disk
  703. Level : DOS
  704.  
  705. This routine reads a byte from a file into an integer.  The
  706. byte is zero-extended into the integer, providing a value that
  707. may range from 0-255.
  708.  
  709. The file must have been opened using FCreate or FOpen1.
  710.  
  711.    BRead Handle%, Value%, ErrCode%
  712.  
  713. Handle%    file handle
  714. -------
  715. Value%     byte read from file
  716. ErrCode%   DOS error code (0 if no error)
  717.  
  718. Name  : BreakCheck%          (Break key Check)
  719. Class : Input
  720. Level : BIOS
  721.  
  722. This routine is for use after BreakOff.  It allows you to see
  723. whether the Break key has been pressed since you last checked.
  724. The Break status is cleared after the value is returned.
  725.  
  726.    Brk% = BreakCheck%
  727.    IF Brk% THEN
  728.       PRINT "** Break key pressed **"
  729.       GOTO EndProgram
  730.    END IF
  731.  
  732. -------
  733. Brk%    whether Break was pressed (0 no, -1 yes)
  734.  
  735. Name  : BreakOff             (Break key Off)
  736. Class : Input
  737. Level : BIOS
  738.  
  739. This routine disables the Break key.  It is not effective in
  740. the QB or QBX environments, as these use their own keyboard
  741. handler.  It is also not effective if your program was compiled
  742. with Debugging on (/D switch).
  743.  
  744. Note that BreakOff installs a routine to intercept some
  745. interrupt vectors. You MUST use the BreakOffDone routine to
  746. reverse this process before your program ends, or the computer
  747. will be left in an indeterminate state and will probably crash
  748. the next time Break is pressed!
  749.  
  750.    BreakOff
  751.  
  752. Name  : BreakOffDone         (Break key Off routine Done)
  753. Class : Input
  754. Level : BIOS
  755.  
  756. This routine is used after BreakOff to restore the original
  757. interrupt vectors.  If you use BreakOff, you MUST call
  758. BreakOffDone before your program ends!  Otherwise, the computer
  759. will probably crash the next time someone presses Break.
  760.  
  761.    BreakOffDone
  762.  
  763. Name  : BSq                  (Blank Squeeze)
  764. Class : String
  765. Level : Any
  766.  
  767. A simple compression routine, BSq "squeezes" the blank spaces
  768. in a string. It is designed expressly for use with text data.
  769. The text may not contain more than 131 spaces in a row, or
  770. CHR$(128) through CHR$(255), which are used in the compression.
  771.  
  772. Average text files are liable to be compressed by around 16%.
  773. Files that contain more spaces, such as structured programs,
  774. will benefit more.  The compression algorithm is simple but
  775. extremely fast, adding no noticeable overhead to string
  776. processing.
  777.  
  778. See also BUsq, BUsqLen.
  779.  
  780.    BSq St$, StLen%
  781.    St$ = LEFT$(St$, StLen%)
  782.  
  783. St$     string to compress
  784. -------
  785. St$     compressed string
  786. StLen%  length of the compressed string
  787.  
  788. Name  : BUsq                 (Blank Unsqueeze)
  789. Class : String
  790. Level : Any
  791.  
  792. This routine is used to uncompress strings that were processed
  793. by BSq. Before uncompression, the BUsqLen routine must be used
  794. to find out how long the resulting string will be.
  795.  
  796. See also BSq, BUsqLen.
  797.  
  798.    BUsqLen St$, StLen%
  799.    IF StLen% < 0 THEN
  800.       PRINT "Error in compressed string"
  801.    ELSE
  802.       Result$ = SPACE$(StLen%)
  803.       BUsq St$, Result$
  804.    END IF
  805.  
  806. St$      string to uncompress
  807. -------
  808. Result$  uncompressed string
  809.  
  810. Name  : BUsqLen              (Blank Unsqueeze Length)
  811. Class : String
  812. Level : Any
  813.  
  814. This routine is used in coordination with BUsq to uncompress
  815. strings that were processed by BSq.  It determines what the
  816. length of the uncompressed string will be, which is necessary
  817. to initialize the string for BUsq.
  818.  
  819. See also BSq, BUsq.
  820.  
  821.    BUsqLen St$, StLen%
  822.    IF StLen% < 0 THEN
  823.       PRINT "Error in compressed string"
  824.    ELSE
  825.       Result$ = SPACE$(StLen%)
  826.       BUsq St$, Result$
  827.    END IF
  828.  
  829. St$      string to uncompress
  830. -------
  831. StLen%   length of the uncompressed string
  832.  
  833. Name  : BWrite               (Byte Write)
  834. Class : Disk
  835. Level : DOS
  836.  
  837. This routine writes a byte to a file from an integer.  The
  838. least significant byte of the integer is written.
  839.  
  840. The file must have been opened using FCreate or FOpen1.
  841.  
  842.    BWrite Handle%, Value%, ErrCode%
  843.  
  844. Handle%    file handle
  845. Value%     byte to write to file
  846. -------
  847. ErrCode%   DOS error code (0 if no error)
  848.  
  849. Name  : CalcAttr             (Calculate Attribute)
  850. Class : Display
  851. Level : Any
  852.  
  853. Many of the display routines in this library require an
  854. "attribute" rather than foreground and background colors.  An
  855. attribute is a combination of the foreground and background
  856. colors in a format which is used by all types of displays when
  857. in text mode.
  858.  
  859. Foreground colors are usually specified as 0-31, with
  860. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  861. may be more convenient to express the same thing as foreground
  862. 0-15, background 0-15.  The CalcAttr routine will accept either
  863. way of expressing it.
  864.  
  865. Note, however, that UnCalcAttr will always return the former
  866. pair of results, since it has no way of knowing whether Blink
  867. has been used (foreground 0-31, background 0-15).  See
  868. UnCalcAttr for more details and a solution.
  869.  
  870. See also CalcAttr2, the FUNCTION version of this routine.
  871.  
  872.    CalcAttr Foreground%, Background%, VAttr%
  873.  
  874. Foreground%  foreground color
  875. Background%  background color
  876. -------
  877. VAttr%       color "attribute"
  878.  
  879. Name  : CalcAttr2%           (Calculate Attribute)
  880. Class : Display
  881. Level : Any
  882.  
  883. Many of the display routines in this library require an
  884. "attribute" rather than foreground and background colors.  An
  885. attribute is a combination of the foreground and background
  886. colors in a format which is used by all types of displays when
  887. in text mode.
  888.  
  889. Foreground colors are usually specified as 0-31, with
  890. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  891. may be more convenient to express the same thing as foreground
  892. 0-15, background 0-15.  The CalcAttr2 routine will accept
  893. either way of expressing it.
  894.  
  895. Note, however, that UnCalcAttr will always return the former
  896. pair of results, since it has no way of knowing whether Blink
  897. has been used (foreground 0-31, background 0-15).  See
  898. UnCalcAttr for more details and a solution.
  899.  
  900. See also CalcAttr, the SUB version of this routine.
  901.  
  902.    VAttr% = CalcAttr2%(Foreground%, Background%)
  903.  
  904. Foreground%  foreground color
  905. Background%  background color
  906. -------
  907. VAttr%       color "attribute"
  908.  
  909. Name  : CalcDate             (Calculate Date)
  910. Class : Time
  911. Level : Any
  912.  
  913. This routine calculates what the date will be a given number of
  914. days from now, either in the past or the future.  Actually, you
  915. may use any starting date, not just the current date.  An error
  916. code is returned if the starting date or resulting date are not
  917. valid.  Dates may not preceed January 1, 1900.
  918.  
  919. CalcDate accepts the date in any standard form ("01/30/91" or
  920. "01-30-1991", for example) and returns its results in the same
  921. format.
  922.  
  923.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  924.  
  925. StartDate$   starting date
  926. Days&        number of days from the current date (0 or more)
  927. Direction%   return future result (0) or past (nonzero)
  928. -------
  929. NewDate$     resulting date
  930. ErrCode%     whether the dates are valid (0 yes)
  931.  
  932. Name  : CalcSize             (Calculate array Size)
  933. Class : Display
  934. Level : Any
  935.  
  936. This routine calculates the necessary DIM size for an integer
  937. array, assuming that you intend to store display data in the
  938. array.  This is most useful in conjunction with DGetScreen and
  939. GetScreen.
  940.  
  941.    CalcSize TopRow%, LeftCol%, BottomRow%, RightCol%, Elements%
  942.    DIM Array%(1 TO Elements%)
  943.  
  944. TopRow%      top row of the display area
  945. LeftCol%     left column of the display area
  946. BottomRow%   top row of the display area
  947. RightCol%    left column of the display area
  948. -------
  949. Elements%    required size of the integer array
  950.  
  951. Name  : CalcVGAColor         (Calculate VGA palette Color)
  952. Class : Display
  953. Level : Any
  954.  
  955. The QuickBASIC manual gives a cumbersome formula for
  956. calculating VGA palette colors.  This routine does it faster
  957. and with less fuss.  All you need to do is pass it the
  958. appropriate intensity values (0-63) and you get back a long
  959. integer, just the way BASIC wants it.
  960.  
  961.    CalcVGAColor Red%, Green%, Blue%, Colour&
  962.  
  963. Red%      red   intensity
  964. Green%    green intensity
  965. Blue%     blue  intensity
  966. -------
  967. Colour&   color value for use in the PALETTE statement
  968.  
  969. Name  : Carrier              (detect Carrier)
  970. Class : Serial
  971. Level : Clone
  972.  
  973. If you write communications programs, particularly things like
  974. doors and BBSes, you probably want to keep an eye on the
  975. carrier.  BASIC won't do it, but we will!
  976.  
  977.    Carrier CommPort%, CarrierHigh%
  978.  
  979. CommPort%     serial port (1-4, though BASIC only handles 1-2)
  980. -------
  981. CarrierHigh%  zero if no carrier
  982.  
  983. Name  : CatchError           (Catch Error from SHELL)
  984. Class : Miscellaneous
  985. Level : Clone
  986.  
  987. NOTE: You should use the GetError2% function in preference to
  988. this set of routines.
  989.  
  990. The CatchError routine is used in conjunction with GetError.
  991. It lets you get the exit code (error level) returned by a
  992. program to which you have SHELLed. Since CatchError hooks an
  993. interrupt to do its work, you must always make sure to use
  994. GetError afterwards to "clean up".  See also GetError.
  995.  
  996. Note that differences in DOS mean that this routine will not
  997. always work.  In some versions of DOS, you can only get the
  998. error level if a batch file was executed; in others, you can't
  999. get the error level from a batch file at all. Sorry about
  1000. that.  I don't know of any way to work around it.
  1001.  
  1002.    CatchError
  1003.    SHELL ProgramName$
  1004.    GetError ExitCode%
  1005.  
  1006. Name  : CDROM                (check for CD-ROM)
  1007. Class : Disk / Equipment
  1008. Level : DOS
  1009.  
  1010. This routine tells you whether the Microsoft CD-ROM Extensions
  1011. are installed. If so, it tells you what the letter of the first
  1012. CD-ROM logical drive is and how many logical drives exist.
  1013.  
  1014. Note: The CD-ROM installation check conflicts with the
  1015. GRAPHICS.COM installation check for DOS 4.0, due to some
  1016. screw-up at IBM or Microsoft. This may cause unexpected
  1017. results.  I'm not yet sure whether DOS 5.0 is similarly
  1018. afflicted.
  1019.  
  1020.    FirstDrive$ = "x"
  1021.    CDROM FirstDrive$, Drives%
  1022.  
  1023. -------
  1024. FirstDrive$   letter of first logical drive (init to >= 1 char)
  1025. Drives%       number of logical drives (0 if no CD-ROM)
  1026.  
  1027. Name  : CDROM2%              (check for CD-ROM)
  1028. Class : Disk / Equipment
  1029. Level : DOS
  1030.  
  1031. This routine tells you whether the Microsoft CD-ROM Extensions
  1032. are installed. If so, it tells you how many logical drives
  1033. exist.
  1034.  
  1035. Note: The CD-ROM installation check conflicts with the
  1036. GRAPHICS.COM installation check for DOS 4.0, due to some
  1037. screw-up at IBM or Microsoft. This may cause unexpected
  1038. results.  I'm not yet sure whether DOS 5.0 is similarly
  1039. afflicted.
  1040.  
  1041.    Drives% = CDROM2%
  1042.  
  1043. -------
  1044. Drives%       number of logical drives (0 if no CD-ROM)
  1045.  
  1046. Name  : CeilD#               (Ceiling, Double-precision)
  1047. Class : String
  1048. Level : Any
  1049.  
  1050. This function returns the smallest integer greater than or
  1051. equal to the number you give it.  This is most often used for
  1052. rounding.
  1053.  
  1054.    Result# = CeilD#(Nr#)
  1055.  
  1056. Nr#          number to process
  1057. -------
  1058. Result#      result
  1059.  
  1060. Name  : CeilS!               (Ceiling, Single-precision)
  1061. Class : String
  1062. Level : Any
  1063.  
  1064. This function returns the smallest integer greater than or
  1065. equal to the number you give it.  This is most often used for
  1066. rounding.
  1067.  
  1068.    Result! = CeilS!(Nr!)
  1069.  
  1070. Nr!          number to process
  1071. -------
  1072. Result!      result
  1073.  
  1074. Name  : CenterSt$            (Center String)
  1075. Class : String
  1076. Level : Any
  1077.  
  1078. This function returns a string centered in a field of spaces.
  1079.  
  1080.    Result$ = CenterSt$(StToCenter$, Columns%)
  1081.  
  1082. StToCenter$   string to center
  1083. Columns%      width of field in which to center string
  1084. -------
  1085. Result$       field of spaces with string centered in it
  1086.  
  1087. Name  : CheckCAS%            (Check CAS driver)
  1088. Class : Serial
  1089. Level : BIOS
  1090.  
  1091. This function tells you whether a CAS driver is installed.  CAS
  1092. is the DCA/Intel "Communicating Applications Specification"
  1093. (apparently named by someone whose prolonged wearing of ties
  1094. cut off the flow of blood to his brain) used by a number of
  1095. faxmodems.  CheckCAS% returns -1 if CAS is available, 0 if not.
  1096.  
  1097.    CAS% = CheckCAS%
  1098.  
  1099. -------
  1100. CAS%        whether a CAS driver is installed (0 no, -1 yes)
  1101.  
  1102. Name  : CheckDate            (Check Date validity)
  1103. Class : Time
  1104. Level : Any
  1105.  
  1106. This routine checks a date to see if it is valid.
  1107.  
  1108.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  1109.  
  1110. MonthNr%     month number (1-12)
  1111. DayNr%       day number (1-31)
  1112. YearNr%      year number (1900 on; years <100 assumed 1900s)
  1113. -------
  1114. ErrCode%     whether the date is valid (0 yes)
  1115.  
  1116. Name  : CheckDisk            (Check Disk readiness)
  1117. Class : Disk
  1118. Level : DOS
  1119.  
  1120. The CheckDisk routine determines whether a disk is ready.
  1121. About the only thing it won't tell you is if a disk is
  1122. write-protected or out of space. Since the PBClone disk
  1123. routines all contain critical error handling, which reports
  1124. back an appropriate error code for all such problems, this
  1125. routine isn't really needed any more.  It's included for
  1126. compatibility with older ProBas programs.
  1127.  
  1128. Results will normally be returned as one of the following,
  1129. although not all DOS versions report the exact cause of the
  1130. error, in which case the error number may not mean what you
  1131. expect.
  1132.  
  1133.    0   no error
  1134.    1   unformatted disk
  1135.    2   open drive door
  1136.    3   bad drive spec
  1137.  
  1138.    CheckDisk Drive$, ErrCode%
  1139.  
  1140. Drive$    letter of the drive to check
  1141. -------
  1142. ErrCode%  0 if no error, nonzero for error (see above)
  1143.  
  1144. Name  : CheckDsk%            (Check Disk readiness)
  1145. Class : Disk
  1146. Level : DOS
  1147.  
  1148. The CheckDsk% function determines whether a disk is ready.
  1149. About the only thing it won't tell you is if a disk is
  1150. write-protected or out of space. Since the PBClone disk
  1151. routines all contain critical error handling, which reports
  1152. back an appropriate error code for all such problems, this
  1153. routine isn't really needed any more.  It's included for
  1154. compatibility with older ProBas programs.
  1155.  
  1156. Note that DOS versions before 3.0 do not return as useful error
  1157. codes as later versions.  Under such circumstances, both
  1158. "unformatted disk" and "open drive door" will be returned as
  1159. "open drive door".
  1160.  
  1161.    ErrCode% = CheckDsk%(Drive$)
  1162.  
  1163. Drive$    letter of the drive to check
  1164.  
  1165. Name  : CheckKey             (Check for Key or mouse)
  1166. Class : Input, Mouse
  1167. Level : BIOS
  1168.  
  1169. This routine is kind of an extended version of INKEY$.  It
  1170. checks the keyboard to see if any key is available and gets the
  1171. key if it is.  At your option, it can also check the mouse to
  1172. see if a button has been pressed.
  1173.  
  1174.    CheckKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  1175.  
  1176. Mouse%        whether to check the mouse (0: no)
  1177. -------
  1178. ASCIIcode%    ASCII code of the key pressed
  1179. ScanCode%     scan code of the key pressed (0 if none)
  1180. LButton%      whether the left  mouse button was pressed
  1181. RButton%      whether the right mouse button was pressed
  1182.  
  1183. Name  : CheckKey3            (Check for Key or 3-button mouse)
  1184. Class : Input, Mouse
  1185. Level : BIOS
  1186.  
  1187. This routine is kind of an extended version of INKEY$.  It
  1188. checks the keyboard to see if any key is available and gets the
  1189. key if it is.  At your option, it can also check the mouse to
  1190. see if a button has been pressed.
  1191.  
  1192.    CheckKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  1193.       MButton%, RButton%
  1194.  
  1195. Mouse%        whether to check the mouse (0: no)
  1196. -------
  1197. ASCIIcode%    ASCII code of the key pressed
  1198. ScanCode%     scan code of the key pressed (0 if none)
  1199. LButton%      whether the left   mouse button was pressed
  1200. MButton%      whether the middle mouse button was pressed
  1201. RButton%      whether the right  mouse button was pressed
  1202.  
  1203. Name  : CheckShare           (Check for SHARE)
  1204. Class : Disk
  1205. Level : DOS
  1206.  
  1207. The CheckShare routine determines whether SHARE.EXE is active.
  1208. This is particularly helpful before using the BASIC OPEN
  1209. statement, which will fail if you request file sharing when
  1210. it's not available.  The PBClone file routines handle such
  1211. situations automatically, so CheckShare is not needed for them.
  1212.  
  1213.    CheckShare ShareActive%
  1214.  
  1215. -------
  1216. ShareActive%   whether SHARE is active (0 if no)
  1217.  
  1218. Name  : CheckShare2%         (Check for SHARE)
  1219. Class : Disk
  1220. Level : DOS
  1221.  
  1222. The CheckShare2% function determines whether SHARE.EXE is
  1223. active.  This is particularly helpful before using the BASIC
  1224. OPEN statement, which will fail if you request file sharing
  1225. when it's not available.  The PBClone file routines handle such
  1226. situations automatically, so CheckShare2% is not needed for
  1227. them.
  1228.  
  1229.    ShareActive% = CheckShare2%
  1230.  
  1231. -------
  1232. ShareActive%   whether SHARE is active (0 if no)
  1233.  
  1234. Name  : Checksum             (calculate Checksum)
  1235. Class : Serial
  1236. Level : Any
  1237.  
  1238. The Checksum routine calculates a checksum on a string.  The
  1239. resulting number is compatible with Xmodem and Ymodem checksum
  1240. routines and will vary from 0-255.  This checksum provides a
  1241. minimal, but fast, check of what characters are contained in
  1242. the string.  See also Checksum2%, the function version of this
  1243. routine, and CRC1.
  1244.  
  1245.    Checksum St$, ChkSum%
  1246.  
  1247. St$       string to process
  1248. -------
  1249. ChkSum%   checksum of the characters in the string
  1250.  
  1251. Name  : Checksum2%           (calculate Checksum)
  1252. Class : Serial
  1253. Level : Any
  1254.  
  1255. The Checksum2% function calculates a checksum on a string.  The
  1256. resulting number is compatible with Xmodem and Ymodem checksum
  1257. routines and will vary from 0-255.  This checksum provides a
  1258. minimal, but fast, check of what characters are contained in
  1259. the string.  See also Checksum, the sub version of this
  1260. function, and CRC1.
  1261.  
  1262.    ChkSum% = Checksum2% (St$)
  1263.  
  1264. St$       string to process
  1265. -------
  1266. ChkSum%   checksum of the characters in the string
  1267.  
  1268. Name  : Cipher               (Cipher)
  1269. Class : String
  1270. Level : Any
  1271.  
  1272. This is a very simple text encryption routine.  It isn't
  1273. particularly hard to crack, but will provide a basic level of
  1274. security for undemanding applications.  The same routine can be
  1275. used either to encrypt or decrypt text.  The original text may
  1276. contain any character; likewise, the resulting text.  This is
  1277. not well suited for use with sequential files-- if such is
  1278. required, see CipherP.
  1279.  
  1280. I'd suggest using a long password composed of an unlikely
  1281. string of characters, e.g. "#*@@!A^%x{.'".
  1282.  
  1283.    Cipher St$, Password$
  1284.  
  1285. St$        string to encrypt or decrypt
  1286. Password$  password
  1287. -------
  1288. St$        encrypted or decrypted string
  1289.  
  1290. Name  : CipherP              (Cipher Printable)
  1291. Class : String
  1292. Level : Any
  1293.  
  1294. This is a very simple text encryption routine.  It isn't
  1295. particularly hard to crack, but will provide a basic level of
  1296. security for undemanding applications.  The same routine can be
  1297. used either to encrypt or decrypt text.  The original text may
  1298. contain any character below CHR$(128), as may the password.
  1299. The resulting text will be printable, if bizarre (all
  1300. characters will be above CHR$(127)), and may be used with
  1301. sequential files.
  1302.  
  1303. This routine is potentially less secure than the Cipher routine
  1304. (see).
  1305.  
  1306. I'd suggest using a long password composed of an unlikely
  1307. string of characters, e.g. "#*@@!A^%x{.'".
  1308.  
  1309.    CipherP St$, Password$
  1310.  
  1311. St$        string to encrypt or decrypt
  1312. Password$  password
  1313. -------
  1314. St$        encrypted or decrypted string
  1315.  
  1316. Name  : ClearArea            (Clear a screen Area)
  1317. Class : Display
  1318. Level : Clone
  1319.  
  1320. This routine clears an area of the screen to a specified
  1321. color.  The clearing is done by removing random characters
  1322. until the area is totally clear.
  1323.  
  1324.    ClearArea TRow%, LCol%, BRow%, RCol%, VAttr%, Fast%
  1325.  
  1326. TRow%       top row of area to clear
  1327. LCol%       left column of area to clear
  1328. BRow%       bottom row of area to clear
  1329. RCol%       right column of area to clear
  1330. VAttr%      color/attribute to clear to
  1331. Fast%       whether to use fast displays (0 no)
  1332.  
  1333. Name  : Clock                (Clock)
  1334. Class : Display / Time
  1335. Level : Clone
  1336.  
  1337. This routine allows you to turn a visible time display on or
  1338. off.  When on, the time will be continuously displayed at a
  1339. selected location while your program continues processing.  The
  1340. clock is managed as a background process, in effect doing some
  1341. simple multitasking.
  1342.  
  1343. You should turn the clock off before you terminate your
  1344. program, including any time you execute another program with
  1345. RUN.  The clock can be safely kept on when you SHELL to another
  1346. program, however, as long as you can be sure that control will
  1347. return to your program when the other is done.
  1348.  
  1349. The clock must also be turned off if you change any of its
  1350. parameters with the ClockSet routine (see).
  1351.  
  1352. The clock will only be visible when the display is in text
  1353. mode.  The use of PLAY or SOUND statements may shut off the
  1354. clock, depending on your version of the BASIC compiler.
  1355.  
  1356.    Clock DisplayOn%
  1357.  
  1358. DisplayOn%   whether to display the clock (0 if no)
  1359.  
  1360. Name  : ClockSet             (Clock Settings)
  1361. Class : Display / Time
  1362. Level : Clone
  1363.  
  1364. The ClockSet routine is used in conjunction with Clock (see).
  1365. It should only be used when the clock is turned off.
  1366.  
  1367. This routine allows you to set 12-hour or 24-hour time, whether
  1368. to display the seconds or not, how often to update the clock
  1369. display (in 1/18th seconds; 9 is usually the best choice),
  1370. where to display the clock and in what color, and whether to
  1371. use flicker-free displays (needed for cheap CGAs only).  The
  1372. defaults are 12-hour time, display seconds, put the time (in
  1373. white on black) in the upper right corner, and display quickly
  1374. (may flicker on some CGAs).
  1375.  
  1376.    ClockSet Hours24%, Seconds%, Updates%, Row%, Column%, _
  1377.       VAttr%, Fast%
  1378.  
  1379. Hours24%   whether to display 24-hour time (0 if no)
  1380. Seconds%   whether to display seconds (0 if no)
  1381. Updates%   display update frequency in 1/18th seconds
  1382. Row%       row on which to display the clock
  1383. Col%       column at which to display the clock
  1384. VAttr%     color/attribute to use (see CalcAttr)
  1385. Fast%      whether to use fast mode (0 no)
  1386.  
  1387. Name  : CloseA               (Close Archive)
  1388. Class : Disk / Time
  1389. Level : DOS
  1390.  
  1391. This routine closes an archive opened by FindFirstA or
  1392. FindNextA.  It must be used when you are done searching the
  1393. archive.
  1394.  
  1395. Routines in this series include:
  1396.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  1397.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  1398.  
  1399.    CloseA
  1400.  
  1401. Name  : ClrCols              (Clear Columns)
  1402. Class : Display
  1403. Level : BIOS
  1404.  
  1405. This routine clears the current row between the specified
  1406. columns, inclusive. It does not affect the cursor position.
  1407.  
  1408.    ClrCols StartCol%, EndCol%
  1409.  
  1410. StartCol%  starting column
  1411. EndCol%    ending column
  1412.  
  1413. Name  : ClrEOL               (Clear to End Of Line)
  1414. Class : Display
  1415. Level : BIOS
  1416.  
  1417. This routine clears from the cursor to the end of the line,
  1418. inclusive.  It does not affect the current cursor position.
  1419.  
  1420.    ClrEOL
  1421.  
  1422. Name  : ClrEOP               (Clear to End Of Page)
  1423. Class : Display
  1424. Level : BIOS
  1425.  
  1426. This routine clears from the cursor to the end of the display,
  1427. inclusive.  It does not affect the current cursor position.
  1428.  
  1429.    ClrEOP
  1430.  
  1431. Name  : ClrKbd               (Clear Keyboard buffer)
  1432. Class : Input
  1433. Level : DOS
  1434.  
  1435. ClrKbd clears the keyboard buffer, discarding any keys that may
  1436. be waiting. This is a good idea for situations where an
  1437. unexpected input is made and you don't want to chance it being
  1438. answered accidentally by keys that were typed beforehand-- for
  1439. instance, in the event of an error or other condition where it
  1440. is important that the user see a message or take an action
  1441. before pressing a key.
  1442.  
  1443.    ClrKbd
  1444.  
  1445. Name  : ClrSOL               (Clear to Start Of Line)
  1446. Class : Display
  1447. Level : BIOS
  1448.  
  1449. This routine clears from the start of the line to the cursor,
  1450. inclusive.  It does not affect the current cursor position.
  1451.  
  1452.    ClrSOL
  1453.  
  1454. Name  : ClrSOP               (Clear to Start Of Page)
  1455. Class : Display
  1456. Level : BIOS
  1457.  
  1458. This routine clears from the start of the display to the
  1459. cursor, inclusive. It does not affect the current cursor
  1460. position.
  1461.  
  1462.    ClrSOP
  1463.  
  1464. Name  : Command2$            (Command line)
  1465. Class : Miscellaneous
  1466. Level : DOS
  1467.  
  1468. This function returns the original DOS command line.  It works
  1469. like COMMAND$, but does not trim or capitalize the command
  1470. line.
  1471.  
  1472. The area in which the command line is stored may be recycled
  1473. for other purposes, so you should use Command2$ as near to the
  1474. start of your program as possible.
  1475.  
  1476. NOTE that this function returns the actual command line.  If
  1477. you use it in the editor/environment, it will return the
  1478. command line you used to start QB/QBX/VB-DOS, rather than any
  1479. imitation command line you installed while in the editor.  The
  1480. BASIC editor/environment does not set the actual command line
  1481. with your choice, unfortunately-- it fakes out COMMAND$
  1482. instead.  It is not able to fool Command2$ in the same way.
  1483.  
  1484.    CmdLine$ = Command2$
  1485.  
  1486. -------
  1487. CmdLine$    original DOS command line
  1488.  
  1489. Name  : CopyFile             (Copy a File)
  1490. Class : Disk
  1491. Level : DOS
  1492.  
  1493. This works like the DOS COPY command, although it does not
  1494. allow wildcards. One file is copied to another, retaining the
  1495. same date and time.  Full path specifications are supported,
  1496. including drive and subdirectory specs.
  1497.  
  1498. See also FileCopy, which supports wildcards.
  1499.  
  1500.    CopyFile FromFile$, ToFile$, ErrCode%
  1501.  
  1502. FromFile$   name of file to copy
  1503. ToFile$     name of new file to create
  1504. -------
  1505. ErrCode%    0 if no error, else DOS Error
  1506.  
  1507. Name  : CPrintScreen1        (CGA Print Screen [SCREEN 1])
  1508. Class : Display / Printer
  1509. Level : Clone
  1510.  
  1511. This routine dumps a SCREEN 1 display (CGA 320x200) to the
  1512. printer.  It uses the stdprn device (normally PRN or LPT1) by
  1513. default, although this can be altered with the PrtSwap routine.
  1514.  
  1515.    CPrintScreen1
  1516.  
  1517. Name  : CPrintScreen2        (CGA Print Screen [SCREEN 2])
  1518. Class : Display / Printer
  1519. Level : Clone
  1520.  
  1521. This routine dumps a SCREEN 2 display (CGA 640x200) to the
  1522. printer.  It uses the stdprn device (normally PRN or LPT1) by
  1523. default, although this can be altered with the PrtSwap routine.
  1524.  
  1525.    CPrintScreen2
  1526.  
  1527. Name  : CPUSpeed%            (CPU Speed)
  1528. Class : Equipment
  1529. Level : Clone
  1530.  
  1531. This function returns the approximate CPU speed in MHz.  It may
  1532. take several seconds to find the speed of slower processors, so
  1533. don't expect an immediate response.  Results can be skewed by
  1534. multitasking and background processing.
  1535.  
  1536.    MHz% = CPUSpeed%
  1537.  
  1538. -------
  1539. MHz%       approximate CPU speed
  1540.  
  1541. Name  : CRC                  (calculate CRC)
  1542. Class : String / Serial
  1543. Level : Any
  1544.  
  1545. This routine has become obsolete; the CRC1 routine is much
  1546. faster.  However, CRC is still included for backwards
  1547. compatibility.
  1548.  
  1549. This routine calculates a complex 16-bit checksum, called a
  1550. Cyclical Redundancy Check (or CRC) on a string.  The results
  1551. are compatible with Xmodem and Ymodem CRC routines.  The CRC
  1552. provides a fairly reliable check of what characters are
  1553. contained in the string.  See also Checksum.
  1554.  
  1555. If you are using this routine for Xmodem or Ymodem, note that
  1556. the string should be padded with two null characters before
  1557. calculating a "send" CRC: St$ = St$ + STRING$(2, 0).  On
  1558. receive, you should calculate the CRC on the entire data block,
  1559. plus the received CRC; if the block was received correctly, the
  1560. calculated CRC will be zero in both lsb and msb.
  1561.  
  1562. Although Intel notation uses "lsb, msb" order, the
  1563. Xmodem/Ymodem CRC uses the opposite format, which is why the
  1564. parameters are ordered in this fashion.
  1565.  
  1566.    CRC St$, CRCmsb%, CRClsb%
  1567.  
  1568. St$       string to process
  1569. -------
  1570. CRCmsb%   most significant byte of CRC
  1571. CRClsb%   least significant byte of CRC
  1572.  
  1573. Name  : CRC1                 (calculate CRC)
  1574. Class : String / Serial
  1575. Level : Any
  1576.  
  1577. This routine calculates a complex 16-bit checksum, called a
  1578. Cyclical Redundancy Check (or CRC) on a string.  The results
  1579. are compatible with Xmodem and Ymodem CRC routines.  The CRC
  1580. provides a fairly reliable check of what characters are
  1581. contained in the string.  See also Checksum.
  1582.  
  1583. Note that CRC1 does not work like the older CRC routine.  You
  1584. should not pad outgoing strings with a STRING$(2, 0) sequence.
  1585.  
  1586. Although Intel notation uses "lsb, msb" order, the
  1587. Xmodem/Ymodem CRC uses the opposite format, which is why the
  1588. parameters are ordered in this fashion.
  1589.  
  1590.    CRC1 St$, CRCmsb%, CRClsb%
  1591.  
  1592. St$       string to process
  1593. -------
  1594. CRCmsb%   most significant byte of CRC
  1595. CRClsb%   least significant byte of CRC
  1596.  
  1597. Name  : CRC32Calc            (CRC 32-bit Calculation)
  1598. Class : String / Serial
  1599. Level : Any
  1600.  
  1601. This routine calculates a complex 32-bit checksum, called a
  1602. Cyclical Redundancy Check (or CRC) on a string.  The results
  1603. are compatible with Zmodem CRC routines as well as those used
  1604. by popular archive utilities.  The CRC provides a fairly
  1605. reliable check of what characters are contained in the string.
  1606.  
  1607. This routine must be used with two others.  Before starting a
  1608. CRC calculation, call CRC32Init.  You can then use CRC32Calc
  1609. on one or more strings for which you desire a CRC calculation.
  1610. When you're done, you call CRC32Done&, which returns the final
  1611. result.  This approach allows you to calculate CRCs for data
  1612. which may be stored in more than one string.
  1613.  
  1614.    CRC32Calc St$
  1615.  
  1616. St$       string to process
  1617. -------
  1618.  
  1619. Name  : CRC32Done&           (CRC 32-bit Done)
  1620. Class : String / Serial
  1621. Level : Any
  1622.  
  1623. This routine returns the result of a 32-bit CRC calculation for
  1624. a string.  See also CRC32Init and CRC32Calc.
  1625.  
  1626.    Result& = CRC32Done&
  1627.  
  1628. -------
  1629. Result&     32-bit CRC
  1630.  
  1631. Name  : CRC32Init            (CRC 32-bit Initialize)
  1632. Class : String / Serial
  1633. Level : Any
  1634.  
  1635. This routine initializes a 32-bit CRC calculation for a string.
  1636. See also CRC32Done& and CRC32Calc.
  1637.  
  1638.    CRC32Init
  1639.  
  1640. Name  : CreditCard$          (Credit Card validation)
  1641. Class : Miscellaneous
  1642. Level : Any
  1643.  
  1644. USE AT YOUR OWN RISK.  This function has worked in my tests,
  1645. but I can't guarantee it will work for you.  This is true of
  1646. all PBClone routines, but I feel it important to re-emphasize
  1647. this for this particular function.  If you're not comfortable
  1648. with this lack of warranty, DON'T USE PBCLONE.
  1649.  
  1650. This function checks a credit card number for consistency, to
  1651. see if it is possibly valid.  If the number seems reasonable,
  1652. the card type is returned as a four-character code:
  1653.  
  1654.    AMEX    American Express
  1655.    DINE    Diner's Club
  1656.    DISC    Discover
  1657.    MCAR    MasterCard
  1658.    VISA    Visa
  1659.  
  1660. Otherwise, a null string ("") is returned.  The number is
  1661. checked according to length and self-consistency according to a
  1662. validation formula.  Non-numeric characters are ignored.
  1663.  
  1664. NOTE that this function cannot ensure that a credit card number
  1665. -is- really valid.  It can only tell you whether a card number
  1666. is -not- valid, to the best of its understanding.  Its intended
  1667. use is in data-entry routines and similar operations which may
  1668. benefit from a "sanity check".  *** USE AT YOUR OWN RISK ***
  1669.  
  1670.    CardName$ = CreditCard$(CardNumber$)
  1671.    IF LEN(CardName$) = 0 THEN PRINT "Error in card number"
  1672.  
  1673. CardNumber$    credit card number
  1674. -------
  1675. CardName$      type of credit card ("" if invalid)
  1676.  
  1677. Name  : Crunch               (Crunch repeated characters)
  1678. Class : String
  1679. Level : Any
  1680.  
  1681. It was hard to decide on a name for this routine, and I don't
  1682. know if I've done the best job.  What Crunch does is to
  1683. eliminate repeated sequences of the same character.  For
  1684. instance, if you gave it "This    is a   test" and asked it to
  1685. crunch spaces, it would return "This is a test".  I use this to
  1686. filter information from the COMMAND$ function, but it's a good
  1687. general purpose input filter.
  1688.  
  1689.    Crunch St$, Ch$, StLen%
  1690.    St$ = LEFT$(St$, StLen%)
  1691.  
  1692. St$       string to be processed
  1693. Ch$       character to crunch out of the string
  1694. -------
  1695. St$       crunched string
  1696. StLen%    length of the crunched string
  1697.  
  1698. Name  : CtrlKey              (Control Key)
  1699. Class : Input
  1700. Level : Any
  1701.  
  1702. This routine works in conjunction with a key input routine,
  1703. such as INKEY$ or the CheckKey and GetKey routines.  Given the
  1704. ASCII code of a key, CtrlKey returns the associated key letter,
  1705. if any.  For instance, it returns "A" if you pass it ASCII code
  1706. 1, because that code represents Ctrl-A.
  1707.  
  1708.    CtrlKey ASCIICode%, Ky$
  1709.  
  1710. ASCIICode%   ASCII code of the key
  1711. -------
  1712. Ky$          associated key letter ("" if none)
  1713.  
  1714. Name  : CursorInfo           (Cursor Information)
  1715. Class : Input
  1716. Level : Clone
  1717.  
  1718. While BASIC allows you to set the size and shape of the cursor
  1719. with LOCATE, it's fairly hazardous to do so.  There is no way
  1720. to find out the maximum size of the cursor, so your cursor may
  1721. end up a peculiar shape on some adapters. If you change the
  1722. cursor size or visibility in a subprogram, you may be screwing
  1723. up the main program.
  1724.  
  1725. CursorInfo offers a solution to these problems.  It returns the
  1726. current cursor visibility and size, plus the maximum size
  1727. possible with the current video adapter.  The minimum size will
  1728. always be zero, so it is not reported.
  1729.  
  1730.    CursorInfo Visible%, StartLine%, EndLine%, MaxLine%
  1731.  
  1732. -------
  1733. Visible%      whether the cursor is visible (0 no, 1 yes)
  1734. StartLine%    starting scan line of cursor
  1735. EndLine%      ending scan line of cursor
  1736. MaxLine%      maximum possible scan line for cursor
  1737.  
  1738. Name  : CWindowManager       (CGA Window Manager)
  1739. Class : Display
  1740. Level : Clone
  1741.  
  1742. CWindowManager displays a pop-up window on a CGA graphics
  1743. screen.  It is intended for SCREEN 1, although it can be used
  1744. on SCREEN 2 as well (it will still have 40 columns and will
  1745. display shades rather than colors).  The window may have any of
  1746. a variety of frames, a title, or a shadow, and it may appear
  1747. instantly or "grow" onto the screen.
  1748.  
  1749. These are the available frame types:
  1750.     0   no frame
  1751.     1   single lines
  1752.     2   double lines
  1753.     3   single horizontal, double vertical lines
  1754.     4   double horizontal, single vertical lines
  1755.     5   block graphic lines
  1756.  
  1757. Options for growing windows are as follows:
  1758.    -1   grow as fast as possible
  1759.     0   pop onto the screen
  1760.    1+   grow with delay given in milliseconds (15 works for me)
  1761.  
  1762. Note that this routine is different from its ProBas equivalent
  1763. in a number of respects.  The grow delay time is different.
  1764. Growing is done more smoothly. The shadow and title parameters
  1765. are not changed by this routine.  A new frame type (5) was
  1766. added.  If a title is too long, it is truncated instead of
  1767. being ignored completely.  Using a -1 as the title foreground
  1768. color will not turn off the title; instead, use a null title
  1769. string.
  1770.  
  1771.    CWindowManager TRow%, LCol%, BRow%, RCol%, Frame%,
  1772.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Fast%
  1773.  
  1774. TRow%       top row of window
  1775. LCol%       left column of window
  1776. BRow%       bottom row of window
  1777. RCol%       right column of window
  1778. Frame%      frame type (see above)
  1779. Fore%       frame foreground color
  1780. Back%       frame background color
  1781. Grow%       window growing option (see above)
  1782. Shade%      window shadow option (0 for none)
  1783. TFore%      title foreground color
  1784. Title$      window title ("" if none)
  1785. Fast%       whether to use fast mode (0 no)
  1786.  
  1787. Name  : Cylinders%           (Cylinders)
  1788. Class : Disk
  1789. Level : DOS 3.3+
  1790.  
  1791. This function returns the number of cylinders for a given disk
  1792. drive.  If the drive does not exist or is not a physical drive,
  1793. -1 will be returned.  Note that the number of cylinders may be
  1794. a virtual number in some cases (such as drives compressed by
  1795. the DBLSPACE driver included with MS-DOS 6.0).
  1796.  
  1797. You may use "" to denote the current drive.
  1798.  
  1799.    Cyls% = Cylinders% (Drive$)
  1800.  
  1801. Drive$    drive for which to return cylinders
  1802. -------
  1803. Cyls%     number of cylinders (-1 if error)
  1804.  
  1805. Name  : DataSeg              (Data Segment)
  1806. Class : Memory
  1807. Level : Any
  1808.  
  1809. It's rare that you need to know the data segment used by BASIC,
  1810. but it does happen.  DataSeg tells you that value.  This is the
  1811. segment used by (near) strings, static arrays (except in the
  1812. QuickBASIC environment), some COMMON data, BASIC internal
  1813. variables and so forth.  It is also the area specified by a
  1814. plain "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1815.  
  1816. There is also a function version of this routine, DataSeg2%.
  1817.  
  1818.    DataSeg DSeg%
  1819.  
  1820. -------
  1821. DSeg%     data segment for BASIC
  1822.  
  1823. Name  : DataSeg2%            (Data Segment)
  1824. Class : Memory
  1825. Level : Any
  1826.  
  1827. It's rare that you need to know the data segment used by BASIC,
  1828. but it does happen.  DataSeg2% tells you that value.  This is
  1829. the segment used by (near) strings, static arrays (except in
  1830. the QuickBASIC environment), some COMMON data, BASIC internal
  1831. variables and so forth.  It is also the area specified by a
  1832. plain "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1833.  
  1834. There is also a sub version of this routine, DataSeg.
  1835.  
  1836.    DSeg% = DataSeg2%
  1837.  
  1838. -------
  1839. DSeg%     data segment for BASIC
  1840.  
  1841. Name  : Date2Int             (Date to Integer)
  1842. Class : Time
  1843. Level : Any
  1844.  
  1845. This routine compresses a date into a single integer.  Note
  1846. that this integer is not in a format that lends itself to
  1847. simple computation-- you cannot subtract one from another to
  1848. find out the length of time between them. However, as long as
  1849. the year is in the range 1980-2042, you can compare the two
  1850. integers to see if one date is before or after another.
  1851.  
  1852. You may express the year as either a two-digit or four-digit
  1853. number.
  1854.  
  1855. The ProBas and PBClone versions of this routine do not work the
  1856. same way in regards to the year.  ProBas assumed that any
  1857. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1858. that years 80-99 should be converted to 1980-1999 and that 0-79
  1859. should be converted to 2000-2079.  I consider the PBClone
  1860. method more appropriate, with the turn of the century moving
  1861. closer. The date format used does not allow dates before 1980
  1862. anyway, so nothing is being lost by this change.
  1863.  
  1864.    Date2Int MonthNr%, DayNr%, YearNr%, IntDate%
  1865.  
  1866. MonthNr%     month number (1-12)
  1867. DayNr%       day (1-31)
  1868. YearNr%      year (1980-2079; see above for two-digit years)
  1869. -------
  1870. IntDate%     date compressed into an integer
  1871.  
  1872. Name  : DateA2R              (Date Actual to Relative)
  1873. Class : Time
  1874. Level : Any
  1875.  
  1876. This routine converts an actual date to a relative date,
  1877. expressed as a number of days.  This allows you to compare
  1878. dates, find out what the date will be in a given number of days
  1879. (or what it was a given number of days ago), see how many days
  1880. passed between two dates, and so forth.
  1881.  
  1882. I've frequently seen routines of this nature called "Julian
  1883. date" routines. I'm not sure where that nomenclature
  1884. originated, as it has nothing to do with the Julian calendar.
  1885. Most of these routines rely on approximations through floating
  1886. point math, and may or may not handle leap years and centuries
  1887. appropriately.  The DateA2R routine takes no such shortcuts and
  1888. may be relied upon to return accurate results.
  1889.  
  1890.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  1891.  
  1892. MonthNr%     month number (1-12)
  1893. DayNr%       day number (1-31)
  1894. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  1895. -------
  1896. RelDate&     relative date
  1897.  
  1898. Name  : DateN2S              (Date Numbers to String)
  1899. Class : Time
  1900. Level : Any / DOS
  1901.  
  1902. Many of the PBClone routines return the date as a set of
  1903. numbers.  This routine provides an easy way to convert those
  1904. numbers into string form.  The date format used (year length
  1905. and delimiter) will be based on the string which you pass to
  1906. the routine.  For instance, "xx-xx-xxxx" will return a date
  1907. like "11-26-1990", whereas "xx.xx.xxxx" would return
  1908. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  1909.  
  1910. If you pass zeroes for the MonthNr%, DayNr%, and YearNr%
  1911. values, the current date will be returned in the format that
  1912. you specified.
  1913.  
  1914. The ProBas and PBClone versions of this routine do not work the
  1915. same way in regards to the year.  ProBas assumed that any
  1916. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1917. that years 80-99 should be converted to 1980-1999 and that 0-79
  1918. should be converted to 2000-2079.
  1919.  
  1920.    DateSt$ = "xx-xx-xxxx"
  1921.    DateN2S MonthNr%, DayNr%, YearNr%, DateSt$
  1922.  
  1923. MonthNr%  month
  1924. DayNr%    day
  1925. YearNr%   year
  1926. -------
  1927. DateSt$   date string.  Init to 8 or 10 chars (see above).
  1928.  
  1929. Name  : DateR2A              (Date Relative to Actual)
  1930. Class : Time
  1931. Level : Any
  1932.  
  1933. This is the opposite of the DateA2R routine-- it takes a
  1934. "relative" date and converts it back to the usual form.
  1935.  
  1936.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  1937.  
  1938. RelDate&     relative date
  1939. -------
  1940. MonthNr%     month number (1-12)
  1941. DayNr%       day number (1-31)
  1942. YearNr%      year number (1900 on)
  1943.  
  1944. Name  : DateS2N              (Date String to Numbers)
  1945. Class : Time
  1946. Level : Any
  1947.  
  1948. Many of the PBClone routines need to be passed the date as a
  1949. set of numbers. This routine provides an easy way to convert a
  1950. date from string form into numbers.  You may use either
  1951. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  1952. length is important, but the delimiter and contents of the
  1953. string are ignored).
  1954.  
  1955. The ProBas and PBClone versions of this routine do not work the
  1956. same way in regards to the year.  ProBas assumed that any
  1957. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1958. that years 80-99 should be converted to 1980-1999 and that 0-79
  1959. should be converted to 2000-2079.
  1960.  
  1961.    DateS2N MonthNr%, DayNr%, YearNr%, DateSt$
  1962.  
  1963. DateSt$   date string.  Init to 8 or 10 characters (see above).
  1964. -------
  1965. MonthNr%  month
  1966. DayNr%    day
  1967. YearNr%   year
  1968.  
  1969. Name  : DblSpace%            (DBLSPACE check)
  1970. Class : Disk
  1971. Level : BIOS
  1972.  
  1973. This function returns whether DBLSPACE, the disk space doubler
  1974. that debuted in MS-DOS 6.0, is installed.
  1975.  
  1976.    Dbl% = DblSpace%
  1977.  
  1978. -------
  1979. Dbl%        whether DBLSPACE is installed (0 no, -1 yes)
  1980.  
  1981. Name  : DCal                 (Direct-to-memory Calendar)
  1982. Class : Time
  1983. Level : Any
  1984.  
  1985. This routine draws a calendar for a specific month and year.
  1986. The results are placed in an array which can be displayed using
  1987. ScrRest or the other PBClone routines to restore a screen image.
  1988.  
  1989. You must supply an integer array large enough to hold the image
  1990. generated by DCal, which expects a 25x80 screen.  DIM Scrn%(1
  1991. TO 2000) will do it.  If you supply a null date, the current
  1992. date will be used.
  1993.  
  1994.    DCal Scrn%(), CalDate$
  1995.  
  1996. Scrn%()      array to hold screen image
  1997. CalDate$     date for the calendar
  1998. Page%        ignored
  1999. Fast%        ignored
  2000.  
  2001. Name  : DCalendar            (Direct-to-memory Calendar)
  2002. Class : Time
  2003. Level : Clone
  2004.  
  2005. This routine displays a calendar for a specific month and
  2006. year.  It waits for input and acts accordingly, allowing the
  2007. user to move to different dates via the arrow keys or by
  2008. entering the date directly. The bottom row of the screen gives
  2009. a list of the available key commands.
  2010.  
  2011. Screen handling is largely done by writing to an array, then
  2012. dumping the entire array to the display with DScrRest.  This
  2013. provides for very smooth displays.  You must supply an integer
  2014. array large enough to hold the image generated by DCalendar,
  2015. which expects a 25x80 screen.  DIM Scrn%(1 TO 2000) will do
  2016. it.  Only text mode is supported by this routine.
  2017.  
  2018. If you supply a null date, the current date will be used.
  2019.  
  2020.    DCalendar Scrn%(), CalDate$, Page%, Fast%
  2021.  
  2022. Scrn%()      array to hold screen image
  2023. CalDate$     date for the calendar
  2024. Page%        page on which to display (normally zero)
  2025. Fast%        whether to use fast mode (0 no)
  2026.  
  2027. Name  : DClear               (Direct-to-memory Clear)
  2028. Class : Display
  2029. Level : Any
  2030.  
  2031. The DClear routine allows you to clear a text-mode display.
  2032.  
  2033. This routine does not necessarily work on the display itself.
  2034. Instead, it allows you to specify the memory location (segment
  2035. and offset) of the "screen", which may be an actual screen, a
  2036. saved screen in an array, a multitasker's virtual screen, etc.
  2037. Among other things, this makes it easy to work with two
  2038. displays at once: use a segment of &HB000 for the mono display
  2039. and &HB800 for the color display (the offset in each case is
  2040. zero).
  2041.  
  2042.    DClear DSeg%, DOfs%, VAttr%
  2043.  
  2044. DSeg%    segment of "screen" memory
  2045. DOfs%    offset of "screen" memory
  2046. VAttr%   color/attribute to use (see CalcAttr)
  2047.  
  2048. Name  : DClearSS             (Direct Clear for Specified Size)
  2049. Class : Display
  2050. Level : Any
  2051.  
  2052. Like the CLS statement, this routine allows you to clear a text
  2053. display. However, rather than clearing the actual screen,
  2054. DClearSS clears a screen that is stored in an array.  This
  2055. allows you to design a screen in memory, then flash it onto the
  2056. display using PutScreen or a similar routine.
  2057.  
  2058. This routine is designed for a text screen of any specified
  2059. size.
  2060.  
  2061.    DClearSS DSeg%, DOfs%, VAttr%, Rows%, Columns%
  2062.  
  2063. DSeg%     segment of the array that holds the screen
  2064. DOfs%     offset of the array that holds the screen
  2065. VAttr%    color/attribute to use (see CalcAttr)
  2066. Rows%     length of the screen
  2067. Columns%  width of the screen
  2068.  
  2069. Name  : Dec2Any              (Decimal to Any base)
  2070. Class : Numeric
  2071. Level : Any
  2072.  
  2073. This routine converts a normal integer to a number in any
  2074. base.  It works like the HEX$ function in BASIC, but rather
  2075. than working only in hexadecimal (base 16), it can be used for
  2076. binary, octal, or almost anything else.
  2077.  
  2078. The result will be right-justified in the string you provide.
  2079. If you use zeroes, this allows you to ignore the NumberLen%
  2080. spec and just trim the string to the desired length, leaving
  2081. nothing worse than possible leading zeroes.
  2082.  
  2083. The length needed by the return string will vary according to
  2084. the number, with a maximum length depending on the number base
  2085. chosen.  For integers, this will be at most 16 characters
  2086. (worst case: base 2 or binary).
  2087.  
  2088.    Number$ = STRING$(16, "0")
  2089.    Dec2Any DecimalNr%, NrBase%, Number$, NumberLen%
  2090.    Number$ = RIGHT$(Number$, NumberLen%)
  2091.  
  2092. DecimalNr   integer to convert to another base
  2093. NrBase%     desired number base (2-31)
  2094. -------
  2095. Number$     resulting number in desired base (init >= 16 chars)
  2096. NumberLen%  length of the result (-1 if string too short)
  2097.  
  2098. Name  : Delay                (Delay for seconds)
  2099. Class : Time
  2100. Level : Clone
  2101.  
  2102. This routine delays for a given number of seconds.  The timing
  2103. will be the same from an 8088 PC through an 80486 AT-- it's
  2104. entirely independent of the processor.  See also Delay18th.
  2105.  
  2106.    Delay Seconds%
  2107.  
  2108. Seconds%   number of seconds for which to delay
  2109.  
  2110. Name  : Delay18th            (Delay for 1/18th seconds)
  2111. Class : Time
  2112. Level : Clone
  2113.  
  2114. This routine delays for a given number of 18ths of seconds.
  2115. The timing will be the same from an 8088 PC through an 80486
  2116. AT-- it's entirely independent of the processor.  See also
  2117. Delay.
  2118.  
  2119.    Delay WaitTime%
  2120.  
  2121. WaitTime%  number of 18ths of seconds for which to delay
  2122.  
  2123. Name  : DelayV               (Delay based on Video timing)
  2124. Class : Time
  2125. Level : Clone
  2126.  
  2127. This routine delays for a given number of milliseconds.  The
  2128. timing is based on a signal from the video adapter and may vary
  2129. somewhat depending on the adapter.  The delay is largely
  2130. independent of the cpu type and speed, however.
  2131.  
  2132. For anyone unfamiliar with the metric system: there are 1000
  2133. milliseconds in one second.  Depending on the specific display
  2134. adapter, this routine may well be fairly inaccurate; it is
  2135. intended for providing small delays for animation and similar
  2136. purposes, not as a reliable timer.
  2137.  
  2138.    DelayV MilliSeconds%
  2139.  
  2140. MilliSeconds%   number of milliseconds for which to delay
  2141.  
  2142. Name  : DelChr               (Delete Character)
  2143. Class : Display
  2144. Level : Clone
  2145.  
  2146. The DelChr routine deletes the character at the specified
  2147. screen location.
  2148.  
  2149.    DelChr Row%, Column%
  2150.  
  2151. Row%      row of character
  2152. Column%   column of character
  2153.  
  2154. Name  : DelFile              (Delete File)
  2155. Class : Disk
  2156. Level : DOS
  2157.  
  2158. This works like the DOS DEL (or ERASE) command, although it
  2159. does not allow wildcards.  The specified file is deleted.  Full
  2160. path specifications are supported, including drive and
  2161. subdirectory specs.
  2162.  
  2163.    DelFile FileName$, ErrCode%
  2164.  
  2165. FileName$   name of the file to delete
  2166. -------
  2167. ErrCode%    0 if no error, else DOS Error
  2168.  
  2169. Name  : DelLine              (Delete Line)
  2170. Class : Display
  2171. Level : BIOS
  2172.  
  2173. This routine deletes the specified row from the screen.
  2174.  
  2175.    DelLine Row%, VAttr%
  2176.  
  2177. Row%      row to delete
  2178. VAttr%    color/attr to use on new bottom row (see CalcAttr)
  2179.  
  2180. Name  : DelSub               (Delete Subdirectory)
  2181. Class : Disk
  2182. Level : DOS
  2183.  
  2184. This works like the DOS RD (or RMDIR) command.  It does not
  2185. allow wildcards. The specified subdirectory is deleted.  Note
  2186. that you may not delete a subdirectory that you're located in,
  2187. or a subdirectory which contains files, or the root directory.
  2188.  
  2189.    DelSub SubDir$, ErrCode%
  2190.  
  2191. SubDir$     name of the subdirectory to delete
  2192. -------
  2193. ErrCode%    0 if no error, else DOS Error
  2194.  
  2195. Name  : DFRead               (Direct-to-memory File Read)
  2196. Class : Disk
  2197. Level : DOS
  2198.  
  2199. This routine reads data into an array from a file that was
  2200. opened by FOpen1 or FCreate.  If it wasn't possible to read it
  2201. all from the file, an error code will be returned and the
  2202. BytesRead% value will tell you how many bytes were actually
  2203. read.
  2204.  
  2205.    DFRead Handle%, DSeg%, DOfs%, Bytes%, BytesRead%, ErrCode%
  2206.  
  2207. Handle%     handle of the file from which to read
  2208. DSeg%       segment of the array into which to read the file
  2209. DOfs%       offset of the array into which to read the file
  2210. Bytes%      number of bytes to read
  2211. -------
  2212. BytesWrit%  # of bytes actually read from the file (if error)
  2213. ErrCode%    error code: 0 if no error, else DOS Error
  2214.  
  2215. Name  : DFWrite              (Direct-from-memory File Write)
  2216. Class : Disk
  2217. Level : DOS
  2218.  
  2219. This routine writes data from an array to a file that was
  2220. opened by FOpen1 or FCreate.  If it wasn't possible to write it
  2221. all to the file, an error code will be returned and the
  2222. BytesWrit% value will tell you how many bytes were actually
  2223. written.
  2224.  
  2225.    DFWrite Handle%, DSeg%, DOfs%, Bytes%, BytesWrit%, ErrCode%
  2226.  
  2227. Handle%     handle of the file to which to write
  2228. DSeg%       segment of the data to write to the file
  2229. DOfs%       offset of the data to write to the file
  2230. Bytes%      number of bytes to write
  2231. -------
  2232. BytesWrit%  # of bytes actually written to the file (if error)
  2233. ErrCode%    error code: 0 if no error, else DOS Error
  2234.  
  2235. Name  : DGClear              (Direct-to-memory Graphics Clear)
  2236. Class : Display
  2237. Level : Any
  2238.  
  2239. This routine works like the CLS statement, clearing a CGA
  2240. graphics display. However, rather than clearing the actual
  2241. screen, DClearSS clears a screen that is stored in an array.
  2242. This allows you to design a screen in memory, then flash it
  2243. onto the display using GrafRest.
  2244.  
  2245. This routine is designed for use with SCREEN 1 or SCREEN 2 (CGA
  2246. graphics).
  2247.  
  2248.    DGClear DSeg%, DOfs%, Colour%
  2249.  
  2250. DSeg%     segment of the array that holds the screen
  2251. DOfs%     offset of the array that holds the screen
  2252. Colour%   color to use
  2253.  
  2254. Name  : DGetRec              (Direct-from-memory Get Record)
  2255. Class : String
  2256. Level : Clone
  2257.  
  2258. The DGetRec routine allows you to get a string from a specified
  2259. area of memory (numeric array, BIOS data area, display memory,
  2260. or whatever).  The string should be initialized to the desired
  2261. record length in advance.
  2262.  
  2263. This works somewhat like an array of fixed length strings or a
  2264. random file, treating memory as a contiguous series of records
  2265. of a specified length.
  2266.  
  2267.    DGetRec DSeg%, DOfs%, RecNr%, St$
  2268.  
  2269. DSeg%      segment of the array to read from
  2270. DOfs%      offset of the array to read from
  2271. RecNr%     record number (starting at 1)
  2272. -------
  2273. St$        returned string.  Init to record length (see above).
  2274.  
  2275. Name  : DGetScreen           (Direct memory Get Screen image)
  2276. Class : Display
  2277. Level : Clone
  2278.  
  2279. This routine saves any portion of the display to an array.
  2280. Only text modes are supported.  If your program uses multiple
  2281. display pages, you can get an image from any of those pages.  A
  2282. special "slow" mode is supported for the CGA, to prevent
  2283. flickering (a problem only with some CGAs).
  2284.  
  2285. The size of the integer array needed to store a specific area
  2286. of the screen can be calculated using the CalcSize routine
  2287. (see).
  2288.  
  2289. The GetScreen routine works the same way as this, but has a
  2290. simpler calling convention.  Also, if you wish to save the
  2291. entire screen, you may find ScrSave easier.
  2292.  
  2293.    DGetScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2294.       Page%, Fast%
  2295.  
  2296. DSeg%      segment of the array in which to store the image
  2297. DOfs%      offset of the array in which to store the image
  2298. TRow%      top row of the desired screen area
  2299. LCol%      left column of the desired screen area
  2300. BRow%      bottom row of the desired screen area
  2301. RCol%      right column of the desired screen area
  2302. Page%      page from which to get the display area
  2303. Fast%      whether to use fast mode (0 no)
  2304.  
  2305. Name  : DGetSt               (Direct-from-memory Get String)
  2306. Class : String
  2307. Level : Clone
  2308.  
  2309. The DGetSt routine allows you to get a string from a specified
  2310. area of memory (numeric array, BIOS data area, display memory,
  2311. or whatever).  The string should be initialized to the desired
  2312. length in advance.
  2313.  
  2314. You may specify an additional offset from the initial location,
  2315. which itself is specified as a segment and an offset.  The
  2316. second offset begins with position 1.  The combined total of
  2317. the two offsets must be under 65,536 at the moment.  I'll
  2318. remove that restriction at a later time.  With normalized
  2319. segment and offset specifications, which is usually the case,
  2320. this allows you to specify a number from 1-65,521 for the
  2321. second offset.
  2322.  
  2323.    DGetSt DSeg%, DOfs%, Posn&, St$
  2324.  
  2325. DSeg%      segment of the array to read from
  2326. DOfs%      offset of the array to read from
  2327. Posn&      location relative to the start of the array
  2328. -------
  2329. St$        returned string.  Init to # of chars desired.
  2330.  
  2331. Name  : DGQPrint             (Direct Graphics Quick Print)
  2332. Class : Display
  2333. Level : Any
  2334.  
  2335. This is a simple high-speed replacement for the PRINT statement
  2336. which works on a CGA virtual graphics screen (SCREEN 2).  It
  2337. does not interpret control codes or support graphics characters
  2338. (ASCII 128-255).
  2339.  
  2340. DGQPrint allows you to display to a CGA even if it isn't the
  2341. active display (use a segment of &HB800 and offset of 0).  Its
  2342. intended use, however, is to display to a virtual screen kept
  2343. in an array or other memory area.  The results can then be
  2344. displayed using GrafRest.
  2345.  
  2346.    DGQPrint DSeg%, DOfs%, St$, Row%, Column%
  2347.  
  2348. DSeg%    segment of CGA virtual screen
  2349. DOfs%    offset of CGA virtual screen
  2350. St$      string to display
  2351. Row%     row (1-25)
  2352. Column%  column (1-80)
  2353.  
  2354. Name  : DGXQPrint            (Direct Graphics Extended Q Print)
  2355. Class : Display
  2356. Level : Any
  2357.  
  2358. This is a simple high-speed replacement for the PRINT statement
  2359. which works on a CGA virtual graphics screen (SCREEN 1).  It
  2360. does not interpret control codes or support graphics characters
  2361. (ASCII 128-255).
  2362.  
  2363. This routine can also be used on a SCREEN 2 display, where it
  2364. will display the string in shades instead of in color (using 40
  2365. columns/row).
  2366.  
  2367. DGXQPrint allows you to display to a CGA even if it isn't the
  2368. active display (use a segment of &HB800 and offset of 0).  Its
  2369. intended use, however, is to display to a virtual screen kept
  2370. in an array or other memory area.  The results can then be
  2371. displayed using GrafRest.
  2372.  
  2373. The results of this routine are not redirectable by DOS.
  2374.  
  2375.    DGXQPrint DSeg%, DOfs%, St$, Row%, Column%, Fore%
  2376.  
  2377. DSeg%    segment of CGA virtual screen
  2378. DOfs%    offset of CGA virtual screen
  2379. St$      string to display
  2380. Row%     row (1-25)
  2381. Column%  column (1-40)
  2382. Fore%    foreground color (0-3)
  2383.  
  2384. Name  : DGXQPrint1           (Direct Graphics Extended Q Print)
  2385. Class : Display
  2386. Level : Any
  2387.  
  2388. This is a high-speed replacement for the PRINT statement which
  2389. works on a CGA virtual graphics screen (SCREEN 1). It does not
  2390. interpret control codes.
  2391.  
  2392. This routine can also be used on a SCREEN 2 display, where it
  2393. will display the string in shades instead of in color (using 40
  2394. columns/row).
  2395.  
  2396. DGXQPrint1 allows you to display to a CGA even if it isn't the
  2397. active display (use a segment of &HB800 and offset of 0).  Its
  2398. intended use, however, is to display to a virtual screen kept
  2399. in an array or other memory area.  The results can then be
  2400. displayed using GrafRest.
  2401.  
  2402. The results of this routine are not redirectable by DOS.
  2403.  
  2404.    DGXQPrint1 DSeg%, DOfs%, St$, Row%, Column%, Fore%, Back%
  2405.  
  2406. DSeg%    segment of CGA virtual screen
  2407. DOfs%    offset of CGA virtual screen
  2408. St$      string to display
  2409. Row%     row (1-25)
  2410. Column%  column (1-40)
  2411. Fore%    foreground color (0-3)
  2412. Back%    background color (0-3)
  2413.  
  2414. Name  : DInput               (Dollar Input)
  2415. Class : Input
  2416. Level : Clone
  2417.  
  2418. This routine provides formatted input of a dollar amount.  You
  2419. specify the format and an initial value (may be zero).  You may
  2420. also specify whether to allow negation-- if so, the user may
  2421. press the "-" key to toggle the number between negative and
  2422. positive.  The numeric keypad will automatically be locked into
  2423. the numeric state.  Since the decimal point is implicit, the
  2424. "." key functions as a delete or backspace operation, for
  2425. convenient one-handed data entry and correction.
  2426.  
  2427. The dollar amount is kept in a long integer as a number of
  2428. pennies, to avoid the possibility of round-off errors which
  2429. might result from use of floating point math.  The results are
  2430. returned to you both as a long integer and as a formatted
  2431. number.
  2432.  
  2433. The format string works just like a PRINT USING format string.
  2434. Editing is not as flexible as for SInput, but is quite
  2435. adequate.  The SInputSet routines will work for DInput as well
  2436. as SInput.  The ExitCode% returned is the same as for SInput,
  2437. but left and right arrows may also be returned.
  2438.  
  2439.    DInput Format$, St&, St$, MinusOk%, VAttr%, ExitCode%
  2440.  
  2441. Format$    numeric format (just like PRINT USING format)
  2442. St&        dollar amount (in pennies)
  2443. MinusOk%   whether negation is allowed (0 if no)
  2444. VAttr%     color/attribute to use (see CalcAttr)
  2445. -------
  2446. St&        dollar amount (in pennies)
  2447. St$        formatted dollar amount
  2448. ExitCode%  key used to exit (ASCII code if +, scan code if -)
  2449.  
  2450. Name  : DiskStat             (Disk Statistics)
  2451. Class : Disk
  2452. Level : DOS
  2453.  
  2454. DiskStat gives you statistics on the memory usage of a
  2455. specified disk drive: the total number of clusters, the number
  2456. of available or free clusters, the number of sectors per
  2457. cluster, and the number of bytes per sector.
  2458.  
  2459. From this information, you can determine how much total disk
  2460. space there is, how much space is left and how much is used,
  2461. the size of a cluster, et al.
  2462.  
  2463. A few formulas for you:
  2464.  
  2465.    ClusterSize% = BytesPerSec% * SecsPerClus%
  2466.    FreeSpace& = FreeClus& * ClusterSize%
  2467.    TotalSpace& = TotalClus& * ClusterSize%
  2468.    UsedSpace& = TotalSpace& - FreeSpace&
  2469.  
  2470. A "cluster" is the minimum amount of disk space that can be
  2471. allocated at a time.  A typical cluster size for a medium-sized
  2472. hard drive is 2048 bytes, which means that any file from 1-2048
  2473. bytes in length is actually taking up a full 2048 bytes on the
  2474. disk.  Large cluster sizes improve file access times but can
  2475. waste a lot of disk space.
  2476.  
  2477.    DiskStat Drive$, FreeClus&, TotalClus&, BytesPerSec%,
  2478.       SecsPerClus%
  2479.  
  2480. Drive$        letter of the drive to examine
  2481. -------
  2482. FreeClus&     number of free or available clusters
  2483. TotalClus&    total number of clusters
  2484. BytesPerSec%  bytes per sector
  2485. SecsPerClus%  sectors per cluster (-1 if bad drive, etc)
  2486.  
  2487. Name  : Dissolve             (Dissolve)
  2488. Class : Display
  2489. Level : Clone
  2490.  
  2491. Like CLS, but a bit more fancy, this routine provides an
  2492. interesting way to clear the screen.  See also FadeOut.
  2493.  
  2494. This routine may cause heavy flickering on some CGA displays.
  2495.  
  2496.    Dissolve VAttr%
  2497.  
  2498. VAttr%   color/attribute to which to clear (see CalcAttr)
  2499.  
  2500. Name  : DMPrint              (DOS Message Print)
  2501. Class : Display
  2502. Level : DOS
  2503.  
  2504. This routine is similar to PRINT, but goes through DOS output
  2505. services, which allows your program to support output
  2506. redirection, filters, CTTY and other handy things.  See
  2507. DOSInkey for a DOS input service.
  2508.  
  2509. Note that the use of DMPrint means that you should avoid using
  2510. BASIC display handling (CLS, INPUT, LINE INPUT, PRINT, LOCATE,
  2511. CSRLIN, POS, etc).  Instead, you should use ANSI escape
  2512. sequences to control the display.  This requires that an ANSI
  2513. driver (like ANSI.SYS, DVANSI.SYS, NANSI.SYS, or ZANSI.SYS) be
  2514. installed on your system.  See your DOS manual for details on
  2515. ANSI sequences, or grab the documentation on ANSI from one of
  2516. your friendly local BBSes.
  2517.  
  2518. It is -possible- to use BASIC display handling in conjunction
  2519. with DMPrint, but that tends to defeat the purpose of using
  2520. DMPrint in the first place.
  2521.  
  2522. Note that the DMPrint routine does not add a carriage
  2523. return/linefeed to the end of a string.  If you want that, add
  2524. CHR$(13) + CHR$(10) to the end of the string.
  2525.  
  2526.    DMPrint St$
  2527.  
  2528. St$    string to display
  2529.  
  2530. Name  : DOSClrEol            (DOS Clear to End Of Line)
  2531. Class : Display
  2532. Level : DOS
  2533.  
  2534. This routine clears from the cursor position to the end of the
  2535. row using DOS output functions.  It requires that ANSI.SYS or
  2536. another ANSI driver be installed.
  2537.  
  2538.    DOSClrEol
  2539.  
  2540. Name  : DOSCls               (DOS Clear Screen)
  2541. Class : Display
  2542. Level : DOS
  2543.  
  2544. This routine clears the screen using DOS output functions.  It
  2545. requires that ANSI.SYS or another ANSI driver be installed.
  2546.  
  2547.    DOSCls
  2548.  
  2549. Name  : DOSColor             (DOS Color)
  2550. Class : Display
  2551. Level : DOS
  2552.  
  2553. This routine sets the screen colors using DOS output
  2554. functions.  It requires that ANSI.SYS or another ANSI driver be
  2555. installed.
  2556.  
  2557.    DOSColor Fore%, Back%
  2558.  
  2559. Fore%    foreground color
  2560. Back%    background color
  2561.  
  2562. Name  : DOSErrM$             (DOS Error Message)
  2563. Class : Miscellaneous
  2564. Level : DOS
  2565.  
  2566. Of the many PBClone routines that return error codes, most
  2567. simply pass the code back from DOS without any processing.  You
  2568. can see what the codes mean by checking the chart in
  2569. PBClone.DOC, or it may be more convenient to use DOSErrM$
  2570. instead.  This routine returns a short text description of the
  2571. error in question.
  2572.  
  2573.    ErrMsg$ = DOSErrM$(ErrCode%)
  2574.  
  2575. ErrCode%     error code to translate
  2576. -------
  2577. ErrMsg$      brief explanation of the error
  2578.  
  2579. Name  : DOSInkey             (DOS INKEY$)
  2580. Class : Input
  2581. Level : DOS
  2582.  
  2583. This routine is similar to INKEY$, but goes through DOS input
  2584. services, which allows your program to support input
  2585. redirection, filters, CTTY and other handy things.  See DMPrint
  2586. for a DOS output service.  See also DOSInky$.
  2587.  
  2588.    DOSInkey CharCode%, CharType%
  2589.  
  2590. -------
  2591. CharType%    0 if no key, 1 if normal key, 2 if extended key
  2592. CharCode%    ASCII code if normal key, scan code if extended key
  2593.  
  2594. Name  : DOSInky$             (DOS INKEY$)
  2595. Class : Input
  2596. Level : DOS
  2597.  
  2598. This routine works just like INKEY$, but goes through DOS input
  2599. services, which allows your program to support input
  2600. redirection, filters, CTTY and other handy things.  See DMPrint
  2601. for a DOS output service.  See also DOSInkey.
  2602.  
  2603.    ky$ = DOSInky$
  2604.  
  2605. -------
  2606. ky$      key, if any was waiting (0-2 chars/key, like INKEY$)
  2607.  
  2608. Name  : DOSInt%              (DOS Interrupt)
  2609. Class : Miscellaneous
  2610. Level : DOS
  2611.  
  2612. This routine provides you with easy access to DOS functions via
  2613. INT 21H, the major DOS interrupt.  It works like the CALL
  2614. INTERRUPT routines provided with QuickBASIC but is easier to
  2615. use, at the expense of some flexibility.
  2616.  
  2617. CAUTION: This routine works directly with DOS, bypassing most
  2618. of BASIC's safety precautions.  Possible chaos may result if
  2619. you don't know what you're doing!  A few specific caveats:
  2620.  
  2621.    1) Do Not use this routine to exit your program or execute
  2622.       another.  BASIC needs to clean up after itself before
  2623.       these tasks, and bypassing its handling is liable to make
  2624.       the system unstable at best.
  2625.  
  2626.    2) If you expect to use a string or array as a buffer, make
  2627.       sure it is long enough to handle the maximum amount of
  2628.       information anticipated. Strings and arrays can move
  2629.       about in memory, so be sure to get their addresses Just
  2630.       Before using DOSInt%.
  2631.  
  2632. If you wish to specify BASIC's data segment for DS, you can
  2633. find out what that is using the DataSeg routine (q.v.).
  2634.  
  2635. Normally, the CarryFlag% will be set if there is an error, in
  2636. which case AX will return the error code.
  2637.  
  2638.    CarryFlag% = DOSInt%(AX%, BX%, CX%, DX%, DS%)
  2639.  
  2640. AX%         desired setting of the AX register
  2641. BX%         desired setting of the BX register
  2642. CX%         desired setting of the CX register
  2643. DX%         desired setting of the DX register
  2644. DS%         desired setting of the DS and ES registers
  2645. -------
  2646. AX%         returned setting of the AX register
  2647. BX%         returned setting of the BX register
  2648. CX%         returned setting of the CX register
  2649. DX%         returned setting of the DX register
  2650. DS%         returned setting of the DS and ES registers
  2651. CarryFlag%  returned carry flag (0 no error, else code in AX)
  2652.  
  2653. Name  : DOSLocate            (DOS Locate)
  2654. Class : Display
  2655. Level : DOS
  2656.  
  2657. This routine sets the cursor position using DOS output
  2658. functions.  It requires that ANSI.SYS or another ANSI driver be
  2659. installed.
  2660.  
  2661. Note that many ANSI drivers do not fully support EGA or VGA
  2662. modes in that they are limited to a maximum of 25 rows.
  2663.  
  2664.    DOSLocate Row%, Column%
  2665.  
  2666. Row%      row
  2667. Column%   column
  2668.  
  2669. Name  : DPutRec              (Direct-to-memory Put Record)
  2670. Class : String
  2671. Level : Clone
  2672.  
  2673. The DPutRec routine allows you to put a string into a specified
  2674. area of memory (numeric array, BIOS data area, display memory,
  2675. or whatever).  The string should be initialized to the desired
  2676. record length in advance.
  2677.  
  2678. This works somewhat like an array of fixed length strings or a
  2679. random file, treating memory as a contiguous series of records
  2680. of a specified length.
  2681.  
  2682.    DPutRec DSeg%, DOfs%, RecNr%, St$
  2683.  
  2684. DSeg%      segment of the array to write into
  2685. DOfs%      offset of the array to write into
  2686. RecNr%     record number (starting at 1)
  2687. St$        string to write.  Init to record length (see above).
  2688.  
  2689. Name  : DPutScreen           (Direct-from-memory Put Screen)
  2690. Class : Display
  2691. Level : Clone
  2692.  
  2693. This routine restores a portion of the display (which was saved
  2694. to an array by DGetScreen or GetScreen) to the screen.  Only
  2695. text modes are supported. If your program uses multiple display
  2696. pages, you can put the image onto any of those pages.  A
  2697. special "slow" mode is supported for the CGA, to prevent
  2698. flickering (a problem only with some CGAs).
  2699.  
  2700. The PutScreen routine works the same way as this, but has a
  2701. simpler calling convention.  Also, if you wish to restore the
  2702. entire screen, you may find ScrRest easier (see).
  2703.  
  2704.    DPutScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2705.       Page%, Fast%
  2706.  
  2707. DSeg%      segment of the array from which to restore the image
  2708. DOfs%      offset of the array from which to restore the image
  2709. TRow%      top row of the desired screen area
  2710. LCol%      left column of the desired screen area
  2711. BRow%      bottom row of the desired screen area
  2712. RCol%      right column of the desired screen area
  2713. Page%      page on which to restore the display
  2714. Fast%      whether to use fast mode (0 no)
  2715.  
  2716. Name  : DPutSt               (Direct-to-memory Put String)
  2717. Class : String
  2718. Level : Clone
  2719.  
  2720. The DPutSt routine allows you to put a string into a specified
  2721. area of memory (numeric array, BIOS data area, display memory,
  2722. or whatever).
  2723.  
  2724. You may specify an additional offset from the initial location,
  2725. which itself is specified as a segment and an offset.  The
  2726. second offset begins with position 1.  The combined total of
  2727. the two offsets must be under 65,536 at the moment.  I'll
  2728. remove that restriction at a later time.  With normalized
  2729. segment and offset specifications, which is usually the case,
  2730. this allows you to specify a number from 1-65,521 for the
  2731. second offset.
  2732.  
  2733.    DPutSt DSeg%, DOfs%, Posn&, St$
  2734.  
  2735. DSeg%      segment of the array to write to
  2736. DOfs%      offset of the array to write to
  2737. Posn&      location relative to the start of the array
  2738. St$        string to write into memory
  2739.  
  2740. Name  : DReadAbs             (Disk Read Absolute)
  2741. Class : Disk
  2742. Level : DOS
  2743.  
  2744. This routine reads an absolute disk sector.  This is about as
  2745. low-level as you can get-- the disk is read directly at the
  2746. byte level, bypassing higher-level notions like filenames and
  2747. directories.
  2748.  
  2749. The DReadAbs routine works with any version of DOS, but will
  2750. not work properly with disk partitions of over 32 megabytes.
  2751. If you need to work with large disks, see the DReadAbsBig
  2752. routine.
  2753.  
  2754. The results from the read will be stored in an array or other
  2755. memory area you specify.  Be sure to make the area large enough
  2756. to hold everything!  A sector is usually 512 bytes, but you can
  2757. use the DiskStat routine to make sure. Logical sector numbering
  2758. is used, with sector numbers beginning at zero.
  2759.  
  2760.    DReadAbs Drive$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  2761.  
  2762. Drive$     drive letter
  2763. Sector&    starting sector (0-65534 [or less on most disks])
  2764. DSeg%      segment of the array
  2765. DOfs%      offset of the array
  2766. Sectors%   number of sectors to read
  2767. -------
  2768. ErrCode%   error code (0 if no error, else DOS error code)
  2769.  
  2770. Name  : DReadAbsBig          (Disk Read Absolute, Big)
  2771. Class : Disk
  2772. Level : DOS
  2773.  
  2774. This routine reads an absolute disk sector.  This is about as
  2775. low-level as you can get-- the disk is read directly at the
  2776. byte level, bypassing higher-level notions like filenames and
  2777. directories.
  2778.  
  2779. The DReadAbsBig routine works with DOS 3.31 and later.  It will
  2780. work on disks of any size.  If a limit of 32M is sufficient,
  2781. you might prefer the DReadAbs routine, which works with any DOS
  2782. version.
  2783.  
  2784. The results from the read will be stored in an array or other
  2785. memory area you specify.  Be sure to make the area large enough
  2786. to hold everything!  A sector is usually 512 bytes, but you can
  2787. use the DiskStat routine to make sure. Logical sector numbering
  2788. is used, with sector numbers beginning at zero.
  2789.  
  2790.    DReadAbsBig Driv$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  2791.  
  2792. Driv$      drive letter
  2793. Sector&    starting sector (0-65534 [or less on most disks])
  2794. DSeg%      segment of the array
  2795. DOfs%      offset of the array
  2796. Sectors%   number of sectors to read
  2797. -------
  2798. ErrCode%   error code (0 if no error, else DOS error code)
  2799.  
  2800. Name  : DRecDel              (Direct-to-memory Record Deletion)
  2801. Class : Array management
  2802. Level : Any
  2803.  
  2804. This routine allows you to delete an item from an array.  The
  2805. item may consist of one or more array elements.  The size of
  2806. the array isn't actually changed, but the array elements are
  2807. moved as if a deletion took place.
  2808.  
  2809.    DRecDel DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2810.  
  2811. DSeg%      segment of the array
  2812. DOfs%      offset of the array
  2813. RecNr%     record/element number (starting at 1)
  2814. RecLen%    record/element length in bytes
  2815. Records%   total number of records/elements in the array
  2816.  
  2817. Name  : DRecIns              (Direct-to-mem Record Insertion)
  2818. Class : Array management
  2819. Level : Any
  2820.  
  2821. This routine allows you to insert an item into an array.  The
  2822. item may consist of one or more array elements.  The size of
  2823. the array isn't actually changed, but the array elements are
  2824. moved as if an insertion took place.  You must of course make
  2825. sure that the array is DIMed large enough to handle this.
  2826.  
  2827.    DRecIns DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2828.  
  2829. DSeg%      segment of the array
  2830. DOfs%      offset of the array
  2831. RecNr%     record/element number (starting at 1)
  2832. RecLen%    record/element length in bytes
  2833. Records%   total number of records/elements in the array
  2834.  
  2835. Name  : DRecolor             (Direct-to-memory Recolor)
  2836. Class : Display
  2837. Level : Any
  2838.  
  2839. The DRecolor routine changes all text in one color to another
  2840. color.  It works only in text modes.  The colors are specified
  2841. as attributes (see CalcAttr).
  2842.  
  2843. This routine does not necessarily work on the display itself.
  2844. Instead, it allows you to specify the memory location (segment
  2845. and offset) of the "screen", which may be an actual screen, a
  2846. saved screen in an array, a multitasker's virtual screen, etc.
  2847. Among other things, this makes it easy to work with two
  2848. displays at once: use a segment of &HB000 for the mono display
  2849. and &HB800 for the color display (the offset in each case is
  2850. zero).
  2851.  
  2852.    DRecolor DSeg%, DOfs%, OldAttr%, NewAttr%
  2853.  
  2854. DSeg%      segment of "screen" memory
  2855. DOfs%      offset of "screen" memory
  2856. OldAttr%   color to be changed
  2857. NewAttr%   color to which to change
  2858.  
  2859. Name  : DRecolorArea         (Direct-to-memory Recolor Area)
  2860. Class : Display
  2861. Level : Clone
  2862.  
  2863. The DRecolorArea routine changes a specified area of the screen
  2864. to a specified color.  It works only in text modes.  The color
  2865. is specified as an attribute (see CalcAttr).
  2866.  
  2867. One of the more common applications for this routine is marking
  2868. an area of the screen, e.g. menu highlight bars.
  2869.  
  2870.    DRecolorArea DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  2871.      VAttr%
  2872.  
  2873. This routine does not necessarily work on the display itself.
  2874. Instead, it allows you to specify the memory location (segment
  2875. and offset) of the "screen", which may be an actual screen, a
  2876. saved screen in an array, a multitasker's virtual screen, etc.
  2877. Among other things, this makes it easy to work with two
  2878. displays at once: use a segment of &HB000 for the mono display
  2879. and &HB800 for the color display (the offset in each case is
  2880. zero).
  2881.  
  2882. DSeg%       segment of "screen" memory
  2883. DOfs%       offset of "screen" memory
  2884. TRow%       top row of area to recolor
  2885. LCol%       left column of area to recolor
  2886. BRow%       bottom row of area to recolor
  2887. RCol%       right column of area to recolor
  2888. VAttr%      desired color
  2889.  
  2890. Name  : DriveSpace&          (Drive Space free)
  2891. Class : Disk
  2892. Level : DOS
  2893.  
  2894. This routine tells you how many bytes are free on a specified
  2895. disk drive.
  2896.  
  2897.    BytesFree& = DriveSpace&(Drive$)
  2898.  
  2899. Drive$      letter of the drive to examine
  2900. -------
  2901. BytesFree&  free bytes on the specified drive, or -1 if error
  2902.  
  2903. Name  : DrvSpaceL            (Drive Space free as Long integer)
  2904. Class : Disk
  2905. Level : DOS
  2906.  
  2907. This routine tells you how many bytes are free on a specified
  2908. disk drive. See also DriveSpace, a function-type version of
  2909. this routine.
  2910.  
  2911.    DrvSpaceL Drive$, BytesFree&
  2912.  
  2913. Drive$      letter of the drive to examine
  2914. -------
  2915. BytesFree&  free bytes on the specified drive, or -1 if error
  2916.  
  2917. Name  : DrvType              (Drive Type)
  2918. Class : Disk
  2919. Level : DOS 3.1+
  2920.  
  2921. The DrvType routine tells you whether a specified drive is
  2922. fixed or removeable, and whether it is local or remote (network
  2923. drive).
  2924.  
  2925.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  2926.  
  2927. Drive$       letter of the drive to examine
  2928. -------
  2929. Removeable%  whether the disk can be removed (0 if no)
  2930. Remote%      whether this is a remote drive (0 if no)
  2931. ErrCode%     error code: 0 if none, else bad DOS version
  2932.  
  2933. Name  : DScrRest             (Direct-from-mem Screen Restore)
  2934. Class : Display
  2935. Level : Clone
  2936.  
  2937. The DScrRest routine restores a display that was saved using
  2938. ScrSave or a similar routine.  It only works in text modes.
  2939. See also ScrRest.
  2940.  
  2941.    DScrRest DSeg%, DOfs%, Page%, Fast%
  2942.  
  2943. DSeg%      segment of info to restore to the screen
  2944. DOfs%      offset of info to restore to the screen
  2945. Page%      page on which to restore the display
  2946. Fast%      whether to use fast mode (0 no)
  2947.  
  2948. Name  : DScrSave             (Direct-from-memory Screen Save)
  2949. Class : Display
  2950. Level : Clone
  2951.  
  2952. The DScrSave routine saves the display to an array or other
  2953. storage area. Only text modes are supported.  For an 80x25
  2954. display, the array must hold 4,000 bytes (4,000 string
  2955. characters or 2,000 integers).  See also ScrSave.
  2956.  
  2957.    DScrSave DSeg%, DOfs%, Page%, Fast%
  2958.  
  2959. DSeg%      segment of place to store the display
  2960. DOfs%      offset of place to store the display
  2961. Page%      page from which to get the display
  2962. Fast%      whether to use fast mode (0 no)
  2963.  
  2964. Name  : DTR                  (Data Terminal Ready signal)
  2965. Class : Serial
  2966. Level : Clone
  2967.  
  2968. Just as IBM provided the standard for personal computers, Hayes
  2969. provided the standard for modem commands.  Unfortunately, the
  2970. command method of dropping carrier (hanging up the phone) was
  2971. badly designed, and all Hayes-compatible modems have a hard
  2972. time recognizing that command under certain line conditions.
  2973.  
  2974. Fortunately, there's a more reliable way of hanging up: the DTR
  2975. serial signal.  Turning this signal off will cause the modem to
  2976. hang up very quickly.  Most Hayes-compatible modems are
  2977. factory-set to pay attention to the DTR; those that aren't can
  2978. be made to do so either by flipping a hardware switch or with a
  2979. special initialization command.  See your modem manual for
  2980. details.
  2981.  
  2982. BASIC will drop the DTR when you CLOSE the comm port, but this
  2983. isn't always a convenient way to do it.  As a matter of fact,
  2984. this can be a decided nuisance, so many people have patched
  2985. their version of BASIC to avoid it.  If you would like to do
  2986. so, check your local BBS for the method!  With the PBClone DTR
  2987. routine, you can get full control over the DTR without having
  2988. to CLOSE the comm port.
  2989.  
  2990. Note: it may be wise to include a brief delay after dropping
  2991. the DTR, to give the modem a chance to react.  Try Delay18th
  2992. (see) with a wait of around 4.
  2993.  
  2994.    DTR CommPort%, TurnOn%
  2995.  
  2996. CommPort%    serial port (1-4, though BASIC only handles 1-2)
  2997. TurnOn%      whether to raise (turn on) the DTR (0 if no)
  2998.  
  2999. Name  : DupeVar              (Duplicate Variable)
  3000. Class : Miscellaneous
  3001. Level : Any
  3002.  
  3003. This routine allows you to copy the contents of one variable
  3004. into another, even if the variables are not of the same type.
  3005. You may specify any variable type EXCEPT variable-length
  3006. strings: integer, long integer, single, double, fixed-length
  3007. string, TYPEd variable, etc.
  3008.  
  3009. Most languages that provide TYPEd variables also provide for
  3010. variant records, that is, more than one way of looking at the
  3011. same information.  Curiously, BASIC doesn't.  This routine
  3012. allows you to map one variable into another, essentially
  3013. providing the lacking capability.
  3014.  
  3015. The only caveat for DupeVar is that both variables must be the
  3016. same length in bytes.
  3017.  
  3018.    DupeVar FromVar, ToVar
  3019.  
  3020. FromVar     variable from which to copy
  3021. -------
  3022. ToVar       variable to which to copy
  3023.  
  3024. Name  : DWindowMan2          (Direct-to-memory Window Manager)
  3025. Class : Display
  3026. Level : Any
  3027.  
  3028. This routine is identical to DWindowManager but for the fact
  3029. that it allows you to design your own custom window frames.
  3030. Please see the description of DWindowManager for general
  3031. information.
  3032.  
  3033. These are the additional frame types:
  3034.     6   custom frame composed of a single character
  3035.     7   custom frame composed of the specified 7-character list:
  3036.         top left corner, top middle, top right corner,
  3037.         left middle, right middle,
  3038.         bottom left corner, bottom middle, bottom right corner
  3039.  
  3040.  /------------------------------------------------------------\
  3041.  | A custom frame like this would be defined as frame type 7, |
  3042.  | with a frame string of "/-\||\-/", for instance.           |
  3043.  \------------------------------------------------------------/
  3044.  
  3045.  *************************************************
  3046.  * On the other hand, a frame like this would be *
  3047.  * frame type 6, with a frame string of "*".     *
  3048.  *************************************************
  3049.  
  3050. Note that this routine differs from the ProBas equivalent in
  3051. that it supports full frame definitions through frame type 7
  3052. (ProBas only supports type 6). The other differences mentioned
  3053. under WindowManager are also relevant.
  3054.  
  3055.    DWindowMan2 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  3056.       Frame%, FSt$, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  3057.  
  3058. DSeg%       segment of "screen" memory
  3059. DOfs%       offset of "screen" memory
  3060. TRow%       top row of window
  3061. LCol%       left column of window
  3062. BRow%       bottom row of window
  3063. RCol%       right column of window
  3064. Frame%      frame type (see above)
  3065. FSt$        frame definition string (see above)
  3066. Fore%       frame foreground color
  3067. Back%       frame background color
  3068. Grow%       window growing option (see above)
  3069. Shade%      window shadow option (see above)
  3070. TFore%      title foreground color
  3071. Title$      window title ("" if none)
  3072.  
  3073. Name  : DWindowMan3          (Direct-to-memory Window Manager)
  3074. Class : Display
  3075. Level : Any
  3076.  
  3077. This routine is identical in function to DWindowManager.  The
  3078. parameters are mostly passed as an array, however, instead of
  3079. one by one.  Please see the description of DWindowManager for
  3080. general information.
  3081.  
  3082.    DWindowMan3 Parm%(), Title$
  3083.  
  3084. DSeg%       segment of "screen" memory
  3085. DOfs%       offset of "screen" memory
  3086. Parm%(1)    top row of window
  3087. Parm%(2)    left column of window
  3088. Parm%(3)    bottom row of window
  3089. Parm%(4)    right column of window
  3090. Parm%(5)    frame type (see above)
  3091. Parm%(6)    frame foreground color
  3092. Parm%(7)    frame background color
  3093. Parm%(8)    window growing option (see above)
  3094. Parm%(9)    window shadow option (see above)
  3095. Parm%(10)   title foreground color
  3096. Title$      window title ("" if none)
  3097.  
  3098. Name  : DWindowMan4          (Direct-to-memory Window Manager)
  3099. Class : Display
  3100. Level : Any
  3101.  
  3102. This is an extremely cut-down version of DWindowManager,
  3103. providing no more than a simple frame generator.
  3104.  
  3105. These are the available frame types:
  3106.     0   no frame
  3107.     1   single lines
  3108.     2   double lines
  3109.     3   single horizontal, double vertical lines
  3110.     4   double horizontal, single vertical lines
  3111.     5   block graphic lines
  3112.  
  3113. Note that this routine is different from its ProBas equivalent
  3114. in that a new frame type (5) is available.
  3115.  
  3116.    DWindowMan4 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  3117.       Frame%, VAttr%
  3118.  
  3119. DSeg%       segment of "screen" memory
  3120. DOfs%       offset of "screen" memory
  3121. TRow%       top row of window
  3122. LCol%       left column of window
  3123. BRow%       bottom row of window
  3124. RCol%       right column of window
  3125. Frame%      frame type (see above)
  3126. VAttr%      frame color/attribute (use CalcAttr)
  3127.  
  3128. Name  : DWindowManager       (Direct-to-memory Window Manager)
  3129. Class : Display
  3130. Level : Any
  3131.  
  3132. DWindowManager displays a pop-up window according to your
  3133. specifications. The window may have any of a variety of frames,
  3134. a title, or a shadow, and it may appear instantly or "grow"
  3135. onto the screen.
  3136.  
  3137. These are the available frame types:
  3138.     0   no frame
  3139.     1   single lines
  3140.     2   double lines
  3141.     3   single horizontal, double vertical lines
  3142.     4   double horizontal, single vertical lines
  3143.     5   block graphic lines
  3144.  
  3145. These are the available shadows:
  3146.    -3   transparent shadow on the right
  3147.    -2   transparent shadow on the left
  3148.    -1   solid black shadow on the left
  3149.     0   no shadow
  3150.    1+   shadow attribute (use CalcAttr) for a colored shadow
  3151.  
  3152. Options for growing windows are as follows:
  3153.    -1   grow as fast as possible
  3154.     0   pop onto the screen
  3155.    1+   grow with delay given in milliseconds (15 works for me)
  3156.  
  3157. Note that this routine is different from its ProBas equivalent
  3158. in a number of respects.  The grow delay time is different.
  3159. Growing is done more smoothly. The shadow and title parameters
  3160. are not changed by this routine.  A new frame type (5) was
  3161. added.  If a title is too long, it is truncated instead of
  3162. being ignored completely.  Using a -1 as the title foreground
  3163. color will not turn off the title; instead, use a null title
  3164. string.
  3165.  
  3166.    DWindowManager DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  3167.       Frame%, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  3168.  
  3169. This routine does not necessarily work on the display itself.
  3170. Instead, it allows you to specify the memory location (segment
  3171. and offset) of the "screen", which may be an actual screen, a
  3172. saved screen in an array, a multitasker's virtual screen, etc.
  3173. Among other things, this makes it easy to work with two
  3174. displays at once: use a segment of &HB000 for the mono display
  3175. and &HB800 for the color display (the offset in each case is
  3176. zero).
  3177.  
  3178. DSeg%       segment of "screen" memory
  3179. DOfs%       offset of "screen" memory
  3180. TRow%       top row of window
  3181. LCol%       left column of window
  3182. BRow%       bottom row of window
  3183. RCol%       right column of window
  3184. Frame%      frame type (see above)
  3185. Fore%       frame foreground color
  3186. Back%       frame background color
  3187. Grow%       window growing option (see above)
  3188. Shade%      window shadow option (see above)
  3189. TFore%      title foreground color
  3190. Title$      window title ("" if none)
  3191.  
  3192. Name  : DWriteAbs             (Disk Write Absolute)
  3193. Class : Disk
  3194. Level : DOS
  3195.  
  3196. This routine writes an absolute disk sector.  This is about as
  3197. low-level as you can get-- the disk is written directly at the
  3198. byte level, bypassing higher-level notions like filenames and
  3199. directories.  This is DANGEROUS!  If you screw up, DOS may not
  3200. be able to read the disk any more, and it may need to be
  3201. reformatted.  Back up your data before trying this routine!
  3202.  
  3203. The DWriteAbs routine works with any version of DOS, but will
  3204. not work properly with disk partitions of over 32 megabytes.
  3205. If you need to work with large disks, see the DWriteAbsBig
  3206. routine.
  3207.  
  3208. The write will be done from an array or other memory area you
  3209. specify.  Be sure to make the area the right size!  A sector is
  3210. usually 512 bytes, but you can use the DiskStat routine to make
  3211. sure.  Logical sector numbering is used, with sector numbers
  3212. beginning at zero.
  3213.  
  3214.    DWriteAbs Drive$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  3215.  
  3216. Drive$     drive letter
  3217. Sector&    starting sector (0-65534 [or less on most disks])
  3218. DSeg%      segment of the array
  3219. DOfs%      offset of the array
  3220. Sectors%   number of sectors to write
  3221. -------
  3222. ErrCode%   error code (0 if no error, else DOS error code)
  3223.  
  3224. Name  : DWriteAbsBig          (Disk Write Absolute, Big)
  3225. Class : Disk
  3226. Level : DOS
  3227.  
  3228. This routine writes an absolute disk sector.  This is about as
  3229. low-level as you can get-- the disk is written directly at the
  3230. byte level, bypassing higher-level notions like filenames and
  3231. directories.  This is DANGEROUS!  If you screw up, DOS may not
  3232. be able to read the disk any more, and it may need to be
  3233. reformatted.  Back up your data before trying this routine!
  3234.  
  3235. The DWriteAbsBig routine works with DOS 3.31 and later.  It will
  3236. work on disks of any size.  If a limit of 32M is sufficient,
  3237. you might prefer the DWriteAbs routine, which works with any DOS
  3238. version.
  3239.  
  3240. The write will be done from an array or other memory area you
  3241. specify.  Be sure to make the area the right size!  A sector is
  3242. usually 512 bytes, but you can use the DiskStat routine to make
  3243. sure.  Logical sector numbering is used, with sector numbers
  3244. beginning at zero.
  3245.  
  3246.    DWriteAbsBig Drv$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  3247.  
  3248. Drv$       drive letter
  3249. Sector&    starting sector (0-65534 [or less on most disks])
  3250. DSeg%      segment of the array
  3251. DOfs%      offset of the array
  3252. Sectors%   number of sectors to write
  3253. -------
  3254. ErrCode%   error code (0 if no error, else DOS error code)
  3255.  
  3256. Name  : DXQPrint             (Direct Extended Quick Print)
  3257. Class : Display
  3258. Level : Any
  3259.  
  3260. This routine provides a rather crude, but very fast, display
  3261. capability.  It works like the PRINT statement in BASIC, except
  3262. that it doesn't move the cursor or process control codes.  It
  3263. works only in text modes.
  3264.  
  3265. This routine does not necessarily work on the display itself.
  3266. Instead, it allows you to specify the memory location (segment
  3267. and offset) of the "screen", which may be an actual screen, a
  3268. saved screen in an array, a multitasker's virtual screen, etc.
  3269. Among other things, this makes it easy to work with two
  3270. displays at once: use a segment of &HB000 for the mono display
  3271. and &HB800 for the color display (the offset in each case is
  3272. zero).
  3273.  
  3274. The results of this routine are not redirectable by DOS.
  3275.  
  3276.    DXQPrint DSeg%, DOfs%, St$, Row%, Column%, VAttr%
  3277.  
  3278. DSeg%     segment of "screen" memory
  3279. DOfs%     offset of "screen" memory
  3280. St$       string to display
  3281. Row%      starting row
  3282. Column%   starting column
  3283. VAttr%    color/attribute (see CalcAttr)
  3284.  
  3285. Name  : EGARest7             (EGA Restore for SCREEN 7)
  3286. Class : Display
  3287. Level : Clone
  3288.  
  3289. This routine allows you to restore a SCREEN 7 (EGA, 320x200, 16
  3290. color) display that was saved using EGASave7 (see).
  3291.  
  3292.    EGARest7 DSeg%, DOfs%
  3293.  
  3294. DSeg%        segment of storage array, returned by VARSEG
  3295. DOfs%        offset  of storage array, returned by VARPTR
  3296.  
  3297. Name  : EGARest8             (EGA Restore for SCREEN 8)
  3298. Class : Display
  3299. Level : Clone
  3300.  
  3301. This routine allows you to restore a SCREEN 8 (EGA, 640x200, 16
  3302. color) display that was saved using EGASave8 (see).
  3303.  
  3304.    EGARest8 DSeg%, DOfs%
  3305.  
  3306. DSeg%        segment of storage array, returned by VARSEG
  3307. DOfs%        offset  of storage array, returned by VARPTR
  3308.  
  3309. Name  : EGARest9             (EGA Restore for SCREEN 9)
  3310. Class : Display
  3311. Level : Clone
  3312.  
  3313. This routine allows you to restore a SCREEN 9 (EGA, 640x350, 16
  3314. color) display that was saved using EGASave9 (see).
  3315.  
  3316.    EGARest9 DSeg1%, DOfs1%, DSeg2%, DOfs2%
  3317.  
  3318. DSeg1%       segment of storage array #1, returned by VARSEG
  3319. DOfs1%       offset  of storage array #1, returned by VARPTR
  3320. DSeg2%       segment of storage array #2, returned by VARSEG
  3321. DOfs2%       offset  of storage array #2, returned by VARPTR
  3322.  
  3323. Name  : EGASave7             (EGA Save for SCREEN 7)
  3324. Class : Display
  3325. Level : Clone
  3326.  
  3327. This routine allows you to save a SCREEN 7 (EGA, 320x200, 16
  3328. color) display that can be restored using EGARest7 (see).
  3329.  
  3330. The array used to hold the screen must contain 32,000 bytes.
  3331. For an integer array, this means that you must create the array
  3332. by DIM Array%(1 TO 16000).
  3333.  
  3334.    EGASave7 DSeg%, DOfs%
  3335.  
  3336. DSeg%        segment of storage array, returned by VARSEG
  3337. DOfs%        offset  of storage array, returned by VARPTR
  3338.  
  3339. Name  : EGASave8             (EGA Save for SCREEN 8)
  3340. Class : Display
  3341. Level : Clone
  3342.  
  3343. This routine allows you to save a SCREEN 8 (EGA, 640x200, 16
  3344. color) display that can be restored using EGARest8 (see).
  3345.  
  3346. The array used to hold the screen must contain 64,000 bytes.
  3347. For an integer array, this means that you must create the array
  3348. by DIM Array%(1 TO 32000).
  3349.  
  3350.    EGASave8 DSeg%, DOfs%
  3351.  
  3352. DSeg%        segment of storage array, returned by VARSEG
  3353. DOfs%        offset  of storage array, returned by VARPTR
  3354.  
  3355. Name  : EGASave9             (EGA Save for SCREEN 9)
  3356. Class : Display
  3357. Level : Clone
  3358.  
  3359. This routine allows you to save a SCREEN 9 (EGA, 640x350, 16
  3360. color) display that can be restored using EGARest9 (see).
  3361.  
  3362. Two arrays must be used to hold the screen, for a total of
  3363. 112,000 bytes.  If you use integer arrays, each array must be
  3364. created by DIM Array%(1 TO 28000).
  3365.  
  3366.    EGASave9 DSeg%, DOfs%
  3367.  
  3368. DSeg1%       segment of storage array #1, returned by VARSEG
  3369. DOfs1%       offset  of storage array #1, returned by VARPTR
  3370. DSeg2%       segment of storage array #2, returned by VARSEG
  3371. DOfs2%       offset  of storage array #2, returned by VARPTR
  3372.  
  3373. Name  : Elapsed              (Elapsed time)
  3374. Class : Time
  3375. Level : Any
  3376.  
  3377. This routine tells you the amount of time elapsed between a
  3378. given starting time and ending time.  The difference between
  3379. the times must be less than 24 hours for the results to be
  3380. meaningful.
  3381.  
  3382. See also ElapsedTime, the FUNCTION version of this routine.
  3383.  
  3384.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  3385.  
  3386. TimeStart$   starting time
  3387. TimeStop$    ending time
  3388. -------
  3389. TimeDiff$    elapsed time
  3390.  
  3391. Name  : ElapsedTime$         (Elapsed time)
  3392. Class : Time
  3393. Level : Any
  3394.  
  3395. This routine tells you the amount of time elapsed between a
  3396. given starting time and ending time.  The difference between
  3397. the times must be less than 24 hours for the results to be
  3398. meaningful.
  3399.  
  3400. See also Elapsed, the SUB version of this routine.
  3401.  
  3402.    TimeDiff$ = ElapsedTime$(TimeStart$, TimeStop$)
  3403.  
  3404. TimeStart$   starting time
  3405. TimeStop$    ending time
  3406. -------
  3407. TimeDiff$    elapsed time
  3408.  
  3409. Name  : EMSBuffer            (EMS Buffer size)
  3410. Class : Memory
  3411. Level : BIOS
  3412.  
  3413. EMSBuffer tells you how many bytes are needed to save the state
  3414. of the EMS array routines.  Used in conjunction with EMSSave
  3415. and EMSRest, it allows you to preserve EMS arrays across a
  3416. CHAIN to another part of your program.
  3417.  
  3418.    EMSBuffer Bytes%
  3419.    EMSState$ = SPACE$(Bytes%)
  3420.    EMSSave EMSState$
  3421.  
  3422. -------
  3423. Bytes%       bytes needed to save EMS array state
  3424.  
  3425. Name  : EMSClose             (EMS Close)
  3426. Class : Memory
  3427. Level : BIOS
  3428.  
  3429. The EMSClose routine is used when you are finished with an EMS
  3430. array.  It frees the array handle and EMS memory for other
  3431. uses.  If you don't close all EMS arrays before your program
  3432. ends, the memory will be lost until the system is rebooted, so
  3433. it is important to remember EMSClose.
  3434.  
  3435.    EMSClose ArrayHandle%
  3436.  
  3437. ArrayHandle%    handle of an EMS array
  3438.  
  3439. Name  : EMSGet               (EMS Get)
  3440. Class : Memory
  3441. Level : BIOS
  3442.  
  3443. This routine gets an element from an EMS array created by
  3444. EMSOpen.  Element numbers start at 0.  Be sure to use the right
  3445. numeric type for the array-- for instance, if you opened the
  3446. array for SINGLE precision, use "Value!".
  3447.  
  3448.    EMSGet ArrayHandle%, ElementNr&, Value
  3449.  
  3450. ArrayHandle%    handle of an EMS array
  3451. ElementNr&      element number to get
  3452. -------
  3453. Value           result (must be correct type for array)
  3454.  
  3455. Name  : EMSOpen              (EMS Open)
  3456. Class : Memory
  3457. Level : BIOS
  3458.  
  3459. This routine allows you to open a block of EMS (expanded)
  3460. memory which can then be accessed like a numeric array.  The
  3461. array size is limited only by available EMS memory (use GetLIMM
  3462. to find out how much is available).  You may specify any
  3463. numeric type:
  3464.  
  3465.     1   INTEGER
  3466.     2   LONG or SINGLE
  3467.     3   DOUBLE
  3468.  
  3469. When the array is opened, you are returned an "array handle"
  3470. which is used to access that array.  Access to the array is
  3471. done via EMSGet and EMSPut.  When you are finished with the
  3472. array, you must close it with EMSClose.
  3473.  
  3474. As many as 25 EMS arrays can be in use at one time, subject to
  3475. limitations which may be imposed by your EMS driver (each array
  3476. requires one EMS handle).
  3477.  
  3478.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  3479.  
  3480. Elements&       number of elements in array (like DIM size)
  3481. ElementType%    numeric type of array (see above)
  3482. -------
  3483. ArrayHandle%    handle of an EMS array
  3484. ErrCode%        whether an error occurred (0 no)
  3485.  
  3486. Name  : EMSPut               (EMS Put)
  3487. Class : Memory
  3488. Level : BIOS
  3489.  
  3490. This routine puts an element into an EMS array created by
  3491. EMSOpen.  Element numbers start at 0.  Be sure to use the right
  3492. numeric type for the array-- for instance, if you opened the
  3493. array for SINGLE precision, use "Value!".
  3494.  
  3495.    EMSPut ArrayHandle%, ElementNr&, Value
  3496.  
  3497. ArrayHandle%    handle of an EMS array
  3498. ElementNr&      element number to set
  3499. Value           value to store (must be correct type for array)
  3500.  
  3501. Name  : EMSRest              (EMS Restore state)
  3502. Class : Memory
  3503. Level : BIOS
  3504.  
  3505. This routine allows you to restore the state of the EMS array
  3506. handler.  Used in conjunction with EMSBuffer and EMSSave, it
  3507. allows you to preserve EMS arrays across a CHAIN to another
  3508. part of your program.
  3509.  
  3510.    EMSRest EMSState$
  3511.  
  3512. EMSState$    saved EMS array state
  3513.  
  3514. Name  : EMSSave              (EMS Save state)
  3515. Class : Memory
  3516. Level : BIOS
  3517.  
  3518. This routine allows you to save the state of the EMS array
  3519. handler.  Used in conjunction with EMSBuffer and EMSRest, it
  3520. allows you to preserve EMS arrays across a CHAIN to another
  3521. part of your program.
  3522.  
  3523.    EMSBuffer Bytes%
  3524.    EMSState$ = SPACE$(Bytes%)
  3525.    EMSSave EMSState$
  3526.  
  3527. -------
  3528. EMSState$    saved EMS array state
  3529.  
  3530. Name  : EnhKbd               (Enhanced Keyboard)
  3531. Class : Input
  3532. Level : BIOS
  3533.  
  3534. By default, the PBClone routines assume an old-style keyboard
  3535. is in use, for greatest compatibility.  EnhKbd allows you to
  3536. turn on enhanced keyboard handling for the current generation
  3537. of (usually) 101-key keyboards.  This allows access to the F11
  3538. and F12 function keys as well as codes for key combinations
  3539. that used to be ignored, among other things.
  3540.  
  3541. The KbdType or KbdType2% routine can be used to determine if an
  3542. enhanced keyboard is available (recommended).
  3543.  
  3544. Note that EnhKbd works by intercepting the BIOS keyboard
  3545. handler.  All calls to the BIOS keyboard interrupt are
  3546. converted from the old keyboard functions to the new ones.  YOU
  3547. MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can restore
  3548. the old setup.  Otherwise, the computer will most probably
  3549. crash.
  3550.  
  3551. A list of the new key codes is given in PBClone.DOC.
  3552.  
  3553.    EnhKbd Enable%
  3554.  
  3555. Enable%     turn on enhanced keyboard support (0 disable)
  3556.  
  3557. Name  : Equipment            (Equipment information)
  3558. Class : Equipment
  3559. Level : BIOS
  3560.  
  3561. This routine gives you some information about the basic
  3562. equipment in your computer.  Note that the "game port"
  3563. information is not reliable, due to changes in the meaning of
  3564. this particular area of the BIOS over many years.
  3565.  
  3566.    Equipment Memory%, Parallel%, Serial%, Game%
  3567.  
  3568. -------
  3569. Memory%    kilobytes of conventional memory installed (16 - 640)
  3570. Parallel%  parallel (printer) ports installed (0-4)
  3571. Serial%    serial (communications) ports installed (0-4)
  3572. Game%      game (joystick) ports installed (0-1).  See remarks, above.
  3573.  
  3574. Name  : EuropeDate           (European Date format)
  3575. Class : Time
  3576. Level : Any
  3577.  
  3578. This routine takes a date in one of the American formats
  3579. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  3580. convention ("DD.MM.YY" or "DD.MM.YYYY").  The date is formatted
  3581. according to a format string which provides the desired
  3582. delimiter and year length, e.g. "##-##-##" specifies a
  3583. delimiter of "-" and a year length of two digits.
  3584.  
  3585. An error code is returned if the date is not valid.
  3586.  
  3587.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  3588.  
  3589. DateSt$     date to format (month, day, year order)
  3590. Format$     format for the date
  3591. -------
  3592. Result$     resulting date (day, month, year order)
  3593. ErrCode     whether the date is valid (0 ok)
  3594.  
  3595. Name  : EWindowManagerC      (EGA Window Manager w Char coords)
  3596. Class : Display
  3597. Level : Clone
  3598.  
  3599. EWindowManagerC displays a pop-up window according to your
  3600. specifications. The window may have any of a variety of frames,
  3601. a title, or a shadow, and it may appear instantly or "grow"
  3602. onto the screen.  EGA and VGA graphics modes (SCREEN 7 through
  3603. SCREEN 12) are supported.
  3604.  
  3605. These are the available frame types:
  3606.     0   no frame
  3607.     1   single lines
  3608.     2   double lines
  3609.     3   single horizontal, double vertical lines
  3610.     4   double horizontal, single vertical lines
  3611.     5   block graphic lines
  3612.  
  3613. These are the available shadows:
  3614.     0   no shadow
  3615.    1+   shadow attribute (use CalcAttr) for a colored shadow
  3616.  
  3617. Options for growing windows are as follows:
  3618.    -1   grow as fast as possible
  3619.     0   pop onto the screen
  3620.    1+   grow with delay given in milliseconds (not recommended)
  3621.  
  3622. The differences between this routine and its ProBas equivalent
  3623. are the same as mentioned in the description for
  3624. WindowManager.  In addition, growing windows are supported, but
  3625. are not recommended (too slow).  Colored shadows work as in
  3626. WindowManager.  "True" shadows are not yet supported.
  3627.  
  3628.    EWindowManagerC TRow%, LCol%, BRow%, RCol%, Frame%,
  3629.       Fore%, Back%, Grow%, Shade%, S1%, S2%, TFore%, Title$
  3630.  
  3631. TRow%       top row of window
  3632. LCol%       left column of window
  3633. BRow%       bottom row of window
  3634. RCol%       right column of window
  3635. Frame%      frame type (see above)
  3636. Fore%       frame foreground color
  3637. Back%       frame background color
  3638. Grow%       window growing option (see above)
  3639. Shade%      window shadow option (see above)
  3640. S1%         unused
  3641. S2%         unused
  3642. TFore%      title foreground color
  3643. Title$      window title ("" if none)
  3644.  
  3645. Name  : Exist                (file Existence)
  3646. Class : Disk
  3647. Level : DOS
  3648.  
  3649. Most versions of BASIC give you no way of seeing if a file
  3650. exists before you try to OPEN it, so you end up taking your
  3651. chances.  The Exist routine allows you to test to see if the
  3652. file exists beforehand.  It isn't really necessary for the
  3653. PBClone file routines, which will return an appropriate error
  3654. code, but it's an important safeguard when using the BASIC OPEN
  3655. statement.
  3656.  
  3657. The Exist routine does not support wildcards.  If you need that
  3658. feature, try the FindFirstFx and FindNextFx routines instead.
  3659.  
  3660. See also Exist2, the FUNCTION version of this routine.
  3661.  
  3662.    Exist FileName$, Found%
  3663.  
  3664. FileName$   name of the file to look for
  3665. -------
  3666. Found%      whether the file was found (0 if no)
  3667.  
  3668. Name  : Exist2%              (file Existence)
  3669. Class : Disk
  3670. Level : DOS
  3671.  
  3672. Most versions of BASIC give you no way of seeing if a file
  3673. exists before you try to OPEN it, so you end up taking your
  3674. chances.  The Exist2% function allows you to test to see if the
  3675. file exists beforehand.  It isn't really necessary for the
  3676. PBClone file routines, which will return an appropriate error
  3677. code, but it's an important safeguard when using the OPEN
  3678. statement.
  3679.  
  3680. The Exist2% routine does not support wildcards.  If you need
  3681. that feature, try the FindFirstFx and FindNextFx routines
  3682. instead.
  3683.  
  3684. See also Exist, the SUB version of this routine.
  3685.  
  3686.    Found% = Exist2%(FileName$)
  3687.  
  3688. FileName$   name of the file to look for
  3689. -------
  3690. Found%      whether the file was found (0 if no)
  3691.  
  3692. Name  : ExplainFAttr$        (Explain File Attribute)
  3693. Class : Disk
  3694. Level : Any
  3695.  
  3696. This function returns a string explaining what a file attribute
  3697. means, using a specified level of abbreviation.  A single space
  3698. is used between each word, e.g. a hidden subdirectory at
  3699. abbreviation level 2 would be "Hid Dir".
  3700.  
  3701. Abbreviation Levels:
  3702.         1           2              3
  3703.    ---------------------------------------
  3704.  1      R          R-O         Read-Only
  3705.  2      H          Hid         Hidden
  3706.  4      S          Sys         System
  3707.  8      V          Vol         Volume
  3708. 16      D          Dir         Directory
  3709. 32      A          Arc         Archive
  3710.  
  3711. This function is convenient in conjunction with any of the
  3712. routines which return a file attribute: GetAttrF, GetAttrFx,
  3713. GetFAttr, LoadDirAll.
  3714.  
  3715.    Info$ = ExplainFAttr$(FilAttr%, AbbrevLevel%)
  3716.  
  3717. We use FilAttr% instead of FileAttr%, since BASIC has a
  3718. built-in FILEATTR function.
  3719.  
  3720. FilAttr%      file attribute
  3721. -------
  3722. AbbrevLevel%  how much to abbreviate the result (1-3)
  3723.  
  3724. Name  : EXQPrintC            (EGA Extended Quick Print, Char)
  3725. Class : Display
  3726. Level : Clone
  3727.  
  3728. This routine provides a rather crude, but very fast, display
  3729. capability.  It works like the PRINT statement in BASIC, except
  3730. that it doesn't move the cursor or process control codes.  It
  3731. works in EGA and VGA graphics modes (SCREEN 7 through SCREEN
  3732. 12).
  3733.  
  3734. The results of this routine are not redirectable by DOS.
  3735.  
  3736.    EXQPrintC St$, Row%, Column%, Fore%, Back%
  3737.  
  3738. St$       string to display
  3739. Row%      starting row
  3740. Column%   starting column
  3741. Fore%     foreground color
  3742. Back%     background color
  3743.  
  3744. Name  : ExtendFSpec          (Extend File Specification)
  3745. Class : Disk
  3746. Level : DOS
  3747.  
  3748. The ExtendFSpec routine combines a number of handy services
  3749. together.  It is intended for processing user-entered file
  3750. specifications.  It does the following:
  3751.  
  3752.    1) Makes sure the filespec is valid
  3753.    2) Formats the filespec to normal DOS standards
  3754.    3) Tells you whether the drive and subdirectories
  3755.       specified exist
  3756.    4) Fills out any drive or subdirectory information that
  3757.       was left out (optionally includes adding an extension
  3758.       to files which lack one)
  3759.  
  3760. The error codes returned are as follows:
  3761.    -1    Invalid file specification
  3762.     0    No error
  3763.     1    Specified drive does not exist (warning only)
  3764.     2    Specified subdirectory does not exist (warning only)
  3765.  
  3766. The ExtendFSpec routine mimics DOS filename handling exactly,
  3767. to the best of my knowledge.
  3768.  
  3769.    ExtendFSpec File$, Ext$, FullFile$, ErrCode%
  3770.  
  3771. File$      file specification to process
  3772. Ext$       extension to add to files that don't have extensions
  3773. -------
  3774. FullFile$  processed file specification
  3775. ErrCode%   error code
  3776.  
  3777. Name  : ExtGet               (Extended memory Get)
  3778. Class : Memory
  3779. Level : BIOS (AT)
  3780.  
  3781. This routine allows you to get information from extended
  3782. memory.  It should only be used on AT-class computers, since
  3783. older PCs do not support extended memory.
  3784.  
  3785. You may get up to 32,766 words (just under 64 kilobytes) at a
  3786. time from a specified location in extended memory.  The
  3787. location is specified as the distance from the start of
  3788. extended memory, starting at 1 for the first location.  One
  3789. word is equivalent to one integer.
  3790.  
  3791. See ExtMem for information on extended memory constraints.
  3792.  
  3793.    ExtGet DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3794.  
  3795. DSeg%       segment of array to place data from extended memory
  3796. DOfs%       offset of array to place data from extended memory
  3797. Posn&       location of data in extended memory (starting at 1)
  3798. Words%      # of words to transfer (1 int = 1 word = 2 byte)
  3799. -------
  3800. ErrCode%    error code (0 if no error)
  3801.  
  3802. Name  : ExtMem               (Extended Memory)
  3803. Class : Memory / Equipment
  3804. Level : BIOS (AT)
  3805.  
  3806. This routine allows you to find out how much extended memory is
  3807. available. It should only be used on AT-class computers, since
  3808. older PCs do not support extended memory.
  3809.  
  3810. The amount of memory returned may be either the total amount of
  3811. extended memory installed or just the amount available at this
  3812. time, depending on how previously-installed programs (if any)
  3813. make use of extended memory. Unfortunately, there is no
  3814. standard which defines how a program should use extended memory
  3815. as there is with EMS (expanded memory), so there is no way for
  3816. a program to determine whether or how another program is using
  3817. extended memory.  Microsoft is trying to clear up this
  3818. situation with its HIMEM driver (available at your local BBS,
  3819. or [last I looked] free from Microsoft), but this approach
  3820. hasn't really become standard yet.
  3821.  
  3822.    ExtMem KBytes%
  3823.  
  3824. -------
  3825. KBytes%     the number of kilobytes of extended memory
  3826.  
  3827. Name  : ExtPut               (Extended memory Put)
  3828. Class : Memory
  3829. Level : BIOS (AT)
  3830.  
  3831. This routine allows you to put information into extended
  3832. memory.  It should only be used on AT-class computers, since
  3833. older PCs do not support extended memory.
  3834.  
  3835. You may put up to 32,766 words (just under 64 kilobytes) at a
  3836. time into a specified location in extended memory.  The
  3837. location is specified as the distance from the start of
  3838. extended memory, starting at 1 for the first location.  One
  3839. word is equivalent to one integer.
  3840.  
  3841. Note that you can't rely on extended memory being available
  3842. just because it exists.  There is no automatic way to determine
  3843. if another program is also trying to use the same extended
  3844. memory.  If in doubt, allow a user-installed option to
  3845. enable/disable the use of extended memory by your program.
  3846.  
  3847.    ExtPut DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3848.  
  3849. DSeg%       segment of data to store in extended memory
  3850. DOfs%       offset of data to store in extended memory
  3851. Posn&       location to place data in extended memory
  3852. Words%      # of words to transfer (1 int = 1 word = 2 bytes)
  3853. -------
  3854. ErrCode%    error code (0 if no error)
  3855.  
  3856. Name  : Extract              (Extract delimited substring)
  3857. Class : String
  3858. Level : Any
  3859.  
  3860. Extract allows you to remove any one of a list of delimited
  3861. substrings in a string.  It's useful for input parsing and
  3862. database work.  You pass it the string, delimiter, and the
  3863. number of the desired substring (numbers start at one).  It
  3864. returns the starting position of the substring within the
  3865. string and the length of the substring (0 if not found).
  3866.  
  3867. Just for example, let's assume we have a string as follows:
  3868.    St$ = "Tom Hanlin=3544 E. Southern Ave #104=Mesa, AZ 85204"
  3869.  
  3870. If we selected a delimiter of "=" and substring number three,
  3871. the results would be "Mesa, AZ 85204".
  3872.  
  3873. Delimiters of more than one character are fine.  This can be
  3874. handy for locating carriage return/linefeed pairs, among other
  3875. things.
  3876.  
  3877.    Extract St$, Delimiter$, SubStrNr%, StartPosn%, SLen%
  3878.    SubSt$ = MID$(St$, StartPosn%, SLen%)
  3879.  
  3880. St$         string from which to extract
  3881. Delimiter$  delimiter between substrings
  3882. SubStrNr%   number of the desired substring
  3883. -------
  3884. StartPosn%  starting position of substring within the string
  3885. SLen%       length of the substring (0 if none)
  3886.  
  3887. Name  : FadeOut              (Fade Out)
  3888. Class : Display
  3889. Level : Clone
  3890.  
  3891. Like CLS, but a bit more fancy, this routine provides an
  3892. interesting way to clear the screen.  See also Dissolve.
  3893.  
  3894.    FadeOut VAttr%
  3895.  
  3896. VAttr%   color/attribute to which to clear (see CalcAttr)
  3897.  
  3898. Name  : FarPeek%             (Far memory Peek)
  3899. Class : Memory
  3900. Level : Clone
  3901.  
  3902. This is like the BASIC PEEK function, but expects both a
  3903. segment and an offset, thus doing away with the need for DEF
  3904. SEG.  This is especially handy for use in subprograms which
  3905. might otherwise inadvertently change the DEF SEG value expected
  3906. by the main program.
  3907.  
  3908.    Value% = FarPeek%(DSeg%, DOfs%)
  3909.  
  3910. Related routines include FarPeekI%, FarPeekL&, DGetSt, DGetRec.
  3911.  
  3912. DSeg%    segment of the location to look at
  3913. DOfs%    offset of the location to look at
  3914. -------
  3915. Value%   value at the specified memory location (byte: 0-255)
  3916.  
  3917. Name  : FarPeekI%            (Far memory Peek Integer)
  3918. Class : Memory
  3919. Level : Clone
  3920.  
  3921. This is like the BASIC PEEK function, but expects both a
  3922. segment and an offset, thus doing away with the need for DEF
  3923. SEG.  This is especially handy for use in subprograms which
  3924. might otherwise inadvertently change the DEF SEG value expected
  3925. by the main program.  Unlike PEEK, this routine returns a word
  3926. (integer) rather than a byte.
  3927.  
  3928.    Value% = FarPeekI%(DSeg%, DOfs%)
  3929.  
  3930. Related routines include FarPeek%, FarPeekL&, DGetSt, DGetRec.
  3931.  
  3932. DSeg%    segment of the location to look at
  3933. DOfs%    offset of the location to look at
  3934. -------
  3935. Value%   value at the specified memory location (word)
  3936.  
  3937. Name  : FarPeekL&            (Far memory Peek Long integer)
  3938. Class : Memory
  3939. Level : Clone
  3940.  
  3941. This is like the BASIC PEEK function, but expects both a
  3942. segment and an offset, thus doing away with the need for DEF
  3943. SEG.  This is especially handy for use in subprograms which
  3944. might otherwise inadvertently change the DEF SEG value expected
  3945. by the main program.  Unlike PEEK, this routine returns a dword
  3946. (long integer) rather than a byte.
  3947.  
  3948.    Value& = FarPeekL&(DSeg%, DOfs%)
  3949.  
  3950. Related routines include FarPeek%, FarPeekI%, DGetSt, DGetRec.
  3951.  
  3952. DSeg%    segment of the location to look at
  3953. DOfs%    offset of the location to look at
  3954. -------
  3955. Value&   value at the specified memory location (dword)
  3956.  
  3957. Name  : FarPoke              (Far memory Poke)
  3958. Class : Memory
  3959. Level : Clone
  3960.  
  3961. This is like the BASIC POKE statement, but expects both a
  3962. segment and an offset, thus doing away with the need for DEF
  3963. SEG.  This is especially handy for use in subprograms which
  3964. might otherwise inadvertently change the DEF SEG value expected
  3965. by the main program.
  3966.  
  3967.    FarPoke DSeg%, DOfs%, Value%
  3968.  
  3969. Related routines include FarPokeI, FarPokeL, DPutSt, DPutRec.
  3970.  
  3971. DSeg%    segment of the location to look at
  3972. DOfs%    offset of the location to look at
  3973. Value%   value to store in the given memory posn (byte: 0-255)
  3974.  
  3975. Name  : FarPokeI             (Far memory Poke Integer)
  3976. Class : Memory
  3977. Level : Clone
  3978.  
  3979. This is like the BASIC POKE statement, but expects both a
  3980. segment and an offset, thus doing away with the need for DEF
  3981. SEG.  This is especially handy for use in subprograms which
  3982. might otherwise inadvertently change the DEF SEG value expected
  3983. by the main program.  Unlike POKE, this routine stores a word
  3984. or integer.
  3985.  
  3986.    FarPokeI DSeg%, DOfs%, Value%
  3987.  
  3988. Related routines include FarPoke, FarPokeL, DPutSt, DPutRec.
  3989.  
  3990. DSeg%    segment of the location to look at
  3991. DOfs%    offset of the location to look at
  3992. Value%   value to store in the given memory posn (word)
  3993.  
  3994. Name  : FarPokeL             (Far memory Poke Long integer)
  3995. Class : Memory
  3996. Level : Clone
  3997.  
  3998. This is like the BASIC POKE statement, but expects both a
  3999. segment and an offset, thus doing away with the need for DEF
  4000. SEG.  This is especially handy for use in subprograms which
  4001. might otherwise inadvertently change the DEF SEG value expected
  4002. by the main program.  Unlike POKE, this routine stores a dword
  4003. or long integer.
  4004.  
  4005.    FarPokeL DSeg%, DOfs%, Value&
  4006.  
  4007. Related routines include FarPoke, FarPokeI, DPutSt, DPutRec.
  4008.  
  4009. DSeg%    segment of the location to look at
  4010. DOfs%    offset of the location to look at
  4011. Value&   value to store in the given memory posn (dword)
  4012.  
  4013. Name  : FClose1              (File Close)
  4014. Class : Disk
  4015. Level : DOS
  4016.  
  4017. This routine closes a file that was opened by FOpen1 or
  4018. FCreate.  It can also be used to close any of the predefined
  4019. device handles.
  4020.  
  4021. These are the predefined device handles that are always
  4022. available:
  4023.  
  4024.    0    CON     stdin     standard input, normally the keyboard
  4025.    1    CON     stdout    standard output, normally the display
  4026.    2    CON     stderr    standard error, almost always display
  4027.    3    AUX     stdaux    auxiliary device, generally COM1
  4028.    4    PRN     stdprn    standard printer, generally LPT1
  4029.  
  4030. If you are running short of handles, you can always close
  4031. stdaux to free up a handle.  The stdprn device can also be
  4032. closed as long as you don't use the printer or if you only
  4033. access the printer through LPRINT.  It is not a good idea to
  4034. close stdin, stdout, or stderr under normal circumstances.
  4035.  
  4036.    FClose1 Handle%
  4037.  
  4038. Handle%    handle of the file to close
  4039.  
  4040. Name  : FCreate              (File Create)
  4041. Class : Disk
  4042. Level : DOS
  4043.  
  4044. This routine creates a file and opens it for use by the PBClone
  4045. file handling routines.  If the file already existed, it will
  4046. be wiped out, so you may want to check beforehand if this is a
  4047. problem.  Try the Exist routine.
  4048.  
  4049. The file is opened in read/write mode, allowing both input and
  4050. output.
  4051.  
  4052. You may create the file using any of the following attributes:
  4053.  
  4054.    Normal          0      (nothing special)
  4055.    Read Only       1      file can be read, but not written to
  4056.    Hidden          2      file is "invisible"
  4057.    System          4      special DOS system file
  4058.  
  4059. The attributes can be combined by adding them together.  Don't
  4060. use the System attribute unless you know what you're doing!
  4061.  
  4062. Note that this routine does not support file sharing.  If that
  4063. is a problem, close the file just after it is created and
  4064. reopen it using FOpen1.
  4065.  
  4066.    FCreate FileName$, FAttr%, Handle%, ErrCode%
  4067.  
  4068. FileName$  name of the file to create
  4069. FAttr%     attribute(s) of the file
  4070. -------
  4071. Handle%    handle by which to access the file (if no error)
  4072. ErrCode%   error code: 0 if no error, else DOS Error
  4073.  
  4074. Name  : FDescRead$           (File Description Read)
  4075. Class : Disk
  4076. Level : DOS
  4077.  
  4078. This routine reads a 4DOS-style file description from disk.  If
  4079. there is no description or an error occurs, the result will be
  4080. a null string.
  4081.  
  4082.    FileDesc$ = FDescRead$(FileName$)
  4083.  
  4084. FileName$   file name
  4085. -------
  4086. FileDesc$   description of file, if any
  4087.  
  4088. Name  : FGetLoc              (File Get Location)
  4089. Class : Disk
  4090. Level : DOS
  4091.  
  4092. This routine tells you the position of the file pointer of a
  4093. file that was opened using FOpen1 or FCreate.  This pointer is
  4094. used to specify where the next item should be read from or
  4095. written to the file.  The first location of the file is
  4096. numbered 1.
  4097.  
  4098. See also FGetLoc2, the FUNCTION version of this routine.
  4099.  
  4100.    FGetLoc Handle%, Posn&
  4101.  
  4102. Handle%    handle of the file
  4103. -------
  4104. Posn&      location of the file pointer
  4105.  
  4106. Name  : FGetLoc2&            (File Get Location)
  4107. Class : Disk
  4108. Level : DOS
  4109.  
  4110. This routine tells you the position of the file pointer of a
  4111. file that was opened using FOpen1 or FCreate.  This pointer is
  4112. used to specify where the next item should be read from or
  4113. written to the file.  The first location of the file is
  4114. numbered 1.
  4115.  
  4116. See also FGetLoc, the SUB version of this routine.
  4117.  
  4118.    Posn& = FGetLoc2&(Handle%)
  4119.  
  4120. Handle%    handle of the file
  4121. -------
  4122. Posn&      location of the file pointer
  4123.  
  4124. Name  : FileCopy             (File Copy)
  4125. Class : Disk
  4126. Level : DOS
  4127.  
  4128. This routine copies one or more files, just like the DOS
  4129. command "COPY".
  4130.  
  4131. FileCopy works exactly like the DOS COPY command, except it
  4132. won't append files.  You may use wildcards in both source and
  4133. destination file specifications.  In the event of an error,
  4134. normal DOS error codes are returned, with two exceptions:
  4135.  
  4136.   -2  attempt to copy files over themselves
  4137.   -1  attempt to copy multiple sources to a single dest file
  4138.  
  4139. See also CopyFile, a simpler routine which doesn't support
  4140. wildcards.
  4141.  
  4142.    FileCopy SrcFile$, DestFile$, FCount%, ByteCount&, ErrCode%
  4143.  
  4144. SrcFile$    source file name(s)
  4145. DestFile$   destination file name(s)
  4146. -------
  4147. FCount%     number of files copied
  4148. ByteCount&  number of bytes copied
  4149. ErrCode%    error code (0 if no error)
  4150.  
  4151. Name  : FileCount            (File Count)
  4152. Class : Disk
  4153. Level : DOS
  4154.  
  4155. This routine returns the number of files which match a given
  4156. file specification and attribute.  You need to use this routine
  4157. before LoadDir or LoadDirAll in order to DIM the array to the
  4158. appropriate size.
  4159.  
  4160. The attribute can be any of the usual file attributes:
  4161.    1   Read-Only
  4162.    2   Hidden
  4163.    4   System
  4164.   16   Directory
  4165.  
  4166. You can combine attributes by adding their values.  For
  4167. instance, to search for hidden directories, you'd use an
  4168. attribute of 18.  By default, DOS returns normal files as well
  4169. as files which have the specified attributes, so an attribute
  4170. of 18 would get you normal files, hidden files, directories,
  4171. and hidden directories.  However, FileCount can be made to
  4172. screen out unwanted files-- just negate the attribute to force
  4173. only files of that attribute to be counted.  For example, an
  4174. attribute of -18 would return only hidden subdirectories.
  4175.  
  4176.    FileCount FileSpec$, FilAttr%, Count%, ErrCode%
  4177.  
  4178. We use FilAttr% instead of FileAttr%, since BASIC has a
  4179. built-in FILEATTR function.
  4180.  
  4181. FileSpec$   search filename (may contain wildcards)
  4182. FilAttr%    search file attribute
  4183. -------
  4184. Count%      number of matching files found
  4185. ErrCode%    error code (0 if no error)
  4186.  
  4187. Name  : FileCRC              (File CRC)
  4188. Class : Disk
  4189. Level : DOS
  4190.  
  4191. This routine calculates a 32-bit CRC for a file.  This CRC is
  4192. derived by a formula which takes each character of the file
  4193. into consideration.  It provides a powerful (although not 100%
  4194. foolproof) way to verify that a file hasn't changed since you
  4195. last checked.
  4196.  
  4197.    FileCRC FileName$, Result&, ErrCode%
  4198.  
  4199. FileName$   source file name(s)
  4200. -------
  4201. Result&     32-bit CRC of the file
  4202. ErrCode%    error code (0 if no error)
  4203.  
  4204. Name  : FileMenu             (File Menu)
  4205. Class : Input
  4206. Level : Clone
  4207.  
  4208. This routine provides a list of files according to the filespec
  4209. and attribute you pass it and allows the user to pick a single
  4210. file from the resulting list.  The filespec may contain a full
  4211. path and wildcards.  The attribute may be negated if you insist
  4212. on an exact match (directories only, for example), or use a
  4213. normal attribute for multiple matches (directories and files,
  4214. for instance).  Many of the usual WindowManager parameters are
  4215. used here-- top row, left column, and bottom row (right column
  4216. is calculated for you), window frame color and frame type,
  4217. growth, shadow, title string and title color-- see the
  4218. WindowManager routine for details.  For a description of file
  4219. search attributes, see the FindFirstFx routine.
  4220.  
  4221. If you allow using the mouse, be sure the mouse is initialized
  4222. (MMCheck or MMCheck2%) and the mouse cursor is visible
  4223. (MMCursorOn) before calling this routine.
  4224.  
  4225. This routine automatically saves and restores the underlying
  4226. screen.  It can handle up to 2,048 files in a window.  See
  4227. CalcAttr if you're not familiar with color/attributes.
  4228.  
  4229.    FileMenu Mouse%, FileSpec$, SeekAttr%, TopRow%, LeftCol%, _
  4230.       BottomRow%, Frame%, FrameAttr%, FileListAttr%, _
  4231.       HiliteAttr%, TitleFore%, Title$, Grow%, Shade%
  4232.  
  4233. Mouse%          whether to support the mouse (0 no, -1 yes)
  4234. FileSpec$       filespec to use in creating the file list
  4235. SeekAttr%       file search attribute to use in creating list
  4236. TopRow%         top row of pick window
  4237. LeftCol%        left column of pick window
  4238. BottomRow%      bottom row of pick window
  4239. Frame%          frame type
  4240. FrameAttr%      frame color/attribute
  4241. FileListAttr%   file list color/attribute
  4242. HiliteAttr%     highlight bar color/attribute
  4243. TitleFore%      title foreground color (backgnd is frame color)
  4244. Title$          title (use "" for no title)
  4245. Grow%           window growth
  4246. Shade%          window shadow
  4247. -------
  4248. FileSpec$       file picked ("" if none)
  4249.  
  4250. Name  : FindFirstA           (Find First file in an Archive)
  4251. Class : Disk
  4252. Level : DOS
  4253.  
  4254. The FindFirstA routine is used to find the first file that
  4255. matches search parameters which you specify.  Various
  4256. information about the file that matches (if any) can be
  4257. retrieved by other routines.
  4258.  
  4259. Rather than working on a directory, this routine works on files
  4260. in an archive.  Supported archive formats include ARC, ARJ,
  4261. LZH, PAK, ZIP and ZOO.  Self-extracting archives in ARJ, LHARC,
  4262. and PKZIP (ZIP2EXE) form are also supported, as either .COM or
  4263. .EXE files. If no extension is given, a search will be made
  4264. through each valid archive extension, and the first matching
  4265. archive will be used for the file search.
  4266.  
  4267. Archive names may contain drive and subdirectory specs, but not
  4268. wildcards.  File names may contain wildcards, but not drive or
  4269. subdir specs.
  4270.  
  4271. When you are done searching, be sure to use CloseA to terminate
  4272. the search.
  4273.  
  4274. Routines in this series include:
  4275.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4276.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4277.  
  4278.    FindFirstA ArcName$, FileName$, ErrCode%
  4279.  
  4280. ArcName$    name of archive to search through
  4281. FileName$   name of file(s) for which to search
  4282. -------
  4283. ErrCode%    error code (0 if no error, else no matching files)
  4284.  
  4285. Name  : FindFirstF           (Find First File)
  4286. Class : Disk
  4287. Level : DOS
  4288.  
  4289. This is part of a set of routines included for compatibility
  4290. with ADVBAS and ProBas.  A better solution may be found in
  4291. FindFirstFx.
  4292.  
  4293. The FindFirstF routine is used to find the first file that
  4294. matches search parameters which you specify.  Various
  4295. information about the file that matches (if any) can be
  4296. retrieved by other routines.  See also FindNextF.
  4297.  
  4298. The file name specified may contain a drive and subdirectory
  4299. specification. Wildcards are also allowed.
  4300.  
  4301. Possible search attributes are as follows:
  4302.  
  4303.    Normal          0      (nothing special)
  4304.    Hidden          2      file is "invisible"
  4305.    System          4      special DOS system file
  4306.    Subdirectory   16      subdirectory
  4307.  
  4308. You can combine the attributes by adding them together.  All
  4309. searches will match if any of the specified attributes are
  4310. found, so if you're looking only for a specific attribute, you
  4311. will need to test the results using GetAttrF.
  4312.  
  4313. Routines in this series include:
  4314.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4315.    GetTimeF, GetSizeFL
  4316.  
  4317.    FindFirstF FileName$, FAttr%, ErrCode%
  4318.  
  4319. FileName$   name of file(s) for which to search
  4320. FAttr%      file attribute(s) to seek
  4321. -------
  4322. ErrCode%    error code (0 if no error, else no matching files)
  4323.  
  4324. Name  : FindFirstFx          (Find First File, Extended)
  4325. Class : Disk
  4326. Level : DOS
  4327.  
  4328. The FindFirstFx routine is used to find the first file that
  4329. matches search parameters which you specify.  Various
  4330. information about the file that matches (if any) can be
  4331. retrieved by other routines.
  4332.  
  4333. The file name specified may contain a drive and subdirectory
  4334. specification. Wildcards are also allowed.
  4335.  
  4336. Possible search attributes are as follows:
  4337.  
  4338.    Normal          0      (nothing special)
  4339.    Read Only       1      file can be read, but not written to
  4340.    Hidden          2      file is "invisible"
  4341.    System          4      special DOS system file
  4342.    Subdirectory   16      subdirectory
  4343.  
  4344. You can combine the attributes by adding them together.  All
  4345. searches will match if any of the specified attributes are
  4346. found, so if you're looking only for a specific attribute, you
  4347. will need to test the results using GetAttrFx.
  4348.  
  4349. Routines in this series include:
  4350.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4351.    GetTimeFx$, GetSizeFx&
  4352.  
  4353. These routines differ from the older FindFirstF-based series in
  4354. two major respects.  They include a Buffer$ parameter, which
  4355. allows you to have more than one search going on at a time.
  4356. This makes it safe to use these routines in subprograms without
  4357. conflict with the main program.  It also allows you to search
  4358. entire subdirectory trees recursively.  The other major
  4359. difference is that many of these routines are coded as
  4360. functions for greater convenience.
  4361.  
  4362.    Buffer$ = SPACE$(64)
  4363.    FindFirstFx Buffer$, FileName$, FAttr%, ErrCode%
  4364.  
  4365. FileName$   name of file(s) for which to search
  4366. FAttr%      file attribute(s) to seek
  4367. -------
  4368. Buffer$     buffer used in search (init to 64 characters)
  4369. ErrCode%    error code (0 if no error, else no matching files)
  4370.  
  4371. Name  : FindNextA            (Find Next file in an Archive)
  4372. Class : Disk
  4373. Level : DOS
  4374.  
  4375. This routine is for use after FindFirstA, to find any
  4376. additional archived files which may match your search
  4377. specifications.
  4378.  
  4379. Routines in this series include:
  4380.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4381.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4382.  
  4383.    FindNextA ErrCode%
  4384.  
  4385. -------
  4386. ErrCode%    error code (0 if no error, else no matching files)
  4387.  
  4388. Name  : FindNextF            (Find Next File)
  4389. Class : Disk
  4390. Level : DOS
  4391.  
  4392. This routine is for use after FindFirstF, to find any
  4393. additional files which may match your search specifications.
  4394.  
  4395. Routines in this series include:
  4396.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4397.    GetTimeF, GetSizeFL
  4398.  
  4399.    FindNextF ErrCode%
  4400.  
  4401. -------
  4402. ErrCode%    error code (0 if no error, else no matching files)
  4403.  
  4404. Name  : FindNextFx           (Find Next File, Extended)
  4405. Class : Disk
  4406. Level : DOS
  4407.  
  4408. This routine is for use after FindFirstFx, to find any
  4409. additional files which may match your search specifications.
  4410.  
  4411. Routines in this series include:
  4412.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4413.    GetTimeFx$, GetSizeFx&
  4414.  
  4415.    FindNextFx Buffer$, ErrCode%
  4416.  
  4417. Buffer$     buffer used in search
  4418. -------
  4419. Buffer$     updated buffer
  4420. ErrCode%    error code (0 if no error, else no matching files)
  4421.  
  4422. Name  : FindPatch            (Find Patch location)
  4423. Class : Disk
  4424. Level : DOS
  4425.  
  4426. This is one of a set of routines that allow you to write
  4427. self-modifying code. Your program can patch DATA statements in
  4428. itself or in another program, allowing you to save
  4429. configuration information (for example) without having to
  4430. create additional data files.
  4431.  
  4432. In order for this routine to work, you must have a series of
  4433. DATA statements containing quoted strings of the maximum
  4434. desired length.  The first DATA statement must contain a unique
  4435. string, as FindPatch will use it to locate the data block.
  4436. Note that if your program is patching itself, you must READ the
  4437. unique string rather than assigning it directly, to make sure
  4438. it's unique.  The string must exist at only one place in the
  4439. program.
  4440.  
  4441. See the PATCHER.BAS file if you would like clarification.  This
  4442. little demo program, when compiled, will patch itself with
  4443. whatever you enter on the command line.  For instance, if you
  4444. type PATCHER BANANA, it will store "BANANA" in its DATA
  4445. statement.  PDEMO will not work in the QuickBASIC environment,
  4446. of course.  You must compile it to an .EXE file.
  4447.  
  4448. You may compile the program using any switches.  You may not
  4449. use the /E (/EXEPACK) switch for LINK, though, as this may
  4450. alter the program DATA area.  Likewise, you must not use
  4451. compression utilities such as PKLite on the program.
  4452.  
  4453. Routines in this set include FindPatch, SetPatch, PatchDone.
  4454.  
  4455.    FindPatch FileName$, SearchSt$, ErrCode%
  4456.  
  4457. FileName$     name of the file to patch
  4458. SearchSt$     value of the first DATA statement
  4459. MoveBack%     not used
  4460. -------
  4461. ErrCode%      whether search worked (0 yes, <0 no, >0 Error)
  4462.  
  4463. Name  : FLock                (File Lock)
  4464. Class : Disk
  4465. Level : DOS
  4466.  
  4467. This routine locks any part of a file.  It will typically be
  4468. used for random-access files in circumstances where the file
  4469. needs to be accessed by multiple programs at the same time.
  4470. This routine lets you lock just the part of the file you need
  4471. to access, allowing other programs to work with other parts of
  4472. the file at the same time.  It is best to maintain the lock for
  4473. the shortest time possible, in case someone else needs the same
  4474. data.  The ideal technique is to lock the area, read what data
  4475. you need, write any changes, and unlock the area as a single
  4476. program block.
  4477.  
  4478. Note that it is IMPORTANT to unlock the locked area before the
  4479. file is closed and before your program terminates.  If the file
  4480. is not properly unlocked, it may be damaged.  See also FUnlock.
  4481.  
  4482. This routine is used for occasions where you expect multiple
  4483. accesses to a single file, under networking or multitasking
  4484. conditions.  For less demanding file sharing, it is safer to
  4485. simply lock the entire file when you open it-- see FOpen.
  4486.  
  4487.    FLock FileHandle%, StartPosn&, Bytes&, ErrCode%
  4488.  
  4489. FileHandle%    file handle
  4490. StartPosn&     starting offset (1 for first position)
  4491. Bytes&         number of bytes to lock
  4492. -------
  4493. ErrCode%       error code (0 if no error, else DOS error code)
  4494.  
  4495. Name  : FloorD#              (Floor, Double-precision)
  4496. Class : String
  4497. Level : Any
  4498.  
  4499. This function returns the largest integer less than or equal to
  4500. the number you give it.  This is most often used for rounding.
  4501.  
  4502.    Result# = FloorD#(Nr#)
  4503.  
  4504. Nr#          number to process
  4505. -------
  4506. Result#      result
  4507.  
  4508. Name  : FloorS!              (Floor, Single-precision)
  4509. Class : String
  4510. Level : Any
  4511.  
  4512. This function returns the largest integer less than or equal to
  4513. the number you give it.  This is most often used for rounding.
  4514.  
  4515.    Result! = FloorS!(Nr!)
  4516.  
  4517. Nr!          number to process
  4518. -------
  4519. Result!      result
  4520.  
  4521. Name  : Floppies             (Floppies installed)
  4522. Class : Equipment / Disk
  4523. Level : BIOS
  4524.  
  4525. The Floppies routine tells you how many floppy drives are
  4526. installed (0-4). See also Floppies2, a function version of this
  4527. routine.
  4528.  
  4529.    Floppies Drives%
  4530.  
  4531. -------
  4532. Drives%  number of floppy disk drives installed
  4533.  
  4534. Name  : Floppies2%           (Floppies installed)
  4535. Class : Equipment / Disk
  4536. Level : BIOS
  4537.  
  4538. The Floppies2 routine tells you how many floppy drives are
  4539. installed (0-4).
  4540.  
  4541.    Drives% = Floppies2%
  4542.  
  4543. -------
  4544. Drives%  number of floppy disk drives installed
  4545.  
  4546. Name  : FloppyType           (Floppy drive Type)
  4547. Class : Equipment / Disk
  4548. Level : Clone (AT)
  4549.  
  4550. This routine tells you what kinds of floppy drives are
  4551. installed, if any.  A code is returned for each drive, as
  4552. follows:
  4553.  
  4554.    0    no drive
  4555.    1    5 1/4"    360K
  4556.    2    5 1/4"    1.2M
  4557.    3    3 1/2"    720K
  4558.    4    3 1/2"    1.44M
  4559.    5    3 1/2"    2.88M
  4560.  
  4561. Note that this routine supports a maximum of only two drives.
  4562. It is possible for a machine to have up to four drives, but
  4563. there is not currently any good way to find out about them.
  4564.  
  4565. FloppyType should only be used on AT-class machines.  It will
  4566. not work on PC/XT computers and may cause unusual results if
  4567. used on such machines.  It will also not work on some of the
  4568. earliest AT clone machines which didn't adhere to the standard
  4569. CMOS format.
  4570.  
  4571.    FloppyType DriveA%, DriveB%
  4572.  
  4573. -------
  4574. DriveA%    drive type of first floppy drive
  4575. DriveB%    drive type of second floppy drive
  4576.  
  4577. Name  : FlushToDisk          (Flush file buffers To Disk)
  4578. Class : Disk
  4579. Level : DOS
  4580.  
  4581. This is a "file safety" routine for use with files opened by
  4582. FOpen1 or FCreate.  Files are normally buffered by DOS, which
  4583. makes file handling faster but creates the danger of losing the
  4584. file if there is a crash or power outage.  By flushing the file
  4585. to disk, you insure that it is updated to the current moment.
  4586.  
  4587. Note: this routine will need to temporarily create a new file
  4588. handle if DOS versions before 4.0 are used.
  4589.  
  4590.    FlushToDisk Handle%, ErrCode%
  4591.  
  4592. Handle%    handle of the file to flush
  4593. -------
  4594. ErrCode%   error code: 0 if none, else DOS Error
  4595.  
  4596. Name  : FOpen1               (File Open)
  4597. Class : Disk
  4598. Level : DOS
  4599.  
  4600. This routine opens an existing file for use with the PBClone
  4601. file handling routines.  If you need to create a file that
  4602. doesn't already exist, use the FCreate routine instead.
  4603.  
  4604. The file may be opened for reading, writing, or both:
  4605.  
  4606.    0   Read
  4607.    1   Write
  4608.    2   Read/Write
  4609.  
  4610. You may specify a file sharing mode for use with networks and
  4611. multitaskers. This will only take effect if the DOS version is
  4612. 3.0 or later and if the DOS SHARE utility has been executed.
  4613. Otherwise, it will be ignored.
  4614.  
  4615.    0   Normal       compatibility mode: no file sharing
  4616.    1   Exclusive    no one else may access the file
  4617.    2   Deny Write   no one else may write to the file
  4618.    3   Deny Read    no one else may read from the file
  4619.    4   Deny None    anyone else may read from or write to file
  4620.  
  4621. Most of the time, "Deny Write" will be appropriate.  This
  4622. allows others to read the file, but not to modify the file on
  4623. you unexpectedly.
  4624.  
  4625. See the discussion of predefined device handles at FClose1.
  4626.  
  4627.    FOpen1 FileName$, ReadWrite%, Sharing%, Handle%, ErrCode%
  4628.  
  4629. FileName$   name of the file to open
  4630. ReadWrite%  whether you want input, output, or both (see above)
  4631. Sharing%    file sharing mode (see above)
  4632. -------
  4633. Handle%    handle by which to access the file (if no error)
  4634. ErrCode%   error code: 0 if no error, else DOS Error
  4635.  
  4636. Name  : ForceMatch$          (Force Match of file to wildcard)
  4637. Class : Disk
  4638. Level : Any
  4639.  
  4640. The ForceMatch$ function allows you to mimic DOS commands that
  4641. operate on source file(s) and destination file(s).  It forces a
  4642. source file name to match a specified pattern (which may
  4643. contain wildcards), producing an appropriate destination file
  4644. name.
  4645.  
  4646. For example, if the source is "TESTNAME.BAS" and the pattern is
  4647. "?RUE*.*", the result would be "TRUENAME.BAS".
  4648.  
  4649. Consider the DOS command "COPY *.BAS A:*.BAK".  The "*.BAK"
  4650. part is the desired pattern.  The "*.BAS" part specifies which
  4651. files to copy to the new pattern.  Each filename that matches
  4652. "*.BAS" is translated through the "*.BAK" pattern to give the
  4653. destination filename.  The ForceMatch$ function is designed to
  4654. do this sort of translation for you.
  4655.  
  4656.    DestFile$ = ForceMatch$(Pattern$, SrcFile$)
  4657.  
  4658. Pattern$   pattern of desired file name (may contain wildcards)
  4659. SrcFile$   file name to force through the pattern
  4660. -------
  4661. DestFile$  resulting file name
  4662.  
  4663. Name  : FormatDate           (Format Date)
  4664. Class : Time
  4665. Level : Any
  4666.  
  4667. This is a highly flexible date formatting routine.  It accepts
  4668. a date in one of the usual American formats ("03-22-1990",
  4669. "03/22/90", or even "3/22/90") and converts it according to a
  4670. format string.  This format string allows you to normalize the
  4671. date, select a new delimiter, choose between two-digit and
  4672. four-digit years, and even change the order from month/day/year
  4673. to anything else.  An error code will be returned if the date
  4674. is not valid.
  4675.  
  4676. The format string can be as simple as "##/##/##", which
  4677. specifies that the usual month/day/year order be used, with a
  4678. delimiter of "/" and a two-digit year.  If you want to change
  4679. the date order, you would need a format like "DD.MM.YYYY"
  4680. instead.  For sorting or storage, you might want to convert the
  4681. date to a plain number, using a format string like "YYYYMMDD".
  4682. The result could then be converted to a LONG with the BASIC VAL
  4683. function.
  4684.  
  4685.    FormatDate DateSt$, Format$, Result$, ErrCode%
  4686.  
  4687. DateSt$     date to format (month, day, year order)
  4688. Format$     format for the date
  4689. -------
  4690. Result$     resulting date
  4691. ErrCode     whether the date is valid (0 ok)
  4692.  
  4693. Name  : FormatPhone$         (Format Phone number)
  4694. Class : String
  4695. Level : Any
  4696.  
  4697. This function formats a phone number using the standard U.S.
  4698. notation.  The phone number is passed as a string.  This string
  4699. is screened of any invalid phone number characters and is then
  4700. formatted according to its length into one of the following:
  4701.  
  4702.    "1234"
  4703.    "555-1234"
  4704.    "(303) 555-1234"
  4705.  
  4706. Valid characters are all digits and letters except for Q and Z.
  4707. Letters are capitalized by the routine.  A leading "1" may be
  4708. present if there is an area code-- if so, it is removed.  Phone
  4709. numbers which are the wrong length will cause a null string
  4710. ("") to be returned.
  4711.  
  4712. See also StripChar, which will allow you to undo formatting.
  4713.  
  4714.    Phone$ = FormatPhone$(RawNr$)
  4715.  
  4716. RawNr$      unformatted phone number
  4717. -------
  4718. Phone$      formatted phone number ("" if invalid)
  4719.  
  4720. Name  : FReadLn              (File Read Line)
  4721. Class : Disk
  4722. Level : DOS
  4723.  
  4724. This routine works like LINE INPUT-- it reads in an entire line
  4725. of text from a file.  The Dest$ variable must be set to the
  4726. desired maximum length beforehand.  On return, the number of
  4727. characters is returned in DLen%, and TooLong% will be set if
  4728. the Dest$ variable is full and a carriage return/linefeed pair
  4729. was not (yet?) found.
  4730.  
  4731.    Dest$ = SPACE$(MaxLength%)
  4732.    FReadLn Handle%, Dest$, DLen%, TooLong%, ErrCode%
  4733.    Dest$ = LEFT$(Dest$, DLen%)
  4734.  
  4735. Handle%    handle of the file
  4736. -------
  4737. Dest$      result (init to max length first)
  4738. DLen%      number of characters in result
  4739. TooLong%   zero if we read it all, -1 if CR/LF not found
  4740. ErrCode%   zero if no error, else DOS error code
  4741.  
  4742. Name  : FromPostal$          (From Postal Abbreviation)
  4743. Class : String
  4744. Level : Any
  4745.  
  4746. This function returns the state name corresponding to a given
  4747. two-letter postal abbreviation.  It handles all U.S. postal
  4748. abbreviations, including states (e.g., "AZ" = "Arizona") and a
  4749. number of other countries (e.g., "PR" = "Puerto Rico").  A null
  4750. string ("") is returned if the specified abbreviation is not a
  4751. valid code.
  4752.  
  4753. The conversion can also be done the other way around-- see the
  4754. ToPostal$ function.
  4755.  
  4756.    PlaceName$ = FromPostal$(Abbrev$)
  4757.  
  4758. Abbrev$      two-letter postal abbreviation
  4759. -------
  4760. PlaceName$   place name corresponding with abbreviation
  4761.  
  4762. Name  : FSetEnd              (File Set to End)
  4763. Class : Disk
  4764. Level : DOS
  4765.  
  4766. This moves the file pointer to the end of the file.  It is for
  4767. use with files opened by FOpen1 or FCreate.  The usual purpose
  4768. for this is to append information to an existing file.
  4769.  
  4770. Note that some text files may have a Control-Z or CHR$(26) on
  4771. the end.  For historical reasons, this character is sometimes
  4772. used as an "end of file" marker.  When dealing with text files,
  4773. you may want to examine the last character of the file to make
  4774. sure it isn't a Control-Z.
  4775.  
  4776. Some of Microsoft's BASIC compilers are among the programs
  4777. which, unfortunately, put a Control-Z at the end of a file (if
  4778. you OPEN for OUTPUT).
  4779.  
  4780.    FSetEnd Handle%
  4781.  
  4782. Handle%    handle of the file
  4783.  
  4784. Name  : FSetLoc              (File Set Location to byte)
  4785. Class : Disk
  4786. Level : DOS
  4787.  
  4788. This moves the file pointer to a specified position in the
  4789. file.  It is for use with files opened by FOpen1 or FCreate.
  4790. File positions are considered to start at 1.
  4791.  
  4792.    FSetLoc Handle%, Posn&
  4793.  
  4794. Handle%    handle of the file
  4795. Posn&      location to which to move
  4796.  
  4797. Name  : FSetOfs              (File Set location by Offset)
  4798. Class : Disk
  4799. Level : DOS
  4800.  
  4801. This moves the file pointer backwards or forwards in the file.
  4802. It is for use with files opened by FOpen1 or FCreate.
  4803.  
  4804.    FSetOfs Handle%, Offset&
  4805.  
  4806. Handle%    handle of the file
  4807. Offset&    number of bytes by which to move
  4808.  
  4809. Name  : FSetRec              (File Set location to Record)
  4810. Class : Disk
  4811. Level : DOS
  4812.  
  4813. This sets the file pointer to a specific record in the file.
  4814. It is for use with files opened by FOpen1 or FCreate.
  4815.  
  4816. This routine provides the same function as FSetLoc, but is a
  4817. bit more convenient for dealing with files composed of
  4818. fixed-length records.
  4819.  
  4820.    FSetRec Handle%, RecSize%, RecNr%
  4821.  
  4822. Handle%    handle of the file
  4823. RecSize%   number of bytes per record
  4824. RecNr%     number of record (starting at 1)
  4825.  
  4826. Name  : FSetSize             (File Set Size)
  4827. Class : Disk
  4828. Level : DOS
  4829.  
  4830. Many people have asked how to delete information from a file.
  4831. Well, there's no straightforward way to do it most of the time,
  4832. but if the record is at the end of the file, you can chop it
  4833. right off.
  4834.  
  4835. This routine can also be used to make a file larger, perhaps
  4836. pre-allocating space that will be used later (for better speed).
  4837.  
  4838. The file in question must have been opened by FCreate or FOpen1.
  4839.  
  4840.    FSetSize Handle%, Bytes&
  4841.  
  4842. Handle%    handle of the file
  4843. Bytes&     desired file size, in bytes
  4844.  
  4845. Name  : FSize                (File get Size)
  4846. Class : Disk
  4847. Level : DOS
  4848.  
  4849. This routine allows you to get the size of a file that was
  4850. opened by FOpen1 or FCreate.
  4851.  
  4852. See also FSize2, the FUNCTION version of this routine.
  4853.  
  4854.    FSize Handle%, Bytes&
  4855.  
  4856. Handle%    handle of the file
  4857. -------
  4858. Bytes&     file size, in bytes
  4859.  
  4860. Name  : FSize2&              (File get Size)
  4861. Class : Disk
  4862. Level : DOS
  4863.  
  4864. This routine allows you to get the size of a file that was
  4865. opened by FOpen1 or FCreate.
  4866.  
  4867. See also FSize, the Sub version of this routine.
  4868.  
  4869.    Bytes& = FSize2&(Handle%)
  4870.  
  4871. Handle%    handle of the file
  4872. -------
  4873. Bytes&     file size, in bytes
  4874.  
  4875. Name  : FUnlock              (File Unlock)
  4876. Class : Disk
  4877. Level : DOS
  4878.  
  4879. This routine unlocks any part of a file.  It is used to undo
  4880. the effects of FLock, which locks any part of a file.  It is
  4881. important to pass the exact same parameters to FUnlock as you
  4882. did to FLock.  See also FLock.
  4883.  
  4884. Note that it is IMPORTANT to unlock the locked area before the
  4885. file is closed and before your program terminates.  If the file
  4886. is not properly unlocked, it may be damaged.
  4887.  
  4888.    FUnlock FileHandle%, StartPosn&, Bytes&, ErrCode%
  4889.  
  4890. FileHandle%    file handle
  4891. StartPosn&     starting offset (1 for first position)
  4892. Bytes&         number of bytes to unlock
  4893. -------
  4894. ErrCode%       error code (0 if no error, else DOS error code)
  4895.  
  4896. Name  : Get4DOSv             (Get 4DOS Version)
  4897. Class : Equipment
  4898. Level : DOS
  4899.  
  4900. The Get4DOSv routine returns the version of 4DOS being used.
  4901. It returns the results as two integers containing the major and
  4902. minor version numbers. For instance, 4DOS 4.0 would return a
  4903. major number of 4, minor 0.  If 4DOS is not installed, both
  4904. version numbers will be zero.
  4905.  
  4906. If you're not familiar with 4DOS, it's a terrific improved
  4907. replacement for COMMAND.COM.  For more information, write JP
  4908. Software Inc., P.O. Box 1470, Arlington MA 02174, or call your
  4909. local BBS.
  4910.  
  4911.    Get4DOSv MajorV%, MinorV%
  4912.  
  4913. -------
  4914. MajorV%   major part of the 4DOS version
  4915. MinorV%   minor part of the 4DOS version
  4916.  
  4917. Name  : GetAttrF             (Get Attribute of File)
  4918. Class : Disk
  4919. Level : DOS
  4920.  
  4921. The GetAttrF routine returns the attributes of a file matched
  4922. by FindFirstF or FindNextF.
  4923.  
  4924.    Normal          0      (nothing special)
  4925.    Read Only       1      file can be read, but not written to
  4926.    Hidden          2      file is "invisible"
  4927.    System          4      special DOS system file
  4928.    Subdirectory   16      subdirectory
  4929.    Archive        32      (used by some backup utilities)
  4930.  
  4931. You can see if a certain value is set using the AND operator:
  4932.  
  4933.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4934.  
  4935. Since the values are all powers of two, the AND operator makes
  4936. for a convenient way of decoding the results.
  4937.  
  4938. See also the ExplainFAttr$ function, which decodes the meanings
  4939. of the attribute for you.
  4940.  
  4941. Routines in this series include:
  4942.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4943.    GetTimeF, GetSizeFL
  4944.  
  4945.    GetAttrF FAttr%
  4946.  
  4947. -------
  4948. FAttr%   attributes that are set
  4949.  
  4950. Name  : GetAttrFx%           (Get Attribute of File, Extended)
  4951. Class : Disk
  4952. Level : DOS
  4953.  
  4954. The GetAttrFx% function returns the attributes of a file
  4955. matched by FindFirstFx or FindNextFx.
  4956.  
  4957.    Normal          0      (nothing special)
  4958.    Read Only       1      file can be read, but not written to
  4959.    Hidden          2      file is "invisible"
  4960.    System          4      special DOS system file
  4961.    Subdirectory   16      subdirectory
  4962.    Archive        32      (used by some backup utilities)
  4963.  
  4964. You can see if a certain value is set using the AND operator:
  4965.  
  4966.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4967.  
  4968. Since the values are all powers of two, the AND operator makes
  4969. for a convenient way of decoding the results.
  4970.  
  4971. See also the ExplainFAttr$ function, which decodes the meanings
  4972. of the attribute for you.
  4973.  
  4974. Routines in this series include:
  4975.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4976.    GetTimeFx$, GetSizeFx&
  4977.  
  4978.    FAttr% = GetAttrFx%(Buffer$)
  4979.  
  4980. Buffer$   buffer used in search
  4981. -------
  4982. FAttr%    file attributes
  4983.  
  4984. Name  : GetColor             (Get Color)
  4985. Class : Display
  4986. Level : Clone
  4987.  
  4988. This routine tells you the current default foreground and
  4989. background colors being used by BASIC.  It should be used only
  4990. in text modes.
  4991.  
  4992.    GetColor Foreground%, Background%
  4993.  
  4994. -------
  4995. Foreground%   foreground color
  4996. Background%   background color
  4997.  
  4998. Name  : GetCommAddr          (Get Comm Address)
  4999. Class : Serial
  5000. Level : Clone
  5001.  
  5002. This routine allows you to determine the base port address of a
  5003. serial port. You tell it the COM port number (1-4) and it
  5004. returns the port address.  If there is no port installed, zero
  5005. will be returned.
  5006.  
  5007. Note that ports are "supposed" to be assigned sequentially-- in
  5008. other words, if you find a "zero" port address, there will be
  5009. no ports after that.  This is not necessarily the case,
  5010. however.  Some semi-standard machines may have a COM2 without a
  5011. COM1, for instance.  QuickBASIC gets confused in that case, but
  5012. it's no problem with my PBClone or BasWiz libraries.
  5013.  
  5014. Aside from purely informational purposes, this routine can be
  5015. useful in conjunction with SetCommAddr in manipulating the
  5016. serial ports.
  5017.  
  5018.    GetCommAddr PortNr%, PortAddr%
  5019.  
  5020. PortNr%     COM port number (1-4)
  5021. -------
  5022. PortAddr%   port address
  5023.  
  5024. Name  : GetCRCA              (Get CRC of Archive file)
  5025. Class : Disk / Time
  5026. Level : DOS
  5027.  
  5028. GetCRCA returns the 16-bit CRC of an archived file matched by
  5029. the FindFirstA or FindNextA routines.  Since some archives use
  5030. 32-bit CRCs, you may wish to use the more generic version of
  5031. this routine, GetCRCAL.
  5032.  
  5033. Routines in this series include:
  5034.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5035.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5036.  
  5037.    GetCRCA CRC16%
  5038.  
  5039. -------
  5040. CRC16%     16-bit CRC
  5041.  
  5042. Name  : GetCRCAL             (Get CRC of Archive file as Long)
  5043. Class : Disk / Time
  5044. Level : DOS
  5045.  
  5046. GetCRCAL returns the 32-bit CRC of an archived file matched by
  5047. the FindFirstA or FindNextA routines.  If the archive only has
  5048. a 16-bit CRC, the result is converted to 32 bits, so this
  5049. routine works with all archives.
  5050.  
  5051. Routines in this series include:
  5052.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5053.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5054.  
  5055.    GetCRCAL CRC32%
  5056.  
  5057. -------
  5058. CRC32%     32-bit CRC
  5059.  
  5060. Name  : GetCRT               (Get CRT)
  5061. Class : Display / Equipment
  5062. Level : Clone
  5063.  
  5064. The GetCRT routine simply tells you whether the current display
  5065. is capable of handling colors or not.  An unsophisticated
  5066. routine, GetCRT assumes that if the display is an MDA/Hercules,
  5067. it can't do color, but otherwise it can.
  5068.  
  5069. See also GetEGA, GetHGA and GetVGA.
  5070.  
  5071.    GetCRT Colour%
  5072.  
  5073. -------
  5074. Colour%   whether the display is color (0 if no)
  5075.  
  5076. Name  : GetCRT2%             (Get CRT)
  5077. Class : Display / Equipment
  5078. Level : Clone
  5079.  
  5080. The GetCRT2 routine simply tells you whether the current
  5081. display is capable of handling colors or not.  An
  5082. unsophisticated routine, GetCRT2 assumes that if the display is
  5083. an MDA/Hercules, it can't do color, but otherwise it can.
  5084.  
  5085. See also GetEGA, GetHGA and GetVGA.
  5086.  
  5087.    Colour% = GetCRT%
  5088.  
  5089. -------
  5090. Colour%   whether the display is color (0 if no)
  5091.  
  5092. Name  : GetDateA             (Get Date of Archive file)
  5093. Class : Disk / Time
  5094. Level : DOS
  5095.  
  5096. GetDateA returns the date of a archived file matched by the
  5097. FindFirstA or FindNextA routines.
  5098.  
  5099. Routines in this series include:
  5100.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5101.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5102.  
  5103.    GetDateA MonthNr%, DayNr%, YearNr%
  5104.  
  5105. -------
  5106. MonthNr%    month
  5107. DayNr%      day
  5108. YearNr%     year
  5109.  
  5110. Name  : GetDateAT            (Get Date from AT clock)
  5111. Class : Time
  5112. Level : BIOS (AT)
  5113.  
  5114. This routine gets the date from the hardware real-time clock in
  5115. AT-class computers.  Depending on the DOS version, this date
  5116. may be partially or completely independent of the date kept by
  5117. DOS in software.  DOS always reads the date from the hardware
  5118. clock when it starts up.  However, use of the DATE command in
  5119. DOS (and the DATE$ function in QuickBASIC) may relate only to
  5120. the software copy of the date, which is not always guaranteed
  5121. to be the same as the date in the hardware clock due to certain
  5122. discrepancies in DOS.
  5123.  
  5124.    GetDateAT MonthNr%, DayNr%, YearNr%, ErrCode%
  5125.  
  5126. -------
  5127. MonthNr%     month number (1-12)
  5128. DayNr%       day (1-31)
  5129. YearNr%      year (1980-2079)
  5130. ErrCode%     error code: 0 if no error, else clock has stopped
  5131.  
  5132. Name  : GetDateF             (Get Date of File)
  5133. Class : Disk / Time
  5134. Level : DOS
  5135.  
  5136. The GetDateF routine returns the date of a file matched by
  5137. FindFirstF or FindNextF.
  5138.  
  5139. Routines in this series include:
  5140.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5141.    GetTimeF, GetSizeFL
  5142.  
  5143.    GetDateF MonthNr%, DayNr%, YearNr%
  5144.  
  5145. -------
  5146. MonthNr%    month
  5147. DayNr%      day
  5148. YearNr%     year
  5149.  
  5150. Name  : GetDateFx$           (Get Date of File, Extended)
  5151. Class : Disk / Time
  5152. Level : DOS
  5153.  
  5154. The GetDateFx$ function returns the date of a file matched by
  5155. FindFirstFx or FindNextFx.
  5156.  
  5157. Routines in this series include:
  5158.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5159.    GetTimeFx$, GetSizeFx&
  5160.  
  5161.    FileDate$ = GetDateFx$(Buffer$)
  5162.  
  5163. Buffer$     buffer used in search
  5164. -------
  5165. FileDate$   date of file (e.g., "02-28-1991")
  5166.  
  5167. Name  : GetDOSv              (Get DOS Version)
  5168. Class : Equipment
  5169. Level : DOS
  5170.  
  5171. The GetDOSv routine tells you what version of DOS you're
  5172. using.  It returns the results as two integers containing the
  5173. major and minor version numbers. For instance, MS-DOS 2.11
  5174. would return a major number of 2, minor 11.
  5175.  
  5176. The OS/2 compatibility box returns version numbers beginning at
  5177. 10.00.  For instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0
  5178. returns 20.00.
  5179.  
  5180.    GetDOSv MajorV%, MinorV%
  5181.  
  5182. -------
  5183. MajorV%   major part of the DOS version
  5184. MinorV%   minor part of the DOS version
  5185.  
  5186. Name  : GetDrive$            (Get default Drive)
  5187. Class : Disk
  5188. Level : DOS
  5189.  
  5190. This routine tells you the letter of the current default drive.
  5191.  
  5192. See also GetDrv, the SUB version of this routine.
  5193.  
  5194.    Drive$ = GetDrive$
  5195.  
  5196. -------
  5197. Drive$    default drive letter.
  5198.  
  5199. Name  : GetDrv               (Get default Drive)
  5200. Class : Disk
  5201. Level : DOS
  5202.  
  5203. This routine tells you the letter of the current default drive.
  5204.  
  5205. See also GetDrive, the FUNCTION version of this routine.
  5206.  
  5207.    Drive$ = "x"
  5208.    GetDrv Drive$
  5209.  
  5210. -------
  5211. Drive$    default drive letter.  Init to at least one character.
  5212.  
  5213. Name  : GetDView             (Get DESQview version)
  5214. Class : Miscellaneous
  5215. Level : DOS
  5216.  
  5217. The GetDView routine tells you what version of DESQview is
  5218. loaded.  It returns the results as two integers containing the
  5219. major and minor version numbers.  For instance, DESQview 2.0
  5220. would return a major number of 2 and a minor number of 0.  If
  5221. DESQview is not loaded, zeroes are returned.
  5222.  
  5223. See also GetTView, GetTVScreen, UpdTVScreen.
  5224.  
  5225.    GetDView MajorV%, MinorV%
  5226.  
  5227. -------
  5228. MajorV%   major part of the DESQview version (0 if no DESQview)
  5229. MinorV%   minor part of the DESQview version
  5230.  
  5231. Name  : GetEGA               (Get EGA information)
  5232. Class : Display / Equipment
  5233. Level : BIOS
  5234.  
  5235. This routine tells you whether an EGA (or VGA) is available,
  5236. and if so, what kind.  It tells you whether the attached
  5237. display is monochrome or color, and how many kilobytes of RAM
  5238. are installed in the adapter.
  5239.  
  5240. Many early EGAs had only 64K of RAM.  Current adapters have
  5241. 256K or more. Since there are some limitations attached to
  5242. having only 64K, it's a good idea to see if this is the case--
  5243. most PBClone EGA routines won't work properly on 64k adapters.
  5244.  
  5245. See also GetCRT, GetHGA and GetVGA.
  5246.  
  5247. See also GetEGA2, the FUNCTION version of this routine.
  5248.  
  5249.    GetEGA Display%, KBytes%
  5250.  
  5251. -------
  5252. Display%  EGA display type: 0 no EGA, 1 EGA color, 2 EGA mono
  5253. KBytes%   kilobytes of display memory
  5254.  
  5255. Name  : GetEGA2%             (Get EGA information)
  5256. Class : Display / Equipment
  5257. Level : BIOS
  5258.  
  5259. This routine tells you whether an EGA (or VGA) is available.
  5260.  
  5261. See also GetCRT2, GetHGA and GetVGA2.
  5262.  
  5263. See also GetEGA, the SUB version of this routine.  It returns
  5264. additional information.
  5265.  
  5266.    IsEGA% = GetEGA2%
  5267.  
  5268. -------
  5269. IsEGA%    whether the display is an EGA (0 if no)
  5270.  
  5271. Name  : GetError             (Get Error code from DOS)
  5272. Class : Miscellaneous
  5273. Level : Clone
  5274.  
  5275. NOTE: The GetError2% function should be used in preference to
  5276. this routine.
  5277.  
  5278. The GetError routine is used in conjunction with CatchError.
  5279. It lets you get the exit code (error level) returned by a
  5280. program to which you have SHELLed. Since CatchError hooks an
  5281. interrupt to do its work, you must always make sure to use
  5282. GetError afterwards to "clean up".  See also CatchError.
  5283.  
  5284. Note that differences in DOS mean that this routine will not
  5285. always work.  In some versions of DOS, you can only get the
  5286. error level if a batch file was executed; in others, you can't
  5287. get the error level from a batch file at all. Sorry about
  5288. that.  I don't know of any way to work around it.
  5289.  
  5290.    CatchError
  5291.    SHELL ProgramName$
  5292.    GetError ExitCode%
  5293.  
  5294. -------
  5295. ExitCode%   exit code returned by SHELLed-to program (0-255)
  5296.  
  5297. Name  : GetError2%           (Get Error code from DOS)
  5298. Class : Miscellaneous
  5299. Level : DOS
  5300.  
  5301. The GetError2% function gets the exit code (error level)
  5302. returned by a program to which you have SHELLed.  It should be
  5303. used as soon as possible after the SHELL, and its value will
  5304. only be meaningful on the first call after the SHELL.
  5305.  
  5306. This routine should be used in preference to CatchError and
  5307. GetError.
  5308.  
  5309.    SHELL ProgramName$
  5310.    ExitCode% = GetError2%
  5311.  
  5312. -------
  5313. ExitCode%   exit code returned by SHELLed-to program (0-255)
  5314.  
  5315. Name  : GetExecPath          (Get Execution Path of program)
  5316. Class : Disk
  5317. Level : DOS 3.0+
  5318.  
  5319. This routine returns the full path of your program, i.e., the
  5320. drive, subdirectory, and name of the program.  It does not rely
  5321. on the current drive and subdirectory settings or look at the
  5322. PATH setting-- DOS tells it directly.  This makes it an
  5323. excellent way to find the program's "home" directory, where
  5324. (hopefully) any data files associated with the program will
  5325. also be stored.
  5326.  
  5327.    SelfName$ = SPACE$(80)
  5328.    GetExecPath SelfName$, SelfLen%
  5329.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  5330.  
  5331. -------
  5332. SelfName$   full path for current program.  Init to 80+ chars.
  5333. SelfLen%    length of the full path spec.
  5334.  
  5335. Name  : GetExtM              (Get Extended Memory)
  5336. Class : Memory / Equipment
  5337. Level : BIOS (AT)
  5338.  
  5339. This routine allows you to find out how much extended memory is
  5340. available. It should only be used on AT-class computers, since
  5341. older PCs do not support extended memory.  Note that some of
  5342. the very early AT machines will return erroneous results.
  5343.  
  5344. The amount of memory returned may be either the total amount of
  5345. extended memory installed or just the amount available at this
  5346. time, depending on how previously-installed programs (if any)
  5347. make use of extended memory. Unfortunately, there is no
  5348. standard which defines how a program should use extended memory
  5349. as there is with EMS (expanded memory), so there is no way for
  5350. a program to determine whether or how another program is using
  5351. extended memory.  Microsoft is trying to clear up this
  5352. situation with its HIMEM driver (available at your local BBS,
  5353. or [last I looked] free from Microsoft), but this approach
  5354. hasn't really become standard yet.
  5355.  
  5356.    GetExtM KBytes%
  5357.  
  5358. -------
  5359. KBytes%    the number of kilobytes of extended memory
  5360.  
  5361. Name  : GetFAttr             (Get File Attribute)
  5362. Class : Disk
  5363. Level : DOS
  5364.  
  5365. This routine lets you read the attributes of a file or
  5366. subdirectory.  The attributes may contain a combination of any
  5367. of the following:
  5368.  
  5369.    Normal          0      (nothing special)
  5370.    Read Only       1      file can be read, but not written to
  5371.    Hidden          2      file is "invisible"
  5372.    System          4      special DOS system file
  5373.    Subdirectory   16      subdirectory
  5374.    Archive        32      (used by some backup utilities)
  5375.  
  5376. You can see if a certain value is set by using the AND operator:
  5377.  
  5378.    IF FAttr% AND 2 THEN PRINT "Hidden file"
  5379.  
  5380. Since the values are all powers of two, the AND operator makes
  5381. for a convenient way of decoding the results.
  5382.  
  5383. See also the ExplainFAttr$ function, which decodes the meanings
  5384. of the attribute for you.
  5385.  
  5386.    GetFAttr FileName$, FAttr%
  5387.  
  5388. FileName$   name of the file (or subdirectory) to examine
  5389. -------
  5390. FAttr%      attributes that are set
  5391.  
  5392. Name  : GetFDate             (Get File Date)
  5393. Class : Disk / Time
  5394. Level : DOS
  5395.  
  5396. This routine gets the date of a file.
  5397.  
  5398.    GetFDate FileName$, MonthNr%, DayNr%, YearNr%
  5399.  
  5400. FileName$   name of the file to examine
  5401. -------
  5402. MonthNr%    month
  5403. DayNr%      day
  5404. YearNr%     year
  5405.  
  5406. Name  : GetFSize             (Get File Size)
  5407. Class : Disk
  5408. Level : DOS
  5409.  
  5410. This function gets the size of a file.
  5411.  
  5412.    FileSize& = GetFSize&(FileName$)
  5413.  
  5414. FileName$   name of the file to examine
  5415. -------
  5416. FileSize&   size of the file, in bytes
  5417.  
  5418. Name  : GetFTime             (Get File Time)
  5419. Class : Disk / Time
  5420. Level : DOS
  5421.  
  5422. This routine gets the time of a file.
  5423.  
  5424.    GetFTime FileName$, HourNr%, MinuteNr%, SecondNr%
  5425.  
  5426. FileName$     name of the file to examine
  5427. -------
  5428. HourNr%       hour
  5429. MinuteNr%     minute
  5430. SecondNr%     second (always even, due to DOS storage techniques)
  5431.  
  5432. Name  : GetHGA%              (Get Hercules Adapter info)
  5433. Class : Display / Equipment
  5434. Level : Clone
  5435.  
  5436. This routine tells you whether a Hercules-compatible monochrome
  5437. graphics adapter is in use.
  5438.  
  5439. See also GetCRT2, GetEGA and GetVGA2.
  5440.  
  5441.    IsHGA% = GetHGA%
  5442.  
  5443. -------
  5444. IsHGA%    whether the display is Hercules mono graphics (0 no)
  5445.  
  5446. Name  : GetKbd               (Get Keyboard toggles)
  5447. Class : Input
  5448. Level : Clone
  5449.  
  5450. The GetKbd routine allows you to get the state of the four
  5451. keyboard toggles: Insert, Caps lock, Num lock, and Scroll Lock.
  5452.  
  5453.    GetKbd Insert%, Caps%, Num%, Scrl%
  5454.  
  5455. -------
  5456. Insert%    whether "insert" mode is on (0 if no)
  5457. Caps%      whether "caps lock" is on (0 if no)
  5458. Num%       whether "num lock" is on (0 if no)
  5459. Scrl%      whether "scroll lock" is on (0 if no)
  5460.  
  5461. Name  : GetKbd1              (Get Keyboard Shifts)
  5462. Class : Input
  5463. Level : Clone
  5464.  
  5465. The GetKbd1 routine allows you to get the state of the four
  5466. keyboard shift keys: Left shift, Right shift, Control and Alt.
  5467.  
  5468.    GetKbd1 LShift%, RShift%, Control%, Alt%
  5469.  
  5470. -------
  5471. LShift%    whether the left shift key is depressed (0 if no)
  5472. RShift%    whether the right shift key is depressed (0 if no)
  5473. Control%   whether a control key is depressed (0 if no)
  5474. Alt%       whether an alt key is depressed (0 if no)
  5475.  
  5476. Name  : GetKbd2              (Get Keyboard Shifts)
  5477. Class : Input
  5478. Level : AT BIOS
  5479.  
  5480. The GetKbd2 routine allows you to get the state of the six
  5481. keyboard shift keys on an "enhanced" keyboard: Left shift,
  5482. Right shift, Left Control, Right Control, Left Alt and Right
  5483. Alt.
  5484.  
  5485. Normally, the BIOS only lets you see one key at a time, which
  5486. can be a barrier when you need more input.  This is a
  5487. particular problem with action games and other real-time
  5488. applications which have complex input requirements. Due to the
  5489. special way the BIOS treats shift keys, GetKbd2 can tell if the
  5490. the various shift keys are pressed simultaneously, allowing
  5491. more flexibility.
  5492.  
  5493.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  5494.  
  5495. -------
  5496. LShift%    whether the left shift key is depressed (0 if no)
  5497. RShift%    whether the right shift key is depressed (0 if no)
  5498. LCtrl%     whether the left control key is depressed (0 if no)
  5499. RCtrl%     whether the right control key is depressed (0 if no)
  5500. LAlt%      whether the left alt key is depressed (0 if no)
  5501. RAlt%      whether the right alt key is depressed (0 if no)
  5502.  
  5503. Name  : GetKey               (Get Key or mouse)
  5504. Class : Input, Mouse
  5505. Level : BIOS
  5506.  
  5507. This routine is kind of an extended version of INPUT$.  It
  5508. waits until a key is available at the keyboard and returns the
  5509. key pressed.  At your option, it can also return if a mouse
  5510. button is pressed.
  5511.  
  5512. See also the LClickLoc and RClickLoc routines, which allow you
  5513. to determine what the mouse position was at the last click.
  5514.  
  5515.    GetKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  5516.  
  5517. Mouse%        whether to check the mouse (0: no)
  5518. -------
  5519. ASCIIcode%    ASCII code of the key pressed
  5520. ScanCode%     scan code of the key pressed (0 if none)
  5521. LButton%   whether the left  mouse button was pressed
  5522. RButton%  whether the right mouse button was pressed
  5523.  
  5524. Name  : GetKey3              (Get Key or 3-button mouse)
  5525. Class : Input, Mouse
  5526. Level : BIOS
  5527.  
  5528. This routine is kind of an extended version of INPUT$.  It
  5529. waits until a key is available at the keyboard and returns the
  5530. key pressed.  At your option, it can also return if a mouse
  5531. button is pressed.
  5532.  
  5533. See also the LClickLoc, MClickLoc and RClickLoc routines, which
  5534. allow you to determine what the mouse position was at the last
  5535. click.
  5536.  
  5537.    GetKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  5538.       MButton%, RButton%
  5539.  
  5540. Mouse%        whether to check the mouse (0: no)
  5541. -------
  5542. ASCIIcode%    ASCII code of the key pressed
  5543. ScanCode%     scan code of the key pressed (0 if none)
  5544. LButton%      whether the left   mouse button is pressed
  5545. MButton%      whether the middle mouse button is pressed
  5546. RButton%      whether the right  mouse button is pressed
  5547.  
  5548. Name  : GetLabel             (Get disk volume Label)
  5549. Class : Disk
  5550. Level : DOS
  5551.  
  5552. This routine gets the volume label from a specified drive.  See
  5553. also GetLabel2$.
  5554.  
  5555.    Label$ = SPACE$(11)
  5556.    GetLabel Drive$, Label$, LabelLen%, ErrCode%
  5557.    Label$ = LEFT$(Label$, LabelLen%)
  5558.  
  5559. Drive$     letter of the drive to examine
  5560. -------
  5561. Label$     volume label of drive.  Init to >= 11 chars.
  5562. LabelLen%  length of the volume label
  5563. ErrCode%   error code: 0 if no error, else DOS Error
  5564.  
  5565. Name  : GetLabel2$           (Get disk volume Label)
  5566. Class : Disk
  5567. Level : DOS
  5568.  
  5569. This routine gets the volume label from a specified drive.  See
  5570. also GetLabel, a subprogram version of this routine.  The
  5571. GetLabel subprogram is preferable in that it returns an error
  5572. code, but you may find the function version more convenient if
  5573. error checking is not desired.
  5574.  
  5575.    Label$ = GetLabel2$(Drive$)
  5576.  
  5577. Drive$     letter of the drive to examine
  5578. -------
  5579. Label$     volume label of the specified drive.
  5580.  
  5581. Name  : GetLIMHandles        (Get L/I/M expanded mem Handles)
  5582. Class : Memory
  5583. Level : DOS
  5584.  
  5585. Early Lotus/Intel/Microsoft expanded memory revisions provided
  5586. a limited number of "handles" which could be used to access
  5587. expanded memory-- often as few as 15 or so.  If your program
  5588. uses expanded memory and the EMS driver is one of the older
  5589. versions, you may want to make sure that enough handles are
  5590. available.  This routine tells you how many handles are in use.
  5591.  
  5592. Note that this routine expects an EMS driver to be installed.
  5593. If you can't be sure of that, use GetLIMM first to avoid an
  5594. unpleasant surprise.
  5595.  
  5596.    GetLIMHandles Handles%
  5597.  
  5598. -------
  5599. Handles%  number of EMS handles in use
  5600.  
  5601. Name  : GetLIMM              (Get L/I/M expanded Memory)
  5602. Class : Memory / Equipment
  5603. Level : DOS
  5604.  
  5605. This routine tells you how much expanded memory is installed.
  5606. If there is none, or if the EMS driver hasn't been installed,
  5607. it returns zeroes.  You should use this routine before any
  5608. other of the PBClone routines that access expanded memory,
  5609. since the other routines expect EMS to be available.
  5610.  
  5611. The results are returned in terms of EMS pages.  Each page is
  5612. 16 kilobytes.
  5613.  
  5614.    GetLIMM TotalPages%, FreePages%
  5615.  
  5616. -------
  5617. TotalPages%  number of EMS pages installed
  5618. FreePages%   number of EMS pages available for use
  5619.  
  5620. Name  : GetLIMV              (Get L/I/M expanded mem Version)
  5621. Class : Memory / Equipment
  5622. Level : DOS
  5623.  
  5624. The GetLIMV routine tells you the version of EMS driver that is
  5625. being used. The version number is separated into major and
  5626. minor parts.  For example, an EMS 3.1 driver would return a
  5627. major number of 3 and minor number of 1.
  5628.  
  5629. Note that this routine expects an EMS driver to be installed.
  5630. If you can't be sure of that, use GetLIMM first to avoid an
  5631. unpleasant surprise.
  5632.  
  5633.    GetLIMV MajorVer%, MinorVer%
  5634.  
  5635. -------
  5636. MajorVer%  major part of the EMS version number
  5637. MinorVer%  minor part of the EMS version number
  5638.  
  5639. Name  : GetLine              (Get Line of text)
  5640. Class : Display
  5641. Level : Any
  5642.  
  5643. This routine retrieves a row of text from a saved (or virtual)
  5644. screen.
  5645.  
  5646. You can use GetLine with a saved screen of any size.  The St$
  5647. parameter must be initialized to the width of the saved screen
  5648. (in columns).
  5649.  
  5650. See also ReadScreen, which allows you to read a string of any
  5651. length directly from the display.
  5652.  
  5653.    St$ = SPACE$(ScrWidth%)   ' init to v. screen width
  5654.    GetLine DSeg%, DOfs%, Row%, St$, SLen%
  5655.    St$ = LEFT$(St$, SLen%)
  5656.  
  5657. DSeg%      segment of saved screen
  5658. DOfs%      offset of saved screen
  5659. Row%       row of saved screen (starting at 1)
  5660. -------
  5661. St$        text at given row (init to width of saved screen)
  5662. SLen       logical length of text
  5663.  
  5664. Name  : GetLogiDrive$        (Get Logical Drive)
  5665. Class : Disk
  5666. Level : DOS 3.2+
  5667.  
  5668. This routine is useful for systems which only have a single
  5669. floppy drive.  In such cases, DOS connects both drive letters
  5670. A: and B: to the same drive.  However, only one drive letter is
  5671. active, and when you try to access the "other" drive, DOS
  5672. displays the message:
  5673.  
  5674.   "Insert diskette for drive x: and press any key when ready."
  5675.  
  5676. This function allows you to determine whether a drive is
  5677. remapped, and if so, which letter is currently active for the
  5678. drive in question.  The result will be a null string ("") if
  5679. the drive is not multiply mapped; or, if the drive is multiply
  5680. mapped, the letter which currently refers to the drive is
  5681. returned.  For example, if you check drive "A" on a dual-floppy
  5682. system, you'll get back ""; but on a single-floppy system,
  5683. you'll get back "A" or "B", depending on which letter was last
  5684. used to access the drive.
  5685.  
  5686. See also SetLogiDrive, which allows you to set the active drive
  5687. letter for a given drive.
  5688.  
  5689.    ActiveDrv$ = GetLogiDrive$(Drive$)
  5690.  
  5691. Drive$       drive letter to check (use "" for current drive)
  5692. -------
  5693. ActiveDrv$   active drive letter, or "" if no remapping is done
  5694.  
  5695. Name  : GetMemBox            (Get Memory Box info)
  5696. Class : Memory
  5697. Level : DOS
  5698.  
  5699. The PBClone library comes with a TSR called MEMBOX.COM.  This
  5700. TSR reserves an area of memory which can be used as a transfer
  5701. area for communication between multiple programs-- the data
  5702. remains as long as the TSR is installed.
  5703.  
  5704. The GetMemBox routine tells you whether MEMBOX is installed,
  5705. how much memory it has, and the location of that memory.  You
  5706. can access the MEMBOX memory using any PBClone routine that
  5707. accepts segment and offset pointers.  The DGetSt and DPutSt
  5708. routines will probably be most helpful for general use.
  5709.  
  5710. NOTE that MEMBOX expects to be the last TSR installed.  If any
  5711. other TSR or program alters the INT 2Fh interrupt vector while
  5712. MEMBOX is active, the results are liable to be messy at best.
  5713.  
  5714.    GetMemLoc DSeg%, DOfs%, Bytes%
  5715.  
  5716. -------
  5717. DSeg%      memory segment
  5718. DOfs%      memory offset
  5719. Bytes%     bytes available (0 if MEMBOX is not installed)
  5720.  
  5721. Name  : GetMouseLoc          (Get Mouse Location)
  5722. Class : Mouse
  5723. Level : BIOS
  5724.  
  5725. This routine allows you to get the current location of the
  5726. mouse cursor.  It doesn't matter if the cursor is visible or
  5727. invisible.  GetMouseLoc is only for use in text mode.
  5728.  
  5729. This routine will not work properly if there is no mouse
  5730. available.  Use the MMCheck routine if you are not sure.
  5731.  
  5732. See also MMGetLoc, which returns the coordinates for graphics
  5733. mode.
  5734.  
  5735.    GetMouseLoc Row%, Column%
  5736.  
  5737. -------
  5738. Row%       mouse cursor row
  5739. Column%    mouse cursor column
  5740.  
  5741. Name  : GetMouseVer          (Get Mouse driver Version)
  5742. Class : Mouse
  5743. Level : BIOS
  5744.  
  5745. This routine retrieves various information about the mouse,
  5746. including the driver version number, mouse type, and IRQ used
  5747. by the mouse.
  5748.  
  5749. Note that this is among the mouse routines that makes you
  5750. wonder what Microsoft was thinking when they designed the mouse
  5751. driver.  The mouse driver has no provision for error codes and
  5752. the "get version" function was added comparatively recently, so
  5753. there is no way of knowing with certainty whether this routine
  5754. worked or what the mouse driver version is.  If that could be a
  5755. problem, you can reduce the risk by checking the returned
  5756. values to make sure they appear reasonable.
  5757.  
  5758. This routine will not work properly if there is no mouse
  5759. available.  Use the MMCheck routine if you are not sure.
  5760.  
  5761. The mouse type may be any of the following:
  5762.    1   bus mouse
  5763.    2   serial mouse
  5764.    3   InPort mouse
  5765.    4   PS/2 mouse
  5766.    5   Hewlett-Packard mouse
  5767.  
  5768. The IRQ will be 0 on the PS/2.  Otherwise, it will be 2-5 or 7
  5769. on Microsoft mice.  A mouse designed to take advantage of the
  5770. AT interrupt controller may use higher IRQs (to perhaps 15, I'm
  5771. not sure), so be generous if you do range checking here.
  5772.  
  5773. The version number is divided into two parts.  For instance,
  5774. mouse driver 8.20 would return a major version number of 8 and
  5775. a minor version number of 20.
  5776.  
  5777.    GetMouseVer MajorV%, MinorV%, MType%, IRQ%
  5778.  
  5779. -------
  5780. MajorV%    mouse driver major version number
  5781. MinorV%    mouse driver minor version number
  5782. MType%     mouse type
  5783. IRQ%       IRQ used by mouse
  5784.  
  5785. Name  : GetNameA             (Get Name of file in Archive)
  5786. Class : Disk
  5787. Level : DOS
  5788.  
  5789. GetNameA returns the name of an archived file matched by the
  5790. FindFirstA or FindNextA routines.  Since some archives may
  5791. include subdirectory specs along with the file name, it is
  5792. recommended that you initialize the return string to 80
  5793. characters (at least 12 are required).
  5794.  
  5795. When parsing filenames which may contain subdirectory specs,
  5796. keep in mind that the forward slash "/" may be used instead of
  5797. the backslash "\" for delimiting subdirectories.
  5798.  
  5799. In order to reach the very widest audience, you may also wish
  5800. to take into account filenames which may have originated on
  5801. non-PC systems.  In such filenames, the length of any part of
  5802. the path will not necessarily be restricted to the 11-plus-dot
  5803. of MS-DOS, the dot character may not mean anything special,
  5804. uppercase/lowercase distinctions may be significant, and
  5805. characters may be present which are not valid in MS-DOS names.
  5806.  
  5807. Routines in this series include:
  5808.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5809.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5810.  
  5811.    FileName$ = SPACE$(80)
  5812.    GetNameA FileName$, NameLen%
  5813.    FileName$ = LEFT$(FileName$, NameLen%)
  5814.  
  5815. -------
  5816. FileName$   file name (init to >= 12 characters, preferably 80)
  5817. NameLen%    length of file name
  5818.  
  5819. Name  : GetNameF             (Get Name of File)
  5820. Class : Disk
  5821. Level : DOS
  5822.  
  5823. The GetNameF routine returns the name of a file matched by
  5824. FindFirstF or FindNextF.  The name will not contain a drive or
  5825. subdirectory specification.
  5826.  
  5827. Routines in this series include:
  5828.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5829.    GetTimeF, GetSizeFL
  5830.  
  5831.    FileName$ = SPACE$(12)
  5832.    GetNameF FileName$, NameLen%
  5833.    FileName$ = LEFT$(FileName$, NameLen%)
  5834.  
  5835. -------
  5836. FileName$   file name (init to at least 12 characters)
  5837. NameLen%    length of file name
  5838.  
  5839. Name  : GetNameFx$           (Get Name of File, Extended)
  5840. Class : Disk
  5841. Level : DOS
  5842.  
  5843. The GetNameFx$ function returns the name of a file matched by
  5844. FindFirstFx or FindNextFx.  The name will not contain a drive
  5845. or subdirectory specification.
  5846.  
  5847. Routines in this series include:
  5848.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5849.    GetTimeFx$, GetSizeFx&
  5850.  
  5851.    FileName$ = GetNameFx$(Buffer$)
  5852.  
  5853. Buffer$       buffer used in search
  5854. -------
  5855. FileName$     file name
  5856.  
  5857. Name  : GetPrtAddr           (Get Printer Address)
  5858. Class : Printer
  5859. Level : Clone
  5860.  
  5861. This routine allows you to determine the base port address of a
  5862. parallel port.  You tell it the LPT port number (1-4) and it
  5863. returns the port address. If there is no port installed, zero
  5864. will be returned.
  5865.  
  5866. Note that up to four printer ports are (theoretically)
  5867. supported on most machines.  On PS/2 computers, only three
  5868. ports are allowed, and the fourth port data area is used for
  5869. other purposes.  So, it would probably be a good idea to
  5870. restrict your program to ports 1-3.
  5871.  
  5872. Aside from purely informational purposes, this routine can be
  5873. useful in conjunction with SetPrtAddr in manipulating the
  5874. parallel ports.
  5875.  
  5876.    GetPrtAddr PortNr%, PortAddr%
  5877.  
  5878. PortNr%     LPT port number (1-4 or 1-3 [see above])
  5879. -------
  5880. PortAddr%   port address
  5881.  
  5882. Name  : GetPrtSc%            (Get PrtSc press)
  5883. Class : Input
  5884. Level : BIOS
  5885.  
  5886. This function only works when the "print screen" key is
  5887. disabled, which you can accomplish via the PrtSc routine.  It
  5888. returns whether the print screen key was pressed since you last
  5889. checked.  Like INKEY$, it clears the value after you read it.
  5890.  
  5891.    Pressed% = GetPrtSc%
  5892.  
  5893. -------
  5894. Pressed%    whether the print screen key was pressed (0 if no)
  5895.  
  5896. Name  : GetPSP%              (Get Program Segment Prefix)
  5897. Class : Memory
  5898. Level : DOS
  5899.  
  5900. This function returns the segment of the Program Segment
  5901. Prefix, which is a sort of header at the beginning of every
  5902. program that contains assorted information.  You can find out
  5903. more about the PSP in any DOS technical reference.
  5904.  
  5905.    PSeg% = GetPSP%
  5906.  
  5907. -------
  5908. PSeg%      segment of the Program Segment Prefix
  5909.  
  5910. Name  : GetRows              (Get Rows on screen)
  5911. Class : Display
  5912. Level : Clone
  5913.  
  5914. This routine tells you how many rows are on the display.  This
  5915. is normally 25, but it may be greater on an EGA or VGA.  Only
  5916. text modes are supported.
  5917.  
  5918.    GetRows Rows%
  5919.  
  5920. -------
  5921. Rows%    text rows on the display
  5922.  
  5923. Name  : GetRows2%            (Get Rows on screen)
  5924. Class : Display
  5925. Level : Clone
  5926.  
  5927. This routine tells you how many rows are on the display.  This
  5928. is normally 25, but it may be greater on an EGA or VGA.  Only
  5929. text modes are supported.
  5930.  
  5931.    Rows% = GetRows2%
  5932.  
  5933. -------
  5934. Rows%    text rows on the display
  5935.  
  5936. Name  : GetScreen            (Get Screen)
  5937. Class : Display
  5938. Level : Clone
  5939.  
  5940. This routine saves any portion of the display to an array.
  5941. Only text modes are supported.  If your program uses multiple
  5942. display pages, you can get an image from any of those pages.  A
  5943. special "slow" mode is supported for the CGA, to prevent
  5944. flickering (a problem only with some CGAs).
  5945.  
  5946. The size of the integer array needed to store a specific area
  5947. of the screen can be calculated using the CalcSize routine
  5948. (see).
  5949.  
  5950. If you wish to save the entire screen, you may find ScrSave
  5951. easier (see).
  5952.  
  5953.    GetScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  5954.  
  5955. TRow%      top row of the desired screen area
  5956. LCol%      left column of the desired screen area
  5957. BRow%      bottom row of the desired screen area
  5958. RCol%      right column of the desired screen area
  5959. Page%      page from which to get the display area
  5960. Fast%      whether to use fast mode (0 no)
  5961. -------
  5962. Array%()   stored image of the selected area of the screen
  5963.  
  5964. Name  : GetSerial$           (Get disk Serial number)
  5965. Class : Disk
  5966. Level : DOS 4.0+
  5967.  
  5968. The GetSerial function returns the serial number of the
  5969. specified disk.  If there is no serial number, it returns
  5970. "0000-0000".
  5971.  
  5972.    SerialNr$ = GetSerial$(Drive$)
  5973.  
  5974. Drive$       drive to get serial # from ("" for current drive)
  5975. -------
  5976. SerialNr$    serial number of the specified drive
  5977.  
  5978. Name  : GetSizeAL            (Get Size of file in Archive Long)
  5979. Class : Disk
  5980. Level : DOS
  5981.  
  5982. GetSizeAL returns the size of an archived file matched by the
  5983. FindFirstA or FindNextA routines.
  5984.  
  5985. Routines in this series include:
  5986.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5987.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5988.  
  5989.    GetSizeAL OrigSize&, CurrSize&
  5990.  
  5991. -------
  5992. OrigSize&    original (uncompressed) file size
  5993. CurrSize&    current (compressed) file size
  5994.  
  5995. Name  : GetSizeFL            (Get Size of File as Long)
  5996. Class : Disk
  5997. Level : DOS
  5998.  
  5999. The GetSizeFL routine returns the size of a file matched by
  6000. FindFirstF or FindNextF.
  6001.  
  6002. Routines in this series include:
  6003.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  6004.    GetTimeF, GetSizeFL
  6005.  
  6006.    GetSizeFL FileSize&
  6007.  
  6008. -------
  6009. FileSize&   file size
  6010.  
  6011. Name  : GetSizeFx&           (Get Size of File, Extended)
  6012. Class : Disk
  6013. Level : DOS
  6014.  
  6015. The GetSizeFx& function returns the size of a file matched by
  6016. FindFirstFx or FindNextFx.
  6017.  
  6018. Routines in this series include:
  6019.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  6020.    GetTimeFx$, GetSizeFx&
  6021.  
  6022.    FileSize& = GetSizeFx&(Buffer$)
  6023.  
  6024. Buffer$     buffer used in search
  6025. -------
  6026. FileSize&   file size
  6027.  
  6028. Name  : GetStoreA            (Get Storage of file in Archive)
  6029. Class : Disk / Time
  6030. Level : DOS
  6031.  
  6032. GetStoreA returns the method used to compress an archived file
  6033. matched by the FindFirstA or FindNextA routines.
  6034.  
  6035. Routines in this series include:
  6036.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  6037.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  6038.  
  6039.    Storage$ = SPACE$(8)
  6040.    GetStoreA Storage$
  6041.  
  6042. -------
  6043. Storage$    storage method (init to 8 characters)
  6044.  
  6045. Name  : GetSub               (Get default Subdirectory)
  6046. Class : Disk
  6047. Level : DOS
  6048.  
  6049. The GetSub routine gets the current subdirectory on the default
  6050. drive.  It does not put a backslash at the start of the
  6051. subdirectory, so you should add this yourself.
  6052.  
  6053. See also GetSub1, which is a more advanced version of this
  6054. routine.
  6055.  
  6056.    SubDir$ = SPACE$(64)
  6057.    GetSub SubDir$, SubLen%
  6058.    SubDir$ = "\" + LEFT$(SubDir$, SubLen%)
  6059.  
  6060. -------
  6061. SubDir$    name of the current subdirectory. Init to 64+ chars
  6062. SubLen%    length of the subdirectory name
  6063.  
  6064. Name  : GetSub1              (Get default Subdirectory)
  6065. Class : Disk
  6066. Level : DOS
  6067.  
  6068. The GetSub1 routine gets the current subdirectory on a
  6069. specified drive. Unlike GetSub, it places a backslash at the
  6070. start of the name.  It also returns an error code, which allows
  6071. you to see if there was a disk error.
  6072.  
  6073. If you don't care about the error code, you may prefer GetSub2,
  6074. the FUNCTION version of this routine.
  6075.  
  6076.    SubDir$ = SPACE$(65)
  6077.    GetSub1 Drive$, SubDir$, SubLen%, ErrCode%
  6078.    SubDir$ = LEFT$(SubDir$, SubLen%)
  6079.  
  6080. Drive$     letter of the drive to check
  6081. -------
  6082. SubDir$    name of the current subdirectory. Init to 65+ chars
  6083. SubLen%    length of the subdirectory name
  6084. ErrCode%   error code: 0 if no error, else DOS Error
  6085.  
  6086. Name  : GetSub2$             (Get default Subdirectory)
  6087. Class : Disk
  6088. Level : DOS
  6089.  
  6090. The GetSub2 routine gets the current subdirectory on a
  6091. specified drive. Unlike GetSub, it places a backslash at the
  6092. start of the name.
  6093.  
  6094. See also GetSub1, the SUB version of this routine.  It returns
  6095. an error code.
  6096.  
  6097. If you just want the subdirectory of the current drive, you can
  6098. use a null string ("") as the drive letter.
  6099.  
  6100.    SubDir$ = GetSub2$(Drive$)
  6101.  
  6102. Drive$     letter of the drive to check
  6103. -------
  6104. SubDir$    name of the current subdirectory. Init to 65+ chars
  6105.  
  6106. Name  : GetSwitch            (Get Switch character)
  6107. Class : Miscellaneous
  6108. Level : DOS
  6109.  
  6110. An undocumented capability in many DOS versions allows you to
  6111. set the DOS "switch character", which is the delimiter used to
  6112. identify a switch on the DOS command line.  This is normally a
  6113. slash, as in "DIR /W".  However, many people prefer to change
  6114. it to a "-", which is the switch character used by Unix.
  6115.  
  6116. With the normal "/" delimiter, a backslash "\" is used in
  6117. subdirectory specifications.  DOS itself will recognize either
  6118. one as a subdirectory delimiter, but the command line won't
  6119. unless the switch char was changed.
  6120.  
  6121. The upshot of all this is, whereas you might normally use a
  6122. command like:
  6123.    DIR /W C:\GAMES
  6124.  
  6125. Someone with a different switch character might use something
  6126. like this:
  6127.    DIR -W C:/GAMES
  6128.  
  6129. This is exactly the sort of syntax that Unix commands use.
  6130.  
  6131. If you design your program to recognize the different
  6132. delimiters, you will make some people very happy!  The
  6133. GetSwitch routine will detect changed delimiters on those
  6134. versions of DOS which support it, and will return an ordinary
  6135. "/" on those versions of DOS which don't.
  6136.  
  6137.    Switch$ = "x"
  6138.    GetSwitch Switch$
  6139.  
  6140. -------
  6141. Switch$    the DOS switch character.  Init to one character.
  6142.  
  6143. Name  : GetSwitch2$          (Get Switch character)
  6144. Class : Miscellaneous
  6145. Level : DOS
  6146.  
  6147. This does exactly the same thing as the GetSwitch routine, but
  6148. it is a FUNCTION rather than a SUB.  For more information, see
  6149. GetSwitch.
  6150.  
  6151.    Switch$ = GetSwitch2$
  6152.  
  6153. -------
  6154. Switch$    the DOS switch character
  6155.  
  6156. Name  : GetTick&             (Get Tick)
  6157. Class : Time
  6158. Level : Clone
  6159.  
  6160. This function returns the system time.  This value represents
  6161. the time after midnight. There are about 18.2 ticks per second,
  6162. providing sufficiently fine resolution for most purposes.
  6163.  
  6164. If you use this function as part of a delay loop, keep in mind
  6165. that the value will wrap around at midnight, and that any given
  6166. value may be "skipped" due to causes beyond your control--
  6167. multitasking or background operations such as communications or
  6168. print spooling, for example.  So, DO NOT check for a specific
  6169. "end time"-- it may never come!  Instead, decrement a counter
  6170. whenever you notice that the time has changed since you last
  6171. checked.  This disassociates the delay from a specific time,
  6172. preventing lockups.
  6173.  
  6174.    Tick& = GetTick&
  6175.  
  6176. -------
  6177. Tick&        time after midnight (1/18.2 seconds)
  6178.  
  6179. Name  : GetTime              (Get Time)
  6180. Class : Time
  6181. Level : DOS
  6182.  
  6183. This routine tells you the time according to DOS.
  6184.  
  6185. The main difference between getting the time from BASIC and
  6186. getting it from DOS is the "hundredths of seconds" value.
  6187. However, this value is not available on some machines, in which
  6188. case it will be set to zero.  It is not accurate on most
  6189. machines, being calculated instead using a semi-random
  6190. approach; it is more of a novelty than a useful value.
  6191.  
  6192.    GetTime HourNr%, MinuteNr%, SecondNr%, Hundredth%
  6193.  
  6194. -------
  6195. HourNr%      hour (0-23)
  6196. MinuteNr%    minute
  6197. SecondNr%    second
  6198. Hundredth%   hundredth of a second.  See remarks, above.
  6199.  
  6200. Name  : GetTimeA             (Get Time of file in Archive)
  6201. Class : Disk / Time
  6202. Level : DOS
  6203.  
  6204. GetTimeA returns the time of an archived file matched by the
  6205. FindFirstA or FindNextA routines.
  6206.  
  6207. Routines in this series include:
  6208.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  6209.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  6210.  
  6211.    GetTimeA HourNr%, MinuteNr%, SecondNr%
  6212.  
  6213. -------
  6214. HourNr%     hour
  6215. MinuteNr%   minute
  6216. SecondNr%   second
  6217.  
  6218. Name  : GetTimeAT            (Get Time from AT clock)
  6219. Class : Time
  6220. Level : BIOS (AT)
  6221.  
  6222. This routine gets the time from the hardware real-time clock in
  6223. AT-class computers.  Depending on the DOS version, this time
  6224. may be partially or completely independent of the time kept by
  6225. DOS in software.  DOS always reads the time from the hardware
  6226. clock when it starts up.  However, use of the TIME command in
  6227. DOS (and the TIME$ function in QuickBASIC) may relate only to
  6228. the software copy of the time, which is not always guaranteed
  6229. to be the same as the time in the hardware clock due to certain
  6230. discrepancies in DOS.
  6231.  
  6232.    GetTimeAT HourNr%, MinuteNr%, SecondNr%, ErrCode%
  6233.  
  6234. -------
  6235. HourNr%      hour (0-23)
  6236. MinuteNr%    minute
  6237. SecondNr%    second
  6238. ErrCode%     error code: 0 if no error, else clock has stopped
  6239.  
  6240. Name  : GetTimeF             (Get Time of File)
  6241. Class : Disk / Time
  6242. Level : DOS
  6243.  
  6244. The GetTimeF routine returns the time of a file matched by
  6245. FindFirstF or FindNextF.
  6246.  
  6247. Routines in this series include:
  6248.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  6249.    GetTimeF, GetSizeFL
  6250.  
  6251.    GetTimeF HourNr%, MinuteNr%, SecondNr%
  6252.  
  6253. -------
  6254. HourNr%     hour
  6255. MinuteNr%   minute
  6256. SecondNr%   second
  6257.  
  6258. Name  : GetTimeFx$           (Get Time of File, Extended)
  6259. Class : Disk / Time
  6260. Level : DOS
  6261.  
  6262. The GetTimeFx$ function returns the time of a file matched by
  6263. FindFirstFx or FindNextFx.
  6264.  
  6265. Routines in this series include:
  6266.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  6267.    GetTimeFx$, GetSizeFx&
  6268.  
  6269.    FileTime$ = GetTimeFx$(Buffer$)
  6270.  
  6271. Buffer$      buffer used in search
  6272. -------
  6273. FileTime$    file time (e.g., "17:53:20")
  6274.  
  6275. Name  : GetTView             (Get TopView)
  6276. Class : Miscellaneous
  6277. Level : BIOS
  6278.  
  6279. This routine tells you whether TopView or a compatible
  6280. multitasker (such as TaskView or DESQview) is loaded.
  6281.  
  6282. See also GetDView, GetTVScreen, UpdTVScreen.
  6283.  
  6284.    GetTView Installed%
  6285.  
  6286. -------
  6287. Installed%   whether a TopView-type multitasker is loaded
  6288.  
  6289. Name  : GetTVScreen          (Get TopView Screen address)
  6290. Class : Display / Miscellaneous
  6291. Level : BIOS
  6292.  
  6293. GetTVScreen returns the address of the screen buffer used by a
  6294. TopView-type multitasker.  This allows you to use direct screen
  6295. access while remaining within the windows allocated to your
  6296. program by the multitasker.
  6297.  
  6298. You must tell the multitasker the address of the screen you
  6299. would be writing to if the multitasker was not installed.
  6300. Specify a segment of &HB000 if using an MDA or Hercules, or a
  6301. segment of &HB800 for CGA, EGA, MCGA or VGA. The offset should
  6302. always be 0.  This is for use in text modes.
  6303.  
  6304. The routine will return with the new segment and offset for you
  6305. to use. These values can be used with any PBClone screen
  6306. routine that accepts a segment and offset-- DQPrint and
  6307. DXQPrint, for example.
  6308.  
  6309. Note that not all TopView-compatible multitaskers will
  6310. automatically update the screen from the buffer.  The
  6311. UpdTVScreen routine allows you to force a screen update.
  6312.  
  6313. See also GetDView, GetTView, UpdTVScreen.
  6314.  
  6315.    GetTVScreen DSeg%, DOfs%
  6316.  
  6317. DSeg%       segment of desired screen
  6318. DOfs%       offset of desired screen
  6319. -------
  6320. DSeg%       segment of screen buffer
  6321. DOfs%       offset of screen buffer
  6322.  
  6323. Name  : GetValidKey          (Get Valid Key)
  6324. Class : Input
  6325. Level : DOS
  6326.  
  6327. This one is useful for getting one of a list of keys from the
  6328. keyboard.  You give it a list of keys (letters should be
  6329. uppercase) to accept.  It will wait until one of the listed
  6330. keys is pressed; for letters, it will accept either lowercase
  6331. or uppercase keys, but will convert the letter to uppercase
  6332. before it returns to you.  If you pass it a blank list, it will
  6333. accept any key.
  6334.  
  6335. This routine is handy for when you want to allow one of a list
  6336. of choices from a menu, for instance.
  6337.  
  6338.    GetValidKey GoodList$, Result$
  6339.  
  6340. GoodList$    list of acceptable keys.  See above for remarks.
  6341. -------
  6342. Result$      the key that was accepted (uppercase if letter)
  6343.  
  6344. Name  : GetVerify            (Get Verify setting)
  6345. Class : Disk
  6346. Level : DOS
  6347.  
  6348. The GetVerify routine tells you the state of the DOS VERIFY
  6349. flag.  When VERIFY is on, some checking is done to make sure
  6350. that writing to the disk works as requested.  The checks are
  6351. not very good, however, and VERIFY slows down disk handling, so
  6352. it is usually better to have VERIFY off.
  6353.  
  6354. You can change the state of VERIFY by using the DOS VERIFY
  6355. command or with the SetVerify routine in PBClone.
  6356.  
  6357.    GetVerify VerifyOn%
  6358.  
  6359. -------
  6360. VerifyOn%   whether VERIFY is on (0 if no)
  6361.  
  6362. Name  : GetVGA               (Get VGA information)
  6363. Class : Display / Equipment
  6364. Level : BIOS
  6365.  
  6366. This routine tells you whether a VGA is available.
  6367.  
  6368. See also GetCRT, GetEGA and GetHGA.
  6369.  
  6370.    GetVGA IsVGA%
  6371.  
  6372. -------
  6373. IsVGA%    whether a VGA is installed (0 if no)
  6374.  
  6375. Name  : GetVGA2%             (Get VGA information)
  6376. Class : Display / Equipment
  6377. Level : BIOS
  6378.  
  6379. This routine tells you whether a VGA is available.
  6380.  
  6381. See also GetCRT, GetEGA and GetHGA.
  6382.  
  6383.    IsVGA% = GetVGA2%
  6384.  
  6385. -------
  6386. IsVGA%    whether a VGA is installed (0 if no)
  6387.  
  6388. Name  : GetVGAColor          (Get VGA Color)
  6389. Class : Display
  6390. Level : BIOS
  6391.  
  6392. This routine gets the components of a single VGA palette color.
  6393. It returns the color value associated with a given color number.
  6394.  
  6395. If you are dealing with more than one color at a time, you may
  6396. find GetVGAPalette more appropriate.
  6397.  
  6398.    GetVGAColor ColorNr%, Red%, Green%, Blue%
  6399.  
  6400. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  6401. -------
  6402. Red%       red intensity (0-63)
  6403. Green%     green intensity (0-63)
  6404. Blue%      blue intensity (0-63)
  6405.  
  6406. Name  : GetVGAPalette        (Get VGA Palette)
  6407. Class : Display
  6408. Level : BIOS
  6409.  
  6410. This routine allows you to get any number of the VGA palette
  6411. settings into a TYPEd array.  The TYPE for the array should be
  6412. defined like this:
  6413.  
  6414.    TYPE Palet
  6415.       IRed AS STRING * 1
  6416.       IBlue AS STRING * 1
  6417.       IGreen AS STRING * 1
  6418.    END TYPE
  6419.  
  6420. This type holds a CHR$-encoded representation of the intensity
  6421. of each component of the color.  The values range from 0-63.
  6422.  
  6423. If you are only dealing with a few colors, you may find it more
  6424. convenient to use GetVGAColor instead.
  6425.  
  6426.    GetVGAPalette DSeg%, DOfs%, Start%, Colors%
  6427.  
  6428. DSeg%      segment of the palette array
  6429. DOfs%      offset of the palette array
  6430. Start%     color number to start with
  6431. Colors%    number of colors to get
  6432.  
  6433. Name  : GetVidMode           (Get Video Mode)
  6434. Class : Display
  6435. Level : BIOS
  6436.  
  6437. The GetVidMode routine tells you about the current display
  6438. status from the BIOS' point of view.  Note that the BIOS
  6439. display mode is not the same as the BASIC SCREEN mode (a direct
  6440. translation between the two is messy, because BASIC
  6441. conglomerates several BIOS modes into a single SCREEN mode in
  6442. several instances).
  6443.  
  6444.    GetVidMode BIOSMode%, ScreenWidth%, ActivePage%
  6445.  
  6446. -------
  6447. BIOSMode%     BIOS video mode
  6448. ScreenWidth%  number of columns per row
  6449. ActivePage%   active (visible) display page
  6450.  
  6451. Name  : GetXMSm              (Get XMS Memory)
  6452. Class : Memory / Equipment
  6453. Level : DOS
  6454.  
  6455. This routine tells you how much XMS memory is available.  If
  6456. there is none, or if the XMS driver hasn't been installed, it
  6457. returns zeroes.  Memory is returned kilobytes.
  6458.  
  6459.    GetXMSm LargestFree&, TotalFree&
  6460.  
  6461. -------
  6462. LargestFree&  largest free block of XMS memory
  6463. TotalFree&    total free XMS memory
  6464.  
  6465. Name  : GetXMSv              (Get XMS Version)
  6466. Class : Memory / Equipment
  6467. Level : BIOS
  6468.  
  6469. The GetXMSv routine tells you the version of XMS driver that is
  6470. being used. The version number is separated into major and
  6471. minor parts.  For example, an XMS 2.0 driver would return a
  6472. major number of 2 and minor number of 0.
  6473.  
  6474.    GetXMSv MajorVer%, MinorVer%
  6475.  
  6476. -------
  6477. MajorVer%  major part of the XMS version number
  6478. MinorVer%  minor part of the XMS version number
  6479.  
  6480. Name  : GLoad                (Graphics Load)
  6481. Class : Disk
  6482. Level : DOS
  6483.  
  6484. A replacement for the BASIC BLOAD statement, this routine loads
  6485. a binary memory image from a file into the area of memory it
  6486. formerly occupied.  This is most often used to restore a screen
  6487. display from a file, although PBClone offers more flexible
  6488. alternatives.
  6489.  
  6490.    GLoad FileName$
  6491.  
  6492. FileName$    name of the file to load into memory
  6493.  
  6494. Name  : GQPrint              (Graphics Quick Print)
  6495. Class : Display
  6496. Level : Clone
  6497.  
  6498. This is a simple high-speed replacement for the PRINT statement
  6499. which works in CGA graphics mode (SCREEN 2).  It does not
  6500. interpret control codes, support graphics characters (ASCII
  6501. 128-255), or update the cursor position, in return for which it
  6502. is much faster than PRINT.
  6503.  
  6504. The Fast% parameter is ignored at the moment-- top speed is
  6505. always used, which may cause flickering on some CGAs.
  6506.  
  6507.    GQPrint St$, Row%, Column%, Fast%
  6508.  
  6509. St$      string to display
  6510. Row%     row (1-25)
  6511. Column%  column (1-80)
  6512. Fast%    not used
  6513.  
  6514. Name  : GrafPrint            (Graphics Print)
  6515. Class : Display
  6516. Level : Clone
  6517.  
  6518. This is a flexible replacement for the PRINT statement which
  6519. operates in graphics mode.  It allows you to display text at
  6520. graphics coordinates instead of text coordinates for better
  6521. alignment with graphs and so forth.  It also lets you specify
  6522. the size of the font-- you can stretch it in either vertical or
  6523. horizontal directions, or both, using a font multiplier value.
  6524.  
  6525. The disadvantages of this routine are that it is slower than an
  6526. ordinary PRINT, only does foreground printing (if you need a
  6527. background color, you need to fill that in yourself
  6528. beforehand), won't do automatic wrap or scroll, and won't
  6529. handle control codes or graphics characters (ASCII 0-31,
  6530. 127-255). The font is based on the normal CGA graphics font,
  6531. which uses an 8x8 grid for each character.
  6532.  
  6533. GrafPrint will work in any graphics mode.
  6534.  
  6535.    GrafPrint St$, X%, Y%, High%, Wide%, Colour%
  6536.  
  6537. St$       string to display
  6538. X%        graphics column to start at
  6539. Y%        graphics row to start at
  6540. High%     font height multiplier
  6541. Wide%     font width multiplier
  6542. Colour%   foreground color for string
  6543.  
  6544. Name  : GrafRest             (Graphics Restore)
  6545. Class : Display
  6546. Level : Clone
  6547.  
  6548. This routine allows you to restore a SCREEN 1 (CGA, 320x200, 4
  6549. color) or SCREEN 2 (CGA, 640x200, 2 color) display that was
  6550. saved using GrafSave (see).
  6551.  
  6552.    GrafRest DSeg%, DOfs%
  6553.  
  6554. DSeg%      segment of storage array, returned by VARSEG
  6555. DOfs%      offset  of storage array, returned by VARPTR
  6556.  
  6557. Name  : GrafSave             (Graphics Save)
  6558. Class : Display
  6559. Level : Clone
  6560.  
  6561. This routine allows you to save a SCREEN 1 (CGA, 320x200, 4
  6562. color) or SCREEN 2 (CGA, 640x200, 2 color) display that can be
  6563. restored using GrafRest (see).
  6564.  
  6565. The array used to hold the screen must contain 16,000 bytes.
  6566. For an integer array, this means that you must create the array
  6567. by DIM Array%(1 TO 8000).
  6568.  
  6569.    GrafSave DSeg%, DOfs%
  6570.  
  6571. DSeg%      segment of storage array, returned by VARSEG
  6572. DOfs%      offset  of storage array, returned by VARPTR
  6573.  
  6574. Name  : GXQPrint             (Graphics Extended Quick Print)
  6575. Class : Display
  6576. Level : Clone
  6577.  
  6578. This is a simple high-speed replacement for the PRINT statement
  6579. which works in CGA graphics mode (SCREEN 1).  It does not
  6580. interpret control codes, support graphics characters (ASCII
  6581. 128-255), or update the cursor position, in return for which it
  6582. is much faster than PRINT.
  6583.  
  6584. This routine can also be used in SCREEN 2, where it will
  6585. display the string in shades instead of in color (using 40
  6586. columns/row).
  6587.  
  6588. The Fast% parameter is ignored at the moment-- top speed is
  6589. always used, which may cause flickering on some CGAs.
  6590.  
  6591. The results of this routine are not redirectable by DOS.
  6592.  
  6593.    GXQPrint St$, Row%, Column%, Fore%, Fast%
  6594.  
  6595. St$      string to display
  6596. Row%     row (1-25)
  6597. Column%  column (1-40)
  6598. Fore%    foreground color (0-3)
  6599. Fast%    not used
  6600.  
  6601. Name  : GXQPrint1            (Graphics Extended Quick Print)
  6602. Class : Display
  6603. Level : Clone
  6604.  
  6605. This is a high-speed replacement for the PRINT statement which
  6606. works in CGA graphics mode (SCREEN 1).  It does not interpret
  6607. control codes or update the cursor position, in return for
  6608. which it is much faster than PRINT.
  6609.  
  6610. This routine can also be used in SCREEN 2, where it will
  6611. display the string in shades instead of in color (using 40
  6612. columns/row).
  6613.  
  6614. The Fast% parameter is ignored at the moment-- top speed is
  6615. always used, which may cause flickering on some CGAs.
  6616.  
  6617. The results of this routine are not redirectable by DOS.
  6618.  
  6619.    GXQPrint1 St$, Row%, Column%, Fore%, Back%, Fast%
  6620.  
  6621. St$      string to display
  6622. Row%     row (1-25)
  6623. Column%  column (1-40)
  6624. Fore%    foreground color (0-3)
  6625. Back%    background color (0-3)
  6626. Fast%    not used
  6627.  
  6628. Name  : HandleInfo           (Handle Information)
  6629. Class : Miscellaneous
  6630. Level : DOS
  6631.  
  6632. HandleInfo tells you whether a file handle refers to a file or
  6633. to a device. If the handle does not exist, an error code will
  6634. be returned.
  6635.  
  6636. This is for file handles as returned by FOpen1 and FCreate. It
  6637. can also be used with file numbers associated with OPEN, via a
  6638. BASIC function that was introduced with QuickBASIC 4.0:
  6639.  
  6640.    Handle% = FILEATTR(FileNumber%, 2)
  6641.  
  6642. See FClose1 for a list of predefined handles.
  6643.  
  6644.    HandleInfo Handle%, Device%, ErrCode%
  6645.  
  6646. Handle%    file handle
  6647. -------
  6648. Device%    whether the handle refers to a device (0 no)
  6649. ErrCode%   whether there was an error (0 no)
  6650.  
  6651. Name  : HCls                 (Hercules CLS)
  6652. Class : Display
  6653. Level : Clone
  6654.  
  6655. This routine clears a Hercules graphics screen to the specified
  6656. color.
  6657.  
  6658. Routines in this series are:
  6659.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6660.  
  6661.    HCls Colour%
  6662.  
  6663. Colour%    color (0-1)
  6664.  
  6665. Name  : Heads%               (Heads)
  6666. Class : Disk
  6667. Level : DOS 3.3+
  6668.  
  6669. This function returns the number of heads for a given disk
  6670. drive.  If the drive does not exist or is not a physical drive,
  6671. -1 will be returned.
  6672.  
  6673. You may use "" to denote the current drive.
  6674.  
  6675.    Hds% = Heads% (Drive$)
  6676.  
  6677. Drive$    drive for which to return cylinders
  6678. -------
  6679. Heads%    number of drive heads (-1 if error)
  6680.  
  6681. Name  : HiByte%              (High Byte)
  6682. Class : Numeric
  6683. Level : Any
  6684.  
  6685. This function returns the high byte of an integer.
  6686.  
  6687.    Byte% = HiByte%(Nr%)
  6688.  
  6689. Nr%        integer
  6690. -------
  6691. Byte%      value of the most significant byte
  6692.  
  6693. Name  : HiLite               (Highlight)
  6694. Class : Display
  6695. Level : Clone
  6696.  
  6697. This routine allows you to highlight text on the screen.  It
  6698. works in text modes only and always displays to the visible
  6699. screen page.
  6700.  
  6701. See also ReColorArea, which lets you highlight any rectangular
  6702. area of the screen.
  6703.  
  6704.    HiLite Row%, LCol%, RCol%, VAttr%
  6705.  
  6706. Row%       row on which to highlight
  6707. LCol%      left column (where highlight starts)
  6708. RCol%      right column (where highlight ends)
  6709. VAttr%     new color (see CalcAttr)
  6710.  
  6711. Name  : HiWord%              (High Word)
  6712. Class : Numeric
  6713. Level : Any
  6714.  
  6715. This function returns the high word of a long integer.
  6716.  
  6717.    Word% = HiWord%(Nr&)
  6718.  
  6719. Nr&        long integer
  6720. -------
  6721. Word%      value of the most significant word
  6722.  
  6723. Name  : HLine                (Hercules LINE)
  6724. Class : Display
  6725. Level : Clone
  6726.  
  6727. This routine draws a line on a Hercules graphics screen.
  6728.  
  6729. Routines in this series are:
  6730.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6731.  
  6732.    HLine X1%, Y1%, X2%, Y2%, Colour%
  6733.  
  6734. X1%        starting graphics column (0-719)
  6735. Y1%        starting graphics row (0-347)
  6736. X2%        ending graphics column (0-719)
  6737. Y2%        ending graphics row (0-347)
  6738. Colour%    color (0-1)
  6739.  
  6740. Name  : HMode                (Hercules Mode)
  6741. Class : Display
  6742. Level : Clone
  6743.  
  6744. This routine switches between text mode and Hercules graphics
  6745. mode.  Use HInit first to initialize the graphics mode
  6746. appropriately.
  6747.  
  6748. HMode will clear page 0 when graphics mode is entered.  Page 1,
  6749. if it exists, is not cleared.  PBClone does not support page 1
  6750. in any respect.
  6751.  
  6752. Routines in this series are:
  6753.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6754.  
  6755.    HMode Graphics%
  6756.  
  6757. Graphics%    display mode to set (0 text, else graphics)
  6758.  
  6759. Name  : HPrint               (Hercules Print)
  6760. Class : Display
  6761. Level : Clone
  6762.  
  6763. This routine displays text in Hercules graphics mode.   It uses
  6764. the full resolution of the screen, so text is 90 columns by 43
  6765. rows.  This gives you more space than even the largest EGA text
  6766. mode, which is only 80x43.
  6767.  
  6768. Routines in this series are:
  6769.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6770.  
  6771.    HPrint St$, Row%, Column%
  6772.  
  6773. St$        text to display
  6774. Row%       row (1-43)
  6775. Column%    column (1-90)
  6776.  
  6777. Name  : HSetPixel            (Hercules Set Pixel)
  6778. Class : Display
  6779. Level : Clone
  6780.  
  6781. This routine draws a dot on a Hercules graphics screen.
  6782.  
  6783. Routines in this series are:
  6784.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6785.  
  6786.    HSetPixel X%, Y%, Colour%
  6787.  
  6788. X%         graphics column (0-719)
  6789. Y%         graphics row (0-347)
  6790. Colour%    color (0-1)
  6791.  
  6792. Name  : HTestPixel           (Hercules Test Pixel)
  6793. Class : Display
  6794. Level : Clone
  6795.  
  6796. This routine returns the color of a dot on a Hercules graphics
  6797. screen.
  6798.  
  6799. Routines in this series are:
  6800.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6801.  
  6802.    Colour% = HTestPixel%(X%, Y%)
  6803.  
  6804. X%         graphics column (0-719)
  6805. Y%         graphics row (0-347)
  6806. -------
  6807. Colour%    color (0-1)
  6808.  
  6809. Name  : IdentifyFile         (Identify File)
  6810. Class : Disk
  6811. Level : DOS
  6812.  
  6813. Given a file name, this routine attempts to identify what kind
  6814. of file it is. Most information is derived from the file
  6815. extension, but some files are processed more deeply.  For
  6816. instance, a file named "UNKNOWN.BAS" will be checked to see if
  6817. it is source code (tokenized GWBASIC format, tokenized
  6818. QuickBASIC format, or plain ASCII text) or a binary BSAVE/BLOAD
  6819. image (which is further categorized as to whether it is a
  6820. screen image, and if so, for what kind of display).
  6821.  
  6822.    Descript$ = SPACE$(80)
  6823.    IdentifyFile FileName$, Descript$, DescrLen%
  6824.    Descript$ = LEFT$(Descript$, DescrLen%)
  6825.  
  6826. FileName$    name of the file to identify
  6827. -------
  6828. Descript$    description of the file (init to at least 80 chars)
  6829. DescrLen%    length of the description
  6830.  
  6831. Name  : InitPtr              (Initialize Pointers)
  6832. Class : Array management
  6833. Level : Any
  6834.  
  6835. This routine initializes an array of pointers for use with the
  6836. pointer sort routines (PSortD, et al).  It may also be useful
  6837. for other purposes.  Each element of the array is set equal to
  6838. its index (the first element is set to 1, the second to 2, and
  6839. so forth).  Arrays are expected to begin at element 1.  You may
  6840. specify the last element to initialize, allowing you to use
  6841. only part of an array.
  6842.  
  6843.    InitPtr Ptr%(), Elements%
  6844.  
  6845. Ptr%()      array to initialize
  6846. Elements%   number of elements to initialize
  6847. -------
  6848. Ptr%()      initialized array
  6849.  
  6850. Name  : InsChr               (Insert Character)
  6851. Class : Display
  6852. Level : Clone
  6853.  
  6854. The InsChr routine inserts a space at the specified screen
  6855. location.
  6856.  
  6857.    InsChr Row%, Column%
  6858.  
  6859. Row%      row of character
  6860. Column%   column of character
  6861.  
  6862. Name  : InsLine              (Insert Line)
  6863. Class : Display
  6864. Level : BIOS
  6865.  
  6866. This routine inserts a blank line at the specified row of the
  6867. screen.
  6868.  
  6869.    InsLine Row%, VAttr%
  6870.  
  6871. Row%      row to insert
  6872. VAttr%    color/attribute to use on new row (see CalcAttr)
  6873.  
  6874. Name  : Int2Date             (Integer to Date)
  6875. Class : Time
  6876. Level : Any
  6877.  
  6878. This routine undoes the results of the Date2Int routine.  It
  6879. expands a single integer into month, day, and year values.
  6880.  
  6881. The storage format is identical to that used by DOS for file
  6882. dates, by the way, so this routine makes an apt companion for
  6883. LoadDirAll.
  6884.  
  6885.  
  6886. See also Int2DateSt$, a version of this routine which returns a
  6887. string instead of numbers.
  6888.  
  6889.  
  6890.    Int2Date MonthNr%, DayNr%, YearNr%, IntDate%
  6891.  
  6892. IntDate%     date compressed into an integer
  6893. -------
  6894. MonthNr%     month number (1-12)
  6895. DayNr%       day (1-31)
  6896. YearNr%      year (1980-2079; see above for two-digit years)
  6897.  
  6898. Name  : Int2DateSt$          (Integer to Date String)
  6899. Class : Time
  6900. Level : Any
  6901.  
  6902. This routine undoes the results of the Date2Int routine.  It
  6903. expands a single integer into a date string with the format
  6904. MM-DD-YYYY.
  6905.  
  6906. The storage format is identical to that used by DOS for file
  6907. dates, by the way, so this routine makes an apt companion for
  6908. LoadDirAll.
  6909.  
  6910. See also Int2Date, a version of this routine which returns
  6911. month, day, and year numbers instead of a string.
  6912.  
  6913.  
  6914.    DateSt$ = Int2DateSt$(IntDate%)
  6915.  
  6916. IntDate%     date compressed into an integer
  6917. -------
  6918. DateSt$      uncompressed date in MM-DD-YYYY format.
  6919.  
  6920. Name  : Int2Time             (Integer to Time)
  6921. Class : Time
  6922. Level : Any
  6923.  
  6924. This routine undoes the results of the Time2Int routine.  It
  6925. expands a single integer into hour, minute, and second values.
  6926.  
  6927. Note that the seconds will always be even, due to the storage
  6928. format.  The storage format is identical to that used by DOS
  6929. for file times, by the way, so this routine makes an apt
  6930. companion for LoadDirAll.
  6931.  
  6932. See also Int2TimeSt$, a version of this routine which returns a
  6933. string instead of numbers.
  6934.  
  6935.    Int2Time HourNr%, MinuteNr%, SecondNr%, IntTime%
  6936.  
  6937. IntTime%     time compressed into an integer
  6938. -------
  6939. HourNr%      hour (0-23)
  6940. MinuteNr%    minute
  6941. SecondNr%    second
  6942.  
  6943. Name  : Int2TimeSt$          (Integer to Time String)
  6944. Class : Time
  6945. Level : Any
  6946.  
  6947. This routine undoes the results of the Time2Int routine.  It
  6948. expands a single integer into hour, minute, and second values.
  6949.  
  6950. Note that the seconds will always be even, due to the storage
  6951. format.  The storage format is identical to that used by DOS
  6952. for file times, by the way, so this routine makes an apt
  6953. companion for LoadDirAll.
  6954.  
  6955. See also Int2Time, a version of this routine which returns
  6956. hour, minute, and second numbers instead of a string.
  6957.  
  6958.    TimeSt$ = Int2TimeSt$(IntTime%)
  6959.  
  6960. IntTime%     time compressed into an integer
  6961. -------
  6962. TimeSt$      uncompressed time in HH:MM:SS format
  6963.  
  6964. Name  : IntVector            (Interrupt Vector)
  6965. Class : Miscellaneous
  6966. Level : DOS
  6967.  
  6968. The IntVector routine retrieves the address of a specified
  6969. interrupt handler. If there is no interrupt handler, the
  6970. results will normally be zero, although early DOS versions did
  6971. not always have the sense to initialize unused vectors that way.
  6972.  
  6973.    IntVector DSeg%, DOfs%, Interrupt%
  6974.  
  6975. Interrupt%   interrupt number to examine
  6976. -------
  6977. DSeg%        segment of the interrupt handler
  6978. DOfs%        offset of the interrupt handler
  6979.  
  6980. Name  : IRead                (Integer Read)
  6981. Class : Disk
  6982. Level : DOS
  6983.  
  6984. This routine reads an integer (two binary bytes) from a file.
  6985. For some applications, you might prefer LIRead, which reads an
  6986. integer from a file into a zero-extended long integer-- which
  6987. essentially provides support for unsigned integers (0-65535).
  6988.  
  6989. The file must have been opened using FCreate or FOpen1.
  6990.  
  6991.    IRead Handle%, Value%, ErrCode%
  6992.  
  6993. Handle%    file handle
  6994. -------
  6995. Value%     integer read from file
  6996. ErrCode%   DOS error code (0 if no error)
  6997.  
  6998. Name  : IsAlNum%             (Is Alphanumeric?)
  6999. Class : String
  7000. Level : Any
  7001.  
  7002. This function returns whether a character is alphabetic or
  7003. numeric.
  7004.  
  7005. Functions in this family include:
  7006.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7007.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7008.  
  7009.    IsIt% = IsAlNum%(Ch$)
  7010.  
  7011. Ch$       character to check
  7012. -------
  7013. IsIt%     -1 if the character is alphabetic or numeric
  7014.  
  7015. Name  : IsAlpha%             (Is Alphabetic?)
  7016. Class : String
  7017. Level : Any
  7018.  
  7019. This function returns whether a character is alphabetic.
  7020.  
  7021. Functions in this family include:
  7022.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7023.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7024.  
  7025.    IsIt% = IsAlpha%(Ch$)
  7026.  
  7027. Ch$       character to check
  7028. -------
  7029. IsIt%     -1 if the character is alphabetic
  7030.  
  7031. Name  : IsASCII%             (Is ASCII?)
  7032. Class : String
  7033. Level : Any
  7034.  
  7035. This function returns whether a character is ASCII.  This is
  7036. true if the character ranges from CHR$(0)-CHR$(127).
  7037.  
  7038. Functions in this family include:
  7039.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7040.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7041.  
  7042.    IsIt% = IsASCII%(Ch$)
  7043.  
  7044. Ch$       character to check
  7045. -------
  7046. IsIt%     -1 if the character is ASCII
  7047.  
  7048. Name  : IsCntrl%             (Is Control?)
  7049. Class : String
  7050. Level : Any
  7051.  
  7052. This function returns whether a character is a control code.
  7053. This is true for CHR$(0)-CHR$(32) and CHR$(127).
  7054.  
  7055. Functions in this family include:
  7056.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7057.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7058.  
  7059.    IsIt% = IsCntrl%(Ch$)
  7060.  
  7061. Ch$       character to check
  7062. -------
  7063. IsIt%     -1 if the character is a control code
  7064.  
  7065. Name  : IsDigit%             (Is Digit?)
  7066. Class : String
  7067. Level : Any
  7068.  
  7069. This function returns whether a character is numeric.
  7070.  
  7071. Functions in this family include:
  7072.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7073.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7074.  
  7075.    IsIt% = IsDigit%(Ch$)
  7076.  
  7077. Ch$       character to check
  7078. -------
  7079. IsIt%     -1 if the character is a digit
  7080.  
  7081. Name  : IsLower%             (Is Lowercase?)
  7082. Class : String
  7083. Level : Any
  7084.  
  7085. This function returns whether a character is a lowercase
  7086. letter.
  7087.  
  7088. Functions in this family include:
  7089.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7090.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7091.  
  7092.    IsIt% = IsLower%(Ch$)
  7093.  
  7094. Ch$       character to check
  7095. -------
  7096. IsIt%     -1 if the character is a lowercase letter
  7097.  
  7098. Name  : IsPrint%             (Is Printable?)
  7099. Class : String
  7100. Level : Any
  7101.  
  7102. This function returns whether a character is printable.  This
  7103. is true for CHR$(32)-CHR$(126).
  7104.  
  7105. Functions in this family include:
  7106.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7107.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7108.  
  7109.    IsIt% = IsPrint%(Ch$)
  7110.  
  7111. Ch$       character to check
  7112. -------
  7113. IsIt%     -1 if the character is printable
  7114.  
  7115. Name  : IsPunct%             (Is Punctuation?)
  7116. Class : String
  7117. Level : Any
  7118.  
  7119. This function returns whether a character is punctuation.  This
  7120. is true for any ASCII character that is not alphabetic,
  7121. numeric, or a control code; and for a space.
  7122.  
  7123. Functions in this family include:
  7124.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7125.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7126.  
  7127.    IsIt% = IsPunct%(Ch$)
  7128.  
  7129. Ch$       character to check
  7130. -------
  7131. IsIt%     -1 if the character is punctuation
  7132.  
  7133. Name  : IsSpace%             (Is Space?)
  7134. Class : String
  7135. Level : Any
  7136.  
  7137. This function returns whether a character is white space.  This
  7138. includes Space, Carriage Return, Horizontal Tab, Vertical Tab,
  7139. LineFeed, and FormFeed characters.
  7140.  
  7141. Functions in this family include:
  7142.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7143.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7144.  
  7145.    IsIt% = IsSpace%(Ch$)
  7146.  
  7147. Ch$       character to check
  7148. -------
  7149. IsIt%     -1 if the character is white space
  7150.  
  7151. Name  : IStr$                (Integer STR$)
  7152. Class : String
  7153. Level : Any
  7154.  
  7155. This function is identical to the BASIC function STR$, but is
  7156. somewhat smaller.  It is only for integer values.
  7157.  
  7158. If you prefer not to have a leading blank for non-negative
  7159. numbers, use the IStrNB$ function instead.
  7160.  
  7161.    St$ = IStr$(Number%)
  7162.  
  7163. Number%   integer to convert
  7164. -------
  7165. St$       string form of the number
  7166.  
  7167. Name  : IStrNB$              (Integer STR$, No Blank)
  7168. Class : String
  7169. Level : Any
  7170.  
  7171. This function is similar to the BASIC function STR$, but is
  7172. somewhat smaller.  It is only for integer values.  Unlike the
  7173. STR$ function, this function does not add a leading blank to
  7174. non-negative numbers.
  7175.  
  7176. If you prefer to have a leading blank for non-negative numbers,
  7177. use the IStr$ function instead.
  7178.  
  7179.    St$ = IStrNB$(Number%)
  7180.  
  7181. Number%   integer to convert
  7182. -------
  7183. St$       string form of the number
  7184.  
  7185. Name  : IsUpper%             (Is Uppercase?)
  7186. Class : String
  7187. Level : Any
  7188.  
  7189. This function returns whether a character is an uppercase
  7190. letter.
  7191.  
  7192. Functions in this family include:
  7193.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7194.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7195.  
  7196.    IsIt% = IsUpper%(Ch$)
  7197.  
  7198. Ch$       character to check
  7199. -------
  7200. IsIt%     -1 if the character is uppercase
  7201.  
  7202. Name  : IsXDigit%            (Is Hex Digit?)
  7203. Class : String
  7204. Level : Any
  7205.  
  7206. Functions in this family include:
  7207.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  7208.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  7209.  
  7210. This function returns whether a character is a hexadecimal
  7211. digit.
  7212.  
  7213.    IsIt% = IsXDigit%(Ch$)
  7214.  
  7215. Ch$       character to check
  7216. -------
  7217. IsIt%     -1 if the character is a hex digit
  7218.  
  7219. Name  : IVal%                (Integer VAL)
  7220. Class : Numeric
  7221. Level : Any
  7222.  
  7223. This routine is similar to the BASIC function VAL, but is much
  7224. faster.  If you are not using floating point numbers, this
  7225. routine may also decrease the size of your program
  7226. significantly, since it won't cause BASIC to pull in its
  7227. floating point routines as VAL does.
  7228.  
  7229. Unlike VAL, this routine only converts strings to integer
  7230. values.  It will not handle hex or octal strings.  It will not
  7231. notify you if there is an overflow error.  Finally, although
  7232. IVal% will ignore leading blanks, it assumes that a number may
  7233. not contain blanks, whereas VAL will ignore blanks in the
  7234. middle of a number:
  7235.  
  7236.      VAL("  12 34") returns 1234
  7237.    IVal%("  12 34") returns 12
  7238.  
  7239. Note that, like VAL (but unlike the IVal% function in ProBas),
  7240. multiple negation is considered illegal.  For example,
  7241. IVal%("--1") returns zero.
  7242.  
  7243.    Number% = IVal%(St$)
  7244.  
  7245. St$       string to convert
  7246. -------
  7247. Number%   integer form of string (0 if there isn't one)
  7248.  
  7249. Name  : IWrite               (Integer Write)
  7250. Class : Disk
  7251. Level : DOS
  7252.  
  7253. This routine writes an integer (two binary bytes) to a file.
  7254.  
  7255. The file must have been opened using FCreate or FOpen1.
  7256.  
  7257.    IWrite Handle%, Value%, ErrCode%
  7258.  
  7259. Handle%    file handle
  7260. Value%     integer to write to file
  7261. -------
  7262. ErrCode%   DOS error code (0 if no error)
  7263.  
  7264. Name  : JButtonA1%           (Joystick Button A1)
  7265. Class : Input
  7266. Level : BIOS
  7267.  
  7268. This function returns the status of joystick A button 1.  The
  7269. result will be -1 if the button is pressed, or 0 if not.
  7270.  
  7271. If you need information on more than one button, you will find
  7272. it substantially faster to use the JButtons routine, which
  7273. returns the status of all joystick buttons at once.
  7274.  
  7275. Note that this function will not work on the oldest PCs (those
  7276. made before 1983 or so).
  7277.  
  7278.    Status% = JButtonA1%
  7279.  
  7280. -------
  7281. Status%      whether joystick A button 1 is pressed (0 no)
  7282.  
  7283. Name  : JButtonA2%           (Joystick Button A2)
  7284. Class : Input
  7285. Level : BIOS
  7286.  
  7287. This function returns the status of joystick A button 2.  The
  7288. result will be -1 if the button is pressed, or 0 if not.
  7289.  
  7290. If you need information on more than one button, you will find
  7291. it substantially faster to use the JButtons routine, which
  7292. returns the status of all joystick buttons at once.
  7293.  
  7294. Note that this function will not work on the oldest PCs (those
  7295. made before 1983 or so).
  7296.  
  7297.    Status% = JButtonA2%
  7298.  
  7299. -------
  7300. Status%      whether joystick A button 2 is pressed (0 no)
  7301.  
  7302. Name  : JButtonB1%           (Joystick Button B1)
  7303. Class : Input
  7304. Level : BIOS
  7305.  
  7306. This function returns the status of joystick B button 1.  The
  7307. result will be -1 if the button is pressed, or 0 if not.
  7308.  
  7309. If you need information on more than one button, you will find
  7310. it substantially faster to use the JButtons routine, which
  7311. returns the status of all joystick buttons at once.
  7312.  
  7313. Note that this function will not work on the oldest PCs (those
  7314. made before 1983 or so).
  7315.  
  7316.    Status% = JButtonB1%
  7317.  
  7318. -------
  7319. Status%      whether joystick B button 1 is pressed (0 no)
  7320.  
  7321. Name  : JButtonB2%           (Joystick Button B2)
  7322. Class : Input
  7323. Level : BIOS
  7324.  
  7325. This function returns the status of joystick B button 2.  The
  7326. result will be -1 if the button is pressed, or 0 if not.
  7327.  
  7328. If you need information on more than one button, you will find
  7329. it substantially faster to use the JButtons routine, which
  7330. returns the status of all joystick buttons at once.
  7331.  
  7332. Note that this function will not work on the oldest PCs (those
  7333. made before 1983 or so).
  7334.  
  7335.    Status% = JButtonB2%
  7336.  
  7337. -------
  7338. Status%      whether joystick B button 2 is pressed (0 no)
  7339.  
  7340. Name  : JButtons             (Joystick Buttons)
  7341. Class : Input
  7342. Level : BIOS
  7343.  
  7344. This routine returns the status of all joystick buttons.  The
  7345. result will be -1 if the button is pressed, or 0 if not.
  7346.  
  7347. This routine is ideal if you need to check more than one
  7348. joystick button.  It is substantially faster than using several
  7349. single-button status functions.  However, if you only need to
  7350. check a single button, or speed is not an issue, you may find
  7351. it more convenient to use the functions:
  7352.    JButtonA1%, JButtonA2%, JButtonB1%, JButtonB2%
  7353.  
  7354. Note that this routine will not work on the oldest PCs (those
  7355. made before 1983 or so).
  7356.  
  7357.    JButtons A1%, A2%, B1%, B2%
  7358.  
  7359. -------
  7360. A1%        whether joystick A button 1 is pressed (0 no)
  7361. A2%        whether joystick A button 2 is pressed (0 no)
  7362. B1%        whether joystick B button 1 is pressed (0 no)
  7363. B2%        whether joystick B button 2 is pressed (0 no)
  7364.  
  7365. Name  : JPos                 (Joystick Positions)
  7366. Class : Input
  7367. Level : BIOS
  7368.  
  7369. This routine returns the X,Y positions of both joysticks.  If
  7370. there is only one joystick attached, the results for the second
  7371. joystick will usually be meaningless-- except in the case of
  7372. the FlightStick, which returns the "throttle" status via the Y
  7373. position of an imaginary joystick B.
  7374.  
  7375. Note that X represents the horizontal axis and Y the vertical.
  7376. I've seen considerable confusion on that topic... I use the
  7377. standard mathematical convention here.
  7378.  
  7379. The range of values returned depends on the individual joystick
  7380. and may drift somewhat.  You would be well advised to include a
  7381. joystick "calibration" routine in your program to customize
  7382. your settings to the particular joystick used.  I find a range
  7383. of about 5-140 on my FlightStick; your mileage may vary.
  7384.  
  7385. Note that this routine will not work on the oldest PCs (those
  7386. made before 1983 or so).
  7387.  
  7388.    JPos AX%, AY%, BX%, BY%
  7389.  
  7390. -------
  7391. AX%        X position of joystick A
  7392. AY%        Y position of joystick A
  7393. BX%        X position of joystick B
  7394. BY%        Y position of joystick B (or FlightStick throttle)
  7395.  
  7396. Name  : KbdType              (Keyboard Type)
  7397. Class : Input / Equipment
  7398. Level : Clone
  7399.  
  7400. This routine tells you if an enhanced (101-key) keyboard is
  7401. available.
  7402.  
  7403. If KbdType is not entirely sure that an enhanced keyboard is
  7404. available, it plays safe and assumes there isn't one.  This
  7405. avoids possible disaster on older PCs.
  7406.  
  7407.    KbdType Enhanced%
  7408.  
  7409. -------
  7410. Enhanced%    whether keyboard is of the enhanced type (0 no)
  7411.  
  7412. Name  : KbdType2%            (Keyboard Type)
  7413. Class : Input / Equipment
  7414. Level : Clone
  7415.  
  7416. This routine tells you if an enhanced (101-key) keyboard is
  7417. available.
  7418.  
  7419. If KbdType2% is not entirely sure that an enhanced keyboard is
  7420. available, it plays safe and assumes there isn't one.  This
  7421. avoids possible disaster on older PCs.
  7422.  
  7423.    Enhanced% = KbdType2%
  7424.  
  7425. -------
  7426. Enhanced%    whether keyboard is of the enhanced type (0 no)
  7427.  
  7428. Name  : KeyPress             (detect Key Press)
  7429. Class : Input
  7430. Level : DOS
  7431.  
  7432. This routine works like the Turbo/Power BASIC function INSTAT.
  7433. It tells you whether there is a key waiting to be processed.
  7434.  
  7435.    KeyPress KeyHit%
  7436.  
  7437. -------
  7438. KeyHit%   whether a key is waiting (0 if no)
  7439.  
  7440. Name  : KVal&                (Kilobyte VAL)
  7441. Class : Numeric
  7442. Level : Any
  7443.  
  7444. This routine is similar to the BASIC function VAL, but is much
  7445. faster.  The number returned is divided by 1024, which is
  7446. useful if you're dealing in terms of kilobytes.  If you are not
  7447. using floating point numbers, this routine may decrease the
  7448. size of your program significantly, since it won't cause BASIC
  7449. to pull in its floating point routines as VAL does.
  7450.  
  7451. Unlike VAL, this routine only converts strings to long integer
  7452. values.  It will not handle hex or octal strings.  It will not
  7453. notify you if there is an overflow error.  Finally, although
  7454. KVal& will ignore leading blanks, it assumes that a number may
  7455. not contain blanks, whereas VAL will ignore blanks in the
  7456. middle of a number.
  7457.  
  7458. Note that, like VAL (but unlike the KVal& function in ProBas),
  7459. multiple negation is considered illegal.  For example,
  7460. KVal&("--10000") returns zero.
  7461.  
  7462.    Number& = KVal&(St$)
  7463.  
  7464. St$       string to convert
  7465. -------
  7466. Number&   long integer form of string, divided by 1024
  7467.  
  7468. Name  : LClickLoc            (Left Click Location)
  7469. Class : Mouse
  7470. Level : BIOS
  7471.  
  7472. This routine returns the position of the mouse cursor at the
  7473. last click of the left mouse button.  It must be used after one
  7474. of the routines which check for mouse clicks, as they maintain
  7475. the click position.  These routines include GetKey, GetKey3,
  7476. MMClick, and MMClick3.
  7477.  
  7478. The values returned are in graphics coordinates (virtual
  7479. coordinates for SCREEN 0 through SCREEN 2, due to the nature of
  7480. the mouse driver).
  7481.  
  7482.    LClickLoc X%, Y%
  7483.  
  7484. -------
  7485. X%         horizontal coordinate at last left click
  7486. Y%         vertical coordinate at last left click
  7487.  
  7488. Name  : LClose               (L/I/M Close)
  7489. Class : Memory
  7490. Level : BIOS
  7491.  
  7492. This routine closes a block of expanded memory that was opened
  7493. for access by LOpen.  It is important to close the block when
  7494. you are finished with it, to return it to the free memory pool.
  7495.  
  7496. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7497.  
  7498.    LClose EMSHandle%
  7499.  
  7500. EMSHandle%    handle of the expanded memory block
  7501.  
  7502. Name  : LGet                 (L/I/M Get)
  7503. Class : Memory
  7504. Level : BIOS
  7505.  
  7506. This routine gets a block of data from expanded memory that was
  7507. opened for access by LOpen.  The amount of data is specified in
  7508. words; one word is the same as two bytes.  An integer takes up
  7509. a word, long integers and single precision numbers require two
  7510. words, and double precision numbers take four.
  7511.  
  7512. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7513.  
  7514.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  7515.  
  7516. EMSHandle%    handle of the expanded memory block
  7517. DSeg%         segment of place to store data
  7518. DOfs%         offset of place to store data
  7519. Words%        words to get from expanded memory
  7520.  
  7521. Name  : LIRead               (Long Integer Read)
  7522. Class : Disk
  7523. Level : DOS
  7524.  
  7525. This routine reads an integer from a file into a long integer.
  7526. The integer is zero-extended into the long, providing effective
  7527. support for unsigned integers (a range of 0-65535).
  7528.  
  7529. The file must have been opened using FCreate or FOpen1.
  7530.  
  7531.    LIRead Handle%, Value&, ErrCode%
  7532.  
  7533. Handle%    file handle
  7534. -------
  7535. Value&     integer read from file
  7536. ErrCode%   DOS error code (0 if no error)
  7537.  
  7538. Name  : LIWrite              (Long Integer Write)
  7539. Class : Disk
  7540. Level : DOS
  7541.  
  7542. This routine writes an integer to a file from a long integer.
  7543. This makes it easier to support unsigned integers (with a range
  7544. of 0-65535).
  7545.  
  7546. The file must have been opened using FCreate or FOpen1.
  7547.  
  7548.    LIWrite Handle%, Value&, ErrCode%
  7549.  
  7550. Handle%    file handle
  7551. Value&     integer to write to file
  7552. -------
  7553. ErrCode%   DOS error code (0 if no error)
  7554.  
  7555. Name  : LoadDir              (Load Directory)
  7556. Class : Disk
  7557. Level : DOS
  7558.  
  7559. Given a filespec with wildcards and a file attribute, this
  7560. routine loads a list of all matching files into an array.  The
  7561. array must be of fixed-length string type, with 12 characters
  7562. for each filename.  You can find out how large to DIM the array
  7563. by using the FileCount routine.
  7564.  
  7565. The attribute can be any of the usual file attributes:
  7566.    1   Read-Only
  7567.    2   Hidden
  7568.    4   System
  7569.   16   Directory
  7570.  
  7571. You can combine attributes by adding their values.  For
  7572. instance, to search for hidden directories, you'd use an
  7573. attribute of 18.  By default, DOS returns normal files as well
  7574. as files which have the specified attributes, so an attribute
  7575. of 18 would get you normal files, hidden files, directories,
  7576. and hidden directories.  However, LoadDir can be made to screen
  7577. out unwanted files-- just negate the attribute to force only
  7578. files of that attribute to be counted.  For example, an
  7579. attribute of -18 would return only hidden subdirectories.
  7580.  
  7581. NOTE:  we use FilAttr%, not FileAttr%, because BASIC has an
  7582. internal function named FILEATTR.
  7583.  
  7584.    LoadDir FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  7585.  
  7586. FileSpec$    search file specification (may contain wildcards)
  7587. FilAttr%     search file attribute
  7588. DSeg%        segment of array (use VARSEG)
  7589. DOfs%        offset of array (use VARPTR)
  7590. -------
  7591. ErrCode%     error code (0 if no error)
  7592.  
  7593. Name  : LoadDirAll           (Load Directory, All info)
  7594. Class : Disk
  7595. Level : DOS
  7596.  
  7597. Given a filespec with wildcards and a file attribute, this
  7598. routine loads a list of all matching files into an array.  All
  7599. available information about the file is included: name, size,
  7600. time, date, and attribute.  The array must be of the TYPE shown
  7601. below.  You can find out how large to DIM the array by using
  7602. the FileCount routine.
  7603.  
  7604.    TYPE DirType
  7605.       FilAttr AS STRING * 1
  7606.       FilTime AS INTEGER
  7607.       FilDate AS INTEGER
  7608.       FilSize AS LONG
  7609.       FilName AS STRING * 12
  7610.    END TYPE
  7611.  
  7612. You can change the names if you like, but don't alter the order
  7613. of the information.  You can decode the file attribute with the
  7614. ASC function, then process it with ExplainFAttr$.  The file
  7615. time and date can be decoded with the Int2Time and Int2Date or
  7616. Int2TimeSt$ and Int2DateSt$ routines.
  7617.  
  7618. The attribute can be any of the usual file attributes:
  7619.    1   Read-Only
  7620.    2   Hidden
  7621.    4   System
  7622.   16   Directory
  7623.  
  7624. You can combine attributes by adding their values.  For
  7625. instance, to search for hidden directories, you'd use an
  7626. attribute of 18.  By default, DOS returns normal files as well
  7627. as files which have the specified attributes, so an attribute
  7628. of 18 would get you normal files, hidden files, directories,
  7629. and hidden directories.  However, LoadDir can be made to screen
  7630. out unwanted files-- just negate the attribute to force only
  7631. files of that attribute to be counted.  For example, an
  7632. attribute of -18 would return only hidden subdirectories.
  7633.  
  7634. NOTE:  we use FilAttr%, not FileAttr%, because BASIC has an
  7635. internal function named FILEATTR.
  7636.  
  7637.    LoadDir FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  7638.  
  7639. FileSpec$    search file specification (may contain wildcards)
  7640. FilAttr%     search file attribute
  7641. DSeg%        segment of array (use VARSEG)
  7642. DOfs%        offset of array (use VARPTR)
  7643. -------
  7644. ErrCode%     error code (0 if no error)
  7645.  
  7646. Name  : LoByte%              (Low Byte)
  7647. Class : Numeric
  7648. Level : Any
  7649.  
  7650. This function returns the low byte of an integer.
  7651.  
  7652.    Byte% = LoByte%(Nr%)
  7653.  
  7654. Nr%        integer
  7655. -------
  7656. Byte%      value of the least significant byte
  7657.  
  7658. Name  : Locase               (Lowercase)
  7659. Class : String
  7660. Level : Any
  7661.  
  7662. This routine, like BASIC's LCASE$ function, converts a string
  7663. to lowercase. Since it doesn't have to create a new return
  7664. string (a fairly slow process), it's faster than the BASIC
  7665. equivalent.
  7666.  
  7667. See also Locase1.
  7668.  
  7669.    Locase St$
  7670.  
  7671. St$     string to be put into lowercase
  7672. -------
  7673. St$     lowercase string
  7674.  
  7675. Name  : Locase1              (Lowercase)
  7676. Class : String
  7677. Level : Any
  7678.  
  7679. This routine, like BASIC's LCASE$ function, converts a string
  7680. to lowercase. It converts letters in the extended character set
  7681. as well as the usual letters, making it well suited for text
  7682. which may not be in English.
  7683.  
  7684. Note that DOS 5.0 and later versions provide National Language
  7685. Support which includes conversion to uppercase (not lowercase,
  7686. unfortunately).  So, if you merely need the characters in a
  7687. known state, rather than lowercase, you would do better to use
  7688. the Upcase1 routine.  Locase1 assumes the U.S. character set,
  7689. which may well not be appropriate.
  7690.  
  7691. See also Locase.
  7692.  
  7693.    Locase1 St$
  7694.  
  7695. St$     string to be put into lowercase
  7696. -------
  7697. St$     lowercase string
  7698.  
  7699. Name  : LogicalDrives%       (Logical Drives)
  7700. Class : Disk / Equipment
  7701. Level : DOS
  7702.  
  7703. This function returns the number of logical drives available.
  7704.  
  7705. A logical drive corresponds roughly to a drive letter-- it may
  7706. point to zero or more actual devices.  For instance, on a
  7707. one-floppy system, both A: and B: point to the same drive.  On
  7708. a partitioned hard drive, both C: and D: may point to different
  7709. areas of the same drive.  Drive E: may point to a RAMdisk, or
  7710. maybe it doesn't point to anything at all.
  7711.  
  7712. As you can see, knowing the number of logical drives doesn't
  7713. tell you much about what's actually there.  However, it does
  7714. give you an upper limit on the number of drive letters
  7715. available, which is a good place to start.
  7716.  
  7717.    Drives% = LogicalDrives%
  7718.  
  7719. -------
  7720. Drives%    number of logical drives
  7721.  
  7722. Name  : LOpen                (L/I/M Open)
  7723. Class : Memory
  7724. Level : BIOS
  7725.  
  7726. This routine opens a block of expanded memory for access.  The
  7727. size of the block is specified in words; one word is the same
  7728. as two bytes.  An integer takes up a word, long integers and
  7729. single precision numbers require two words, and double
  7730. precision numbers take four.  This allows you to store up to
  7731. 64K in each EMS block that you open.
  7732.  
  7733. Note that LOpen expects an EMS driver to be available.  If you
  7734. are not certain on this point, use GetLIMM beforehand to make
  7735. sure.
  7736.  
  7737. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7738.  
  7739.    LOpen Words%, EMSHandle%, ErrCode%
  7740.  
  7741. Words%        size of expanded memory block to allocate
  7742. -------
  7743. EMSHandle%    handle of the expanded memory block
  7744. ErrCode%      error code (0 if no error)
  7745.  
  7746. Name  : LoWord%              (Low Word)
  7747. Class : Numeric
  7748. Level : Any
  7749.  
  7750. This function returns the low word of a long integer.
  7751.  
  7752.    Word% = LoWord%(Nr&)
  7753.  
  7754. Nr&        long integer
  7755. -------
  7756. Word%      value of the least significant word
  7757.  
  7758. Name  : LPut                 (L/I/M Put)
  7759. Class : Memory
  7760. Level : BIOS
  7761.  
  7762. This routine puts a block of data into expanded memory that was
  7763. opened for access by LOpen.  The amount of data is specified in
  7764. words; one word is the same as two bytes.  An integer takes up
  7765. a word, long integers and single precision numbers require two
  7766. words, and double precision numbers take four.
  7767.  
  7768. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7769.  
  7770.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  7771.  
  7772. EMSHandle%    handle of the expanded memory block
  7773. DSeg%         segment of place from which to get data
  7774. DOfs%         offset of place from which to get data
  7775. Words%        words to put into expanded memory
  7776.  
  7777. Name  : LRead                (Long Read)
  7778. Class : Disk
  7779. Level : DOS
  7780.  
  7781. This routine reads a long integer (four binary bytes) from a
  7782. file.
  7783.  
  7784. The file must have been opened using FCreate or FOpen1.
  7785.  
  7786.    LRead Handle%, Value&, ErrCode%
  7787.  
  7788. Handle%    file handle
  7789. -------
  7790. Value&     long integer read from file
  7791. ErrCode%   DOS error code (0 if no error)
  7792.  
  7793. Name  : LRotate              (Left Rotate string)
  7794. Class : String
  7795. Level : Any
  7796.  
  7797. Many years ago, I wrote one of the first terminal programs for
  7798. the PC.  It died a horrible death when Qmodem came out...
  7799. sigh.  This routine comes from that experience.  It rotates the
  7800. characters in a string left once (e.g., "ABCDE" becomes
  7801. "BCDEA").  I used this in my routine to dial a list of BBSes,
  7802. skipping to the next one if the current one was busy.
  7803.  
  7804. LRotate can also be handy for things like scrolling a long
  7805. message across the screen (you just PRINT LEFT$(Message$, 80);
  7806. then delay a bit, LRotate and do it again).
  7807.  
  7808. See also RRotate.
  7809.  
  7810.    LRotate St$
  7811.  
  7812. St$     string to be rotated left once
  7813. -------
  7814. St$     string after being rotated left once
  7815.  
  7816. Name  : LScroll              (Left Scroll)
  7817. Class : Display
  7818. Level : Clone
  7819.  
  7820. This routine scrolls any selected part of the display left.
  7821. You may scroll as many times as you like, or scroll "zero"
  7822. times to totally clear the selected part of the display.
  7823.  
  7824.    LScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  7825.  
  7826. TopRow%      top row of the area to scroll
  7827. LeftCol%     left column of the area to scroll
  7828. BottomRow%   top row of the area to scroll
  7829. RightCol%    left column of the area to scroll
  7830. Times%       number of times (or rows) to scroll
  7831.  
  7832. Name  : LVal&                (Long integer VAL)
  7833. Class : Numeric
  7834. Level : Any
  7835.  
  7836. This routine is similar to the BASIC function VAL, but is much
  7837. faster.  If you are not using floating point numbers, this
  7838. routine may also decrease the size of your program
  7839. significantly, since it won't cause BASIC to pull in its
  7840. floating point routines as VAL does.
  7841.  
  7842. Unlike VAL, this routine only converts strings to long integer
  7843. values.  It will not handle hex or octal strings.  It will not
  7844. notify you if there is an overflow error.  Finally, although
  7845. LVal& will ignore leading blanks, it assumes that a number may
  7846. not contain blanks, whereas VAL will ignore blanks in the
  7847. middle of a number:
  7848.  
  7849.      VAL("  12 34") returns 1234
  7850.    LVal&("  12 34") returns 12
  7851.  
  7852. Note that, like VAL (but unlike the LVal& function in ProBas),
  7853. multiple negation is considered illegal.  For example,
  7854. LVal&("--1") returns zero.
  7855.  
  7856.    Number& = LVal&(St$)
  7857.  
  7858. St$       string to convert
  7859. -------
  7860. Number&   long integer form of string (0 if there isn't one)
  7861.  
  7862. Name  : LWrite               (Long Write)
  7863. Class : Disk
  7864. Level : DOS
  7865.  
  7866. This routine writes a long integer to a file.
  7867.  
  7868. The file must have been opened using FCreate or FOpen1.
  7869.  
  7870.    LWrite Handle%, Value&, ErrCode%
  7871.  
  7872. Handle%    file handle
  7873. Value&     long integer to write to file
  7874. -------
  7875. ErrCode%   DOS error code (0 if no error)
  7876.  
  7877. Name  : MakeSub              (Make Subdirectory)
  7878. Class : Disk
  7879. Level : DOS
  7880.  
  7881. Like the DOS MD (or MKDIR) command, this routine creates a new
  7882. subdirectory.
  7883.  
  7884.    MakeSub SubDir$, ErrCode%
  7885.  
  7886. SubDir$    name of new subdirectory
  7887. -------
  7888. ErrCode%   error code: 0 if none, else DOS Error
  7889.  
  7890. Name  : MatchFile            (Match File)
  7891. Class : Disk / String
  7892. Level : Any
  7893.  
  7894. The MatchFile routine tells you whether a given filename
  7895. matches a file specification which may contain wildcards.  The
  7896. filename itself should not contain wildcards.  Neither the
  7897. filename nor filespec should include drive or subdirectory
  7898. specifications.
  7899.  
  7900. One way of using this is in processing file exclusion lists.
  7901. The FindFirstF routine allows you to find files that match a
  7902. given filespec; to this, you could add a MatchFile-based
  7903. routine which would screen out files that match a different
  7904. filespec.  Such a routine would allow you to create utilities
  7905. to do things like "DIR *.* /EXCEPT=*.BAS".
  7906.  
  7907.    MatchFile FileSpec$, FileName$, IsMatch%
  7908.  
  7909. FileSpec$   master file pattern (may contain wildcards)
  7910. FileName$   name of file to test against the master pattern
  7911. -------
  7912. IsMatch%    0 if the filename doesn't match the filespec
  7913.  
  7914. Name  : MatShuffleD          (Matrix Shuffle Double-prec)
  7915. Class : Array
  7916. Level : Any
  7917.  
  7918. This routine shuffles the elements in a double-precision array,
  7919. efficiently randomizing their order.  It relies on the RND
  7920. function, so you'd be advised to use the RANDOMIZE statement at
  7921. the top of your program unless you want the results to be
  7922. predictable.  A good way of initializing the random number
  7923. generator is:
  7924.    RANDOMIZE TIMER
  7925.  
  7926. You can specify the starting and ending positions in the array
  7927. to shuffle, so you don't have to shuffle the entire array.
  7928.  
  7929. See also the string shuffle, ShuffleSt, and other array
  7930. shuffles: MatShuffleI, MatShuffleL, MatShuffleS, MatShuffleSt
  7931.  
  7932.    MatShuffleD Array#(), StartPosn%, EndPosn%
  7933.  
  7934. Array#()     array to shuffle
  7935. StartPosn%   element at which to begin shuffling
  7936. EndPosn%     element at which to stop shuffling
  7937. -------
  7938. Array#()     shuffled array
  7939.  
  7940. Name  : MatShuffleI          (Matrix Shuffle Integer)
  7941. Class : Array
  7942. Level : Any
  7943.  
  7944. This routine shuffles the elements in an integer array,
  7945. efficiently randomizing their order.  It relies on the RND
  7946. function, so you'd be advised to use the RANDOMIZE statement at
  7947. the top of your program unless you want the results to be
  7948. predictable.  A good way of initializing the random number
  7949. generator is:
  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, MatShuffleL, MatShuffleS, MatShuffleSt
  7957.  
  7958.    MatShuffleI 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  : MatShuffleL          (Matrix Shuffle Long integer)
  7967. Class : Array
  7968. Level : Any
  7969.  
  7970. This routine shuffles the elements in a long integer 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.    RANDOMIZE TIMER
  7977.  
  7978. You can specify the starting and ending positions in the array
  7979. to shuffle, so you don't have to shuffle the entire array.
  7980.  
  7981. See also the string shuffle, ShuffleSt, and other array
  7982. shuffles: MatShuffleD, MatShuffleI, MatShuffleS, MatShuffleSt
  7983.  
  7984.    MatShuffleL Array&(), StartPosn%, EndPosn%
  7985.  
  7986. Array&()     array to shuffle
  7987. StartPosn%   element at which to begin shuffling
  7988. EndPosn%     element at which to stop shuffling
  7989. -------
  7990. Array&()     shuffled array
  7991.  
  7992. Name  : MatShuffleS          (Matrix Shuffle Single-prec)
  7993. Class : Array
  7994. Level : Any
  7995.  
  7996. This routine shuffles the elements in a single-precision array,
  7997. efficiently randomizing their order.  It relies on the RND
  7998. function, so you'd be advised to use the RANDOMIZE statement at
  7999. the top of your program unless you want the results to be
  8000. predictable.  A good way of initializing the random number
  8001. generator is:
  8002.    RANDOMIZE TIMER
  8003.  
  8004. You can specify the starting and ending positions in the array
  8005. to shuffle, so you don't have to shuffle the entire array.
  8006.  
  8007. See also the string shuffle, ShuffleSt, and other array
  8008. shuffles: MatShuffleD, MatShuffleI, MatShuffleL, MatShuffleSt
  8009.  
  8010.    MatShuffleS Array!(), StartPosn%, EndPosn%
  8011.  
  8012. Array!()     array to shuffle
  8013. StartPosn%   element at which to begin shuffling
  8014. EndPosn%     element at which to stop shuffling
  8015. -------
  8016. Array!()     shuffled array
  8017.  
  8018. Name  : MatShuffleSt         (Matrix Shuffle String)
  8019. Class : Array
  8020. Level : Any
  8021.  
  8022. This routine shuffles the elements in a string array,
  8023. efficiently randomizing their order.  It relies on the RND
  8024. function, so you'd be advised to use the RANDOMIZE statement at
  8025. the top of your program unless you want the results to be
  8026. predictable.  A good way of initializing the random number
  8027. generator is:
  8028.    RANDOMIZE TIMER
  8029.  
  8030. You can specify the starting and ending positions in the array
  8031. to shuffle, so you don't have to shuffle the entire array.
  8032.  
  8033. See also the string shuffle, ShuffleSt, and other array
  8034. shuffles: MatShuffleD, MatShuffleI, MatShuffleL, MatShuffleS
  8035.  
  8036.    MatShuffleSt Array$(), StartPosn%, EndPosn%
  8037.  
  8038. Array$()     array to shuffle
  8039. StartPosn%   element at which to begin shuffling
  8040. EndPosn%     element at which to stop shuffling
  8041. -------
  8042. Array$()     shuffled array
  8043.  
  8044. Name  : Max%                 (Maximum)
  8045. Class : Numeric
  8046. Level : Any
  8047.  
  8048. This function returns the larger of two integers.  It can be
  8049. handy in sorting routines or for keeping a value within a
  8050. desired range.
  8051.  
  8052.    Larger% = Max%(First%, Second%)
  8053.  
  8054. First%     one integer
  8055. Second%    another integer
  8056. -------
  8057. Larger%    larger of the two integers
  8058.  
  8059. Name  : MaxD#                (Maximum Double precision)
  8060. Class : Numeric
  8061. Level : Any
  8062.  
  8063. This function returns the larger of two double-precision
  8064. numbers.  It can be handy in sorting routines or for keeping a
  8065. value within a desired range.
  8066.  
  8067.    Larger# = MaxD#(First#, Second#)
  8068.  
  8069. First#     one number
  8070. Second#    another number
  8071. -------
  8072. Larger#    larger of the two numbers
  8073.  
  8074. Name  : MaxL&                (Maximum Long integer)
  8075. Class : Numeric
  8076. Level : Any
  8077.  
  8078. This function returns the larger of two long integers.  It can
  8079. be handy in sorting routines or for keeping a value within a
  8080. desired range.
  8081.  
  8082.    Larger& = MaxL&(First&, Second&)
  8083.  
  8084. First&     one long integer
  8085. Second&    another long integer
  8086. -------
  8087. Larger&    larger of the two long integers
  8088.  
  8089. Name  : MaxS!                (Maximum Single precision)
  8090. Class : Numeric
  8091. Level : Any
  8092.  
  8093. This function returns the larger of two single-precision
  8094. numbers.  It can be handy in sorting routines or for keeping a
  8095. value within a desired range.
  8096.  
  8097.    Larger! = MaxS!(First!, Second!)
  8098.  
  8099. First!     one number
  8100. Second!    another number
  8101. -------
  8102. Larger!    larger of the two numbers
  8103.  
  8104. Name  : MClickLoc            (Middle Click Location)
  8105. Class : Mouse
  8106. Level : BIOS
  8107.  
  8108. This routine returns the position of the mouse cursor at the
  8109. last click of the middle mouse button.  It must be used after
  8110. one of the routines which check for mouse clicks, as they
  8111. maintain the click position.  These routines include GetKey3
  8112. and MMClick3.
  8113.  
  8114. The values returned are in graphics coordinates (virtual
  8115. coordinates for SCREEN 0 through SCREEN 2, due to the nature of
  8116. the mouse driver).
  8117.  
  8118.    MClickLoc X%, Y%
  8119.  
  8120. -------
  8121. X%         horizontal coordinate at last middle click
  8122. Y%         vertical coordinate at last middle click
  8123.  
  8124. Name  : MeanAverageD         (Mean Average Double precision)
  8125. Class : Array management
  8126. Level : Any
  8127.  
  8128. This routine averages the specified range of elements in an
  8129. array of double precision numbers.  The form of averaging used
  8130. is called the "mean", which is the sum of all of the elements
  8131. divided by the number of elements involved. This is the most
  8132. common method of averaging a list of numbers.
  8133.  
  8134.    MeanAverageD Array#(), First%, Last%, Average#, ErrCode%
  8135.  
  8136. Array#()    array to be averaged
  8137. First%      array element to start with
  8138. Last%       array element to end with
  8139. -------
  8140. Average#    average value of the specified elements
  8141. ErrCode%    0 if there was no error
  8142.  
  8143. Name  : MeanAverageI         (Mean Average Integer)
  8144. Class : Array management
  8145. Level : Any
  8146.  
  8147. This routine averages the specified range of elements in an
  8148. array of integer numbers.  The form of averaging used is called
  8149. the "mean", which is the sum of all of the elements divided by
  8150. the number of elements involved. This is the most common method
  8151. of averaging a list of numbers.
  8152.  
  8153.    MeanAverageI Array%(), First%, Last%, Average%, ErrCode%
  8154.  
  8155. Array()     array to be averaged
  8156. First%      array element to start with
  8157. Last%       array element to end with
  8158. -------
  8159. Average%    average value of the specified elements
  8160. ErrCode%    0 if there was no error
  8161.  
  8162. Name  : MeanAverageL         (Mean Average Long integer)
  8163. Class : Array management
  8164. Level : Any
  8165.  
  8166. This routine averages the specified range of elements in an
  8167. array of long integer numbers.  The form of averaging used is
  8168. called the "mean", which is the sum of all of the elements
  8169. divided by the number of elements involved. This is the most
  8170. common method of averaging a list of numbers.
  8171.  
  8172.    MeanAverageL Array&(), First%, Last%, Average&, ErrCode%
  8173.  
  8174. Array&()    array to be averaged
  8175. First%      array element to start with
  8176. Last%       array element to end with
  8177. -------
  8178. Average&    average value of the specified elements
  8179. ErrCode%    0 if there was no error
  8180.  
  8181. Name  : MeanAverageS         (Mean Average Single precision)
  8182. Class : Array management
  8183. Level : Any
  8184.  
  8185. This routine averages the specified range of elements in an
  8186. array of single precision numbers.  The form of averaging used
  8187. is called the "mean", which is the sum of all of the elements
  8188. divided by the number of elements involved. This is the most
  8189. common method of averaging a list of numbers.
  8190.  
  8191.    MeanAverageS Array!(), First%, Last%, Average!, ErrCode%
  8192.  
  8193. Array!()    array to be averaged
  8194. First%      array element to start with
  8195. Last%       array element to end with
  8196. -------
  8197. Average!    average value of the specified elements
  8198. ErrCode%    0 if no error
  8199.  
  8200. Name  : MemSwap              (Memory Swap)
  8201. Class : Memory
  8202. Level : Any
  8203.  
  8204. MemSwap swaps the contents of one area of memory with another.
  8205. This can be used for a variety of things, from swapping a saved
  8206. screen with the actual screen to exchanging the contents of two
  8207. arrays.
  8208.  
  8209.    MemSwap DSeg1%, DOfs1%, DSeg2%, DOfs2%, Bytes%
  8210.  
  8211. DSeg1%     segment of first memory area
  8212. DOfs1%     offset of first memory area
  8213. DSeg2%     segment of second memory area
  8214. DOfs2%     offset of second memory area
  8215. Bytes%     bytes to swap
  8216.  
  8217. Name  : Min%                 (Minimum)
  8218. Class : Numeric
  8219. Level : Any
  8220.  
  8221. This function returns the smaller of two integers.  It can be
  8222. handy in sorting routines or for keeping a value within a
  8223. desired range.
  8224.  
  8225.    Smaller% = Min%(First%, Second%)
  8226.  
  8227. First%     one integer
  8228. Second%    another integer
  8229. -------
  8230. Smaller%   smaller of the two integers
  8231.  
  8232. Name  : MinD#                (Minimum Double precision)
  8233. Class : Numeric
  8234. Level : Any
  8235.  
  8236. This function returns the smaller of two double-precision
  8237. numbers.  It can be handy in sorting routines or for keeping a
  8238. value within a desired range.
  8239.  
  8240.    Smaller# = MinD#(First#, Second#)
  8241.  
  8242. First#     one number
  8243. Second#    another number
  8244. -------
  8245. Smaller#   smaller of the two numbers
  8246.  
  8247. Name  : MinL&                (Minimum Long integer)
  8248. Class : Numeric
  8249. Level : Any
  8250.  
  8251. This function returns the smaller of two long integers.  It can
  8252. be handy in sorting routines or for keeping a value within a
  8253. desired range.
  8254.  
  8255.    Smaller& = MinL&(First&, Second&)
  8256.  
  8257. First&     one long integer
  8258. Second&    another long integer
  8259. -------
  8260. Smaller&   smaller of the two long integers
  8261.  
  8262. Name  : MinS!                (Minimum Single precision)
  8263. Class : Numeric
  8264. Level : Any
  8265.  
  8266. This function returns the smaller of two single-precision
  8267. numbers.  It can be handy in sorting routines or for keeping a
  8268. value within a desired range.
  8269.  
  8270.    Smaller! = MinS!(First!, Second!)
  8271.  
  8272. First!     one number
  8273. Second!    another number
  8274. -------
  8275. Smaller!   smaller of the two numbers
  8276.  
  8277. Name  : MMButton             (Mouse Button)
  8278. Class : Mouse
  8279. Level : BIOS
  8280.  
  8281. The MMButton routine allows you to find out which mouse buttons
  8282. are pressed. Although it will work with any mouse, it is
  8283. designed specifically for a mouse with two buttons (see also
  8284. MMButton3).  If you want to find out which buttons were pressed
  8285. in the past, rather than being pressed now, try MMClick instead.
  8286.  
  8287. This routine will not work properly if there is no mouse
  8288. available.  Use the MMCheck routine if you are not sure.
  8289.  
  8290.    MMButton LeftB%, RightB%
  8291.  
  8292. -------
  8293. LeftB%     whether the left button is pressed
  8294. RightB%    whether the right button is pressed
  8295.  
  8296. Name  : MMButton3            (Mouse Button for 3-button mouse)
  8297. Class : Mouse
  8298. Level : BIOS
  8299.  
  8300. The MMButton3 routine allows you to find out which mouse
  8301. buttons are pressed. Although it will work with any mouse, it
  8302. is designed specifically for a mouse with three buttons (see
  8303. also MMButton).  If you want to find out which buttons were
  8304. pressed in the past, rather than being pressed now, try
  8305. MMClick3 instead.
  8306.  
  8307. This routine will not work properly if there is no mouse
  8308. available.  Use the MMCheck routine if you are not sure.
  8309.  
  8310.    MMButton3 LeftB%, MiddleB%, RightB%
  8311.  
  8312. -------
  8313. LeftB%     whether the left button is pressed
  8314. MiddleB%   whether the middle button is pressed
  8315. RightB%    whether the right button is pressed
  8316.  
  8317. Name  : MMCheck              (Mouse Check and initialize)
  8318. Class : Mouse
  8319. Level : BIOS
  8320.  
  8321. This routine does a number of things.  Primarily, it is
  8322. intended to let you check to see if a mouse is available.  It
  8323. returns a zero if there is no mouse; if there is a mouse, the
  8324. number of mouse buttons is returned.  The mouse status is also
  8325. initialized, so this is best used once at the beginning of your
  8326. program.
  8327.  
  8328. All of the other mouse routines assume that a mouse is
  8329. available, so you should definitely use MMCheck if you're not
  8330. sure.  Otherwise, results will be unusual at best, and the
  8331. computer may even lock up under some DOS versions.
  8332.  
  8333. There is also a function version of this routine, MMCheck2%.
  8334.  
  8335.    MMCheck Buttons%
  8336.  
  8337. -------
  8338. Buttons%   number of mouse buttons (0 if no mouse is installed)
  8339.  
  8340. Name  : MMCheck2%            (Mouse Check and initialize)
  8341. Class : Mouse
  8342. Level : BIOS
  8343.  
  8344. This function does a number of things.  Primarily, it is
  8345. intended to let you check to see if a mouse is available.  It
  8346. returns a zero if there is no mouse; if there is a mouse, the
  8347. number of mouse buttons is returned.  The mouse status is also
  8348. initialized, so this is best used once at the beginning of your
  8349. program.
  8350.  
  8351. All of the other mouse routines assume that a mouse is
  8352. available, so you should definitely use MMCheck2% if you're not
  8353. sure.  Otherwise, results will be unusual at best, and the
  8354. computer may even lock up under some DOS versions.
  8355.  
  8356. There is also a sub version of this routine, MMCheck.
  8357.  
  8358.    Buttons% = MMCheck2%
  8359.  
  8360. -------
  8361. Buttons%   number of mouse buttons (0 if no mouse is installed)
  8362.  
  8363. Name  : MMClick              (Mouse Click)
  8364. Class : Mouse
  8365. Level : BIOS
  8366.  
  8367. The MMClick routine allows you to find out which mouse buttons
  8368. have been pressed since you last checked, and how many times
  8369. they were pressed. Although it will work with any mouse, it is
  8370. designed specifically for a mouse with two buttons (see also
  8371. MMClick3).  If you want to find out which buttons are currently
  8372. being pressed, try MMButton instead.
  8373.  
  8374. See also the LClickLoc and RClickLoc routines, which allow you
  8375. to determine what the mouse position was at the last click.
  8376.  
  8377. This routine will not work properly if there is no mouse
  8378. available.  Use the MMCheck routine if you are not sure.
  8379.  
  8380.    MMClick LeftB%, RightB%
  8381.  
  8382. -------
  8383. LeftB%     # of times left button was pressed since last check
  8384. RightB%    # of times right button was pressed since last check
  8385.  
  8386. Name  : MMClick3             (Mouse Click for 3-button mouse)
  8387. Class : Mouse
  8388. Level : BIOS
  8389.  
  8390. The MMClick3 routine allows you to find out which mouse buttons
  8391. have been pressed since you last checked, and how many times
  8392. they were pressed. Although it will work with any mouse, it is
  8393. designed specifically for a mouse with three buttons (see also
  8394. MMClick).  If you want to find out which buttons are currently
  8395. being pressed, try MMButton3 instead.
  8396.  
  8397. See also the LClickLoc, MClickLoc and RClickLoc routines, which
  8398. allow you to determine what the mouse position was at the last
  8399. click.
  8400.  
  8401. This routine will not work properly if there is no mouse
  8402. available.  Use the MMCheck routine if you are not sure.
  8403.  
  8404.    MMClick3 LeftB%, MiddleB%, RightB%
  8405.  
  8406. -------
  8407. LeftB%     # of times left button was pressed since last check
  8408. MiddleB%   # of times middle button was pressed since last look
  8409. RightB%    # of times right button was pressed since last check
  8410.  
  8411. Name  : MMCursorOff          (Mouse Cursor Off)
  8412. Class : Mouse
  8413. Level : BIOS
  8414.  
  8415. This routine makes the mouse cursor invisible.  The mouse
  8416. cursor will still function as a location indicator, in the same
  8417. way that the normal cursor still functions when you make it
  8418. invisible.
  8419.  
  8420. Note that the mouse cursor is somewhat bizarre in that an
  8421. "invisibility level" is kept.  Every time you use MMCursorOff,
  8422. the invisibility depth is increased; subsequent attempts to
  8423. make the cursor visible will not actually do so until the
  8424. invisibility depth reaches zero.  In other words, if you call
  8425. MMCursorOff when the cursor is already invisible, the cursor
  8426. will not reappear until you've told it to reappear as many
  8427. times as you told it to disappear.  This is fairly demented,
  8428. but that's the way Microsoft made it.
  8429.  
  8430. This routine will not work properly if no mouse is installed.
  8431. See MMCheck.
  8432.  
  8433.    MMCursorOff
  8434.  
  8435. Name  : MMCursorOn           (Mouse Cursor On)
  8436. Class : Mouse
  8437. Level : BIOS
  8438.  
  8439. This routine makes the mouse cursor visible, or tries to do
  8440. so...
  8441.  
  8442. The mouse cursor is somewhat bizarre in that an "invisibility
  8443. level" is kept.  Every time you use MMCursorOff, the
  8444. invisibility depth is increased; subsequent attempts to make
  8445. the cursor visible will not actually do so until the
  8446. invisibility depth reaches zero.  In other words, if you call
  8447. MMCursorOff when the cursor is already invisible, the cursor
  8448. will not reappear until you've told it to reappear (with
  8449. MMCursorOn) as many times as you told it to disappear.  This is
  8450. fairly demented, but that's the way Microsoft made it.
  8451.  
  8452. Note that there is a flaw in BASIC such that a "mouse dropping"
  8453. may be left on the screen if your program is invoked at the
  8454. bottom of the DOS screen, causing a scroll while the mouse
  8455. cursor is visible.  To avoid this, use VIEW PRINT at the
  8456. beginning of your program to remove the default "status line".
  8457. For the standard 80x25 text screen, this would be done like so:
  8458.  
  8459.    VIEW PRINT 1 TO 25
  8460.  
  8461. This routine will not work properly if no mouse is installed.
  8462. See MMCheck or MMCheck2%.
  8463.  
  8464.    MMCursorOn
  8465.  
  8466. Name  : MMGetLoc             (Mouse Get Location)
  8467. Class : Mouse
  8468. Level : BIOS
  8469.  
  8470. This routine allows you to get the current location of the
  8471. mouse cursor.  It doesn't matter if the cursor is visible or
  8472. invisible.
  8473.  
  8474. The mouse cursor location is somewhat perverse in CGA and text
  8475. modes, due to the sloppy design of Microsoft's original mouse
  8476. driver.  In text modes and both CGA graphics modes, the cursor
  8477. is returned as if the screen is 640x200. To correct this for
  8478. SCREEN 1, divide the X coordinate by two.  To correct this for
  8479. text modes, divide each coordinate by eight.
  8480.  
  8481. This routine will not work properly if there is no mouse
  8482. available.  Use the MMCheck routine if you are not sure.
  8483.  
  8484. See also GetMouseLoc, which returns the appropriate coordinates
  8485. for text mode.
  8486.  
  8487.    MMGetLoc X%, Y%
  8488.  
  8489. -------
  8490. X%         X coordinate ("column")
  8491. Y%         Y coordinate ("row")
  8492.  
  8493. Name  : MMSetLoc             (Mouse Set Location)
  8494. Class : Mouse
  8495. Level : BIOS
  8496.  
  8497. This routine allows you to set the current location of the
  8498. mouse cursor.  It doesn't matter if the cursor is visible or
  8499. invisible.
  8500.  
  8501. The mouse cursor location is somewhat perverse in CGA and text
  8502. modes, due to the sloppy design of Microsoft's original mouse
  8503. driver.  In text modes and both CGA graphics modes, the cursor
  8504. is returned as if the screen is 640x200. To correct this for
  8505. SCREEN 1, double the X coordinate.  To correct this for text
  8506. modes, multiply each coordinate by eight and add four.
  8507.  
  8508. This routine will not work properly if there is no mouse
  8509. available.  Use the MMCheck routine if you are not sure.
  8510.  
  8511. See also SetMouseLoc, which does the coordinate conversions for
  8512. you in text mode.
  8513.  
  8514.    MMSetLoc X%, Y%
  8515.  
  8516. X%         X coordinate ("column")
  8517. Y%         Y coordinate ("row")
  8518.  
  8519. Name  : MMSetRange           (Mouse Set Range)
  8520. Class : Mouse
  8521. Level : BIOS
  8522.  
  8523. This routine allows you to set the allowable range of mouse
  8524. cursor locations. The mouse cursor will not be permitted to go
  8525. outside this range.  It doesn't matter if the cursor is visible
  8526. or invisible.
  8527.  
  8528. The mouse cursor location is somewhat perverse in CGA and text
  8529. modes, due to the sloppy design of Microsoft's original mouse
  8530. driver.  In text modes and both CGA graphics modes, the cursor
  8531. is returned as if the screen is 640x200. To correct this for
  8532. SCREEN 1, double the X coordinate.  To correct this for text
  8533. modes, multiply each coordinate by eight and add four.
  8534.  
  8535. This routine will not work properly if there is no mouse
  8536. available.  Use the MMCheck routine if you are not sure.
  8537.  
  8538.    MMSetRange X1%, Y1%, X2%, Y2%
  8539.  
  8540. X1%       left   X coordinate (upper left "column")
  8541. Y1%       top    Y coordinate (upper left "row")
  8542. X2%       right  X coordinate (lower right "column")
  8543. Y2%       bottom Y coordinate (lower right "row")
  8544.  
  8545. Name  : Month0               (Month)
  8546. Class : String / Time
  8547. Level : Any
  8548.  
  8549. Given a month number, this routine tells you the name of the
  8550. month.
  8551.  
  8552.    MonthName$ = SPACE$(9)
  8553.    Month0 MonthName$, NameLen%, MonthNr%
  8554.    MonthName$ = LEFT$(MonthName$, NameLen)
  8555.  
  8556. MonthNr%    month number (1-12)
  8557. -------
  8558. MonthName$  name of the month.  Init to at least 9 characters.
  8559. NameLen%    length of the month name
  8560.  
  8561. Name  : MouseBuffer          (Mouse Buffer size)
  8562. Class : Mouse
  8563. Level : BIOS
  8564.  
  8565. This routine is used before MouseSave in order to find out how
  8566. many bytes are needed to save the mouse state.
  8567.  
  8568. This routine will not work properly if there is no mouse
  8569. available.  Use the MMCheck routine if you are not sure.
  8570.  
  8571.    MouseBuffer Bytes%
  8572.    St$ = SPACE$(Bytes%)
  8573.    MouseSave St$
  8574.  
  8575. -------
  8576. Bytes%     number of bytes needed to save the state of the mouse
  8577.  
  8578. Name  : MouseCursor          (Mouse Cursor type)
  8579. Class : Mouse
  8580. Level : BIOS
  8581.  
  8582. The MouseCursor routine allows you to select one of a number of
  8583. graphics mouse cursors.  The following types are supported:
  8584.  
  8585.     0   hourglass ("please wait" symbol)
  8586.     1   standard arrow pointer
  8587.     2   pointing hand
  8588.     3   crosshair
  8589.     4   target (box-in-a-box pointer)
  8590.     5   grabbing hand
  8591.  
  8592. If you'd like other shapes, please suggest a few!  I'll be glad
  8593. to add them.
  8594.  
  8595.    MouseCursor CursorNr%
  8596.  
  8597. CursorNr%    type of mouse graphics cursor to use (see above)
  8598.  
  8599. Name  : MousePen             (Mouse light Pen emulation)
  8600. Class : Mouse
  8601. Level : BIOS
  8602.  
  8603. The mouse can be made to emulate a light pen, allowing you to
  8604. use BASIC's light pen routines to provide a certain minimal
  8605. level of support for both light pens and mice.  This emulation
  8606. is on by default, but you can turn it off in case there is an
  8607. actual light pen attached.
  8608.  
  8609. This routine will not work properly if there is no mouse
  8610. available.  Use the MMCheck routine if you are not sure.
  8611.  
  8612.    MousePen EmulatePen%
  8613.  
  8614. EmulatePen%   whether mouse should emulate light pen (0 no)
  8615.  
  8616. Name  : MouseRest            (Mouse status Restore)
  8617. Class : Mouse
  8618. Level : BIOS
  8619.  
  8620. This routine is for use in conjunction with MouseSave.  It
  8621. allows you to restore the mouse settings to a state that was
  8622. saved in the past.
  8623.  
  8624. This routine will not work properly if there is no mouse
  8625. available.  Use the MMCheck routine if you are not sure.
  8626.  
  8627.    MouseRest St$
  8628.  
  8629. St$        mouse state to restore
  8630.  
  8631. Name  : MouseSave            (Mouse status Save)
  8632. Class : Mouse
  8633. Level : BIOS
  8634.  
  8635. This one is handy for use in subprograms or when SHELLing to
  8636. other programs that may use the mouse.  It allows you to save
  8637. the current mouse settings as a string.  To find out how long
  8638. the string should be, use MouseBuffer.
  8639.  
  8640. This routine will not work properly if there is no mouse
  8641. available.  Use the MMCheck routine if you are not sure.
  8642.  
  8643.    MouseBuffer Bytes%
  8644.    St$ = SPACE$(Bytes%)
  8645.    MouseSave St$
  8646.  
  8647. -------
  8648. St$        saved mouse state.  Init as shown above.
  8649.  
  8650. Name  : MPrint               (MS-DOS Print)
  8651. Class : Display
  8652. Level : BIOS
  8653.  
  8654. The MPrint routine displays text using mostly DOS services.
  8655. This allows it to handle ANSI codes if an ANSI driver is
  8656. installed.  In addition, the output of MPrint is confined to a
  8657. region of the screen that you may select with MWindow.  By
  8658. default, the region is 1,1 to 25,80: a full 80x25 text screen.
  8659.  
  8660. Using MPrint is similar to using PRINT followed by a semicolon.
  8661. It does not automatically move to the next line.  To do so, you
  8662. must MPrint a carriage return and linefeed: CHR$(13) + CHR$(10).
  8663.  
  8664. To clear the MWindow region, MPrint a formfeed: CHR$(12).
  8665.  
  8666.    MPrint St$
  8667.  
  8668. St$         string to display
  8669.  
  8670. Name  : MulMatI              (Multiply Matrix by Integer)
  8671. Class : Array management
  8672. Level : Any
  8673.  
  8674. This routine multiplies as many elements of an integer array as
  8675. you like by a given number, starting at a specified place in
  8676. the array.  If there was a numeric overflow at any point in the
  8677. operation, an error code will be returned.
  8678.  
  8679.    MulMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  8680.  
  8681. DSeg%      segment of the array element to start at
  8682. DOfs%      offset of the array element to start at
  8683. Elements%  number of array elements to process
  8684. Value%     value to multiply each array element by
  8685. -------
  8686. ErrCode%   error code: 0 if no error
  8687.  
  8688. Name  : MultiAND             (Multiple AND)
  8689. Class : String
  8690. Level : Any
  8691.  
  8692. The MultiAND routine performs an arithmetic "AND" operation on
  8693. each character in a string.
  8694.  
  8695. Among the varied uses for MultiAND is stripping the high bit
  8696. from characters, as you might want to do in telecommunications
  8697. or in converting WordStar files.  In that case, you would use a
  8698. BitMask% of 127.
  8699.  
  8700.    MultiAND St$, BitMask%
  8701.  
  8702. St$        string to process
  8703. BitMask%   bit mask (0-255) with which to AND each character
  8704. -------
  8705. St$        processed string
  8706.  
  8707. Name  : MultiOR              (Multiple OR)
  8708. Class : String
  8709. Level : Any
  8710.  
  8711. The MultiOR routine performs an arithmetic "OR" operation on
  8712. each character in a string.
  8713.  
  8714.    MultiOR St$, BitMask%
  8715.  
  8716. St$        string to process
  8717. BitMask%   bit mask (0-255) with which to OR each character
  8718. -------
  8719. St$        processed string
  8720.  
  8721. Name  : MultiXOR             (Multiple XOR)
  8722. Class : String
  8723. Level : Any
  8724.  
  8725. The MultiXOR routine performs an arithmetic "XOR" operation on
  8726. each character in a string.
  8727.  
  8728.    MultiXOR St$, BitMask%
  8729.  
  8730. St$        string to process
  8731. BitMask%   bit mask (0-255) with which to XOR each character
  8732. -------
  8733. St$        processed string
  8734.  
  8735. Name  : MWindow              (MS-DOS Window)
  8736. Class : Display
  8737. Level : Any
  8738.  
  8739. The MWindow routine works in conjunction with MPrint.  It
  8740. defines an area of the screen in which text displayed by MPrint
  8741. must stay.  The default window is 1,1 to 25,80.
  8742.  
  8743.    MWindow TopRow%, LeftCol%, BottomRow%, RightCol%
  8744.  
  8745. TopRow%     top row
  8746. LeftCol%    left column
  8747. BottomRow%  bottom row
  8748. RightCol%   right column
  8749.  
  8750. Name  : NameCase             (Name Case)
  8751. Class : String
  8752. Level : Any
  8753.  
  8754. This routine provides a specialized uppercase/lowercase
  8755. converter designed especially for names.  It converts the first
  8756. letter in each word in a string to uppercase, with the rest of
  8757. the word being converted to lowercase.
  8758.  
  8759. See also NameCase2, the FUNCTION version of this routine.
  8760.  
  8761.    NameCase St$
  8762.  
  8763. St$         string to process
  8764. -------
  8765. St$         processed string
  8766.  
  8767. Name  : NameCase2$           (Name Case)
  8768. Class : String
  8769. Level : Any
  8770.  
  8771. This routine provides a specialized uppercase/lowercase
  8772. converter designed especially for names.  It converts the first
  8773. letter in each word in a string to uppercase, with the rest of
  8774. the word being converted to lowercase.
  8775.  
  8776. See also NameCase, the SUB version of this routine.
  8777.  
  8778.    Result$ = NameCase2$(St$)
  8779.  
  8780. St$         string to process
  8781. -------
  8782. Result$     processed string
  8783.  
  8784. Name  : Num2Phone$           (compressed phone# to string)
  8785. Class : Numeric String
  8786. Level : Any
  8787.  
  8788. This function takes a phone number (as encoded by Phone2Num&)
  8789. and converts it to unformatted string form.  Depending on the
  8790. original number, the result may be 4, 7, or 10 characters in
  8791. length.  An invalid code will result in a null string.
  8792.  
  8793. NOTE that this function will handle current US-style phone
  8794. numbers.  It expects the first three digits of a 10-digit phone
  8795. number to represent an area code, where the middle digit of the
  8796. area code is always either zero or one.  This convention is
  8797. expected to change as of 1994 or so, whereupon this function
  8798. will no longer be reliable <sigh>.
  8799.  
  8800.    Result$ = Num2Phone$(PhoneNumber&)
  8801.  
  8802. PhoneNumber&    encoded phone number
  8803. -------
  8804. Result$         phone number ("" if invalid number)
  8805.  
  8806. Name  : NumFormat            (Number Format)
  8807. Class : Numeric
  8808. Level : DOS
  8809.  
  8810. This works just like PRINT USING, but returns the results in a
  8811. string rather than sending them to the display or a file.
  8812.  
  8813. Note that an interaction between QuickBASIC, DOS and some
  8814. networks means that this routine will briefly access the
  8815. default drive.  Strange but true.
  8816.  
  8817.    NumFormat Format$, Number#, Result$
  8818.  
  8819. Format$     numeric format
  8820. Number#     number to format
  8821. -------
  8822. Result$     formatted number
  8823.  
  8824. Name  : NumProc              (Numeric Processor)
  8825. Class : Equipment
  8826. Level : Any
  8827.  
  8828. NumProc returns the type of numeric coprocessor installed.  I
  8829. haven't tried it with a 80486, but I would guess an 80486
  8830. always appears to have an 80387 (unless it's one of those
  8831. brain-damaged 80486SX chips).
  8832.  
  8833. Results are returned as follows:
  8834.  
  8835.    0    no math chip
  8836.    1    8087
  8837.    2    80287
  8838.    3    80387
  8839.  
  8840. If anyone can tell me how to better handle a 486 here, I'd
  8841. appreciate it.
  8842.  
  8843.    NumProc ProcType%
  8844.  
  8845. -------
  8846. ProcType%    type of numeric coprocessor (see above)
  8847.  
  8848. Name  : NumProc2%            (Numeric Processor)
  8849. Class : Equipment
  8850. Level : Any
  8851.  
  8852. NumProc2% returns the type of numeric coprocessor installed.  I
  8853. haven't tried it with a 80486, but I would guess an 80486
  8854. always appears to have an 80387 (unless it's one of those
  8855. brain-damaged 80486SX chips).
  8856.  
  8857.  
  8858. Results are returned as follows:
  8859.  
  8860.    0    no math chip
  8861.    1    8087
  8862.    2    80287
  8863.    3    80387
  8864.  
  8865. If anyone can tell me how to better handle a 486 here, I'd
  8866. appreciate it.
  8867.  
  8868.    ProcType% = NumProc2%
  8869.  
  8870. -------
  8871. ProcType%    type of numeric coprocessor (see above)
  8872.  
  8873. Name  : ObjScan              (Object file Scan)
  8874. Class : Disk
  8875. Level : DOS
  8876.  
  8877. This routine returns information about a specified .OBJ file.
  8878. It returns the module name, public names, and external names.
  8879. The module name is generally the name of the original file
  8880. which was compiled to produce the .OBJ file. Public names are
  8881. the names of routines (and sometimes variables) that can be
  8882. accessed by outside programs.  External names are the names of
  8883. routines (and variables) that the .OBJ file expects to be
  8884. provided by outside programs.
  8885.  
  8886. External names containing "$", starting with "_" or with
  8887. lowercase characters are screened out to avoid returning a huge
  8888. list of BASIC internal routines. For the same reason, routines
  8889. ending with "QQ" will also be screened out, as will
  8890. STRINGADDRESS, STRINGASSIGN, STRINGLENGTH, and STRINGRELEASE.
  8891. Y'know, it would be nice if Microsoft followed some sort of
  8892. standard for its names.
  8893.  
  8894. The public and external names are returned in string arrays.
  8895. ObjScan will fail with an error code if there is insufficient
  8896. space, so be sure to allow plenty of room.  If scanning
  8897. subprograms, a DIM to 30 or 40 elements is probably ample.  If
  8898. scanning large programs, you may need to increase the
  8899. dimensions substantially.
  8900.  
  8901. The ObjScan routine can be used as the basis for a simple ".OBJ
  8902. info" utility or for more complex applications, such as library
  8903. management.
  8904.  
  8905.    ObjScan ObjFile$, ModName$, Routine$(), External$(), ErrCode%
  8906.  
  8907. ObjFile$      name of .OBJ file
  8908. -------
  8909. ModName$      module name
  8910. Routine$()    public names
  8911. External$()   external names
  8912. ErrCode%      whether there was an error (0 no)
  8913.  
  8914. Name  : Odd%                 (Odd integer?)
  8915. Class : Numeric
  8916. Level : Any
  8917.  
  8918. This function returns whether an integer is odd.  If so, it
  8919. returns -1, otherwise 0.
  8920.  
  8921.    Result% = Odd%(Number%)
  8922.  
  8923. Number%    number to test
  8924. -------
  8925. Result%    whether the number is odd
  8926.  
  8927. Name  : OddL%                 (Odd Long integer?)
  8928. Class : Numeric
  8929. Level : Any
  8930.  
  8931. This function returns whether a long integer is odd.  If so, it
  8932. returns -1, otherwise 0.
  8933.  
  8934.    Result% = Odd%(Number&)
  8935.  
  8936. Number&    number to test
  8937. -------
  8938. Result%    whether the number is odd
  8939.  
  8940. Name  : OrSt                 (OR String)
  8941. Class : String
  8942. Level : Any
  8943.  
  8944. This routine ORs each byte in one string with the corresponding
  8945. byte in a second string.  The strings must be the same length.
  8946.  
  8947.    OrSt St1$, St2$
  8948.  
  8949. St1$      string to OR
  8950. St2$      string to OR with
  8951. -------
  8952. St1$      result
  8953.  
  8954. Name  : ParseFSpec           (Parse File Specification)
  8955. Class : Disk
  8956. Level : Any
  8957.  
  8958. This routine splits a file specification into a drive,
  8959. subdirectory, and filename.  You are expected to initialize the
  8960. return strings to reasonable values beforehand (1 for drive, 64
  8961. for subdirectory, 12 for filename).  If the filespec may be
  8962. invalid, you may wish to leave additional space to avoid
  8963. potentially disastrous overflows.  An alternative would be to
  8964. use ExtendFSpec beforehand to check and complete the file
  8965. specification.  This is likely to be a good approach anyway--
  8966. these two routines complement each other nicely.
  8967.  
  8968.    Drive$ = SPACE$(1)
  8969.    Subdir$ = SPACE$(64)
  8970.    File$ = SPACE$(12)
  8971.    ParseFSpec FileSpec$, Drive$, DLen%, Subdir$, SLen%,
  8972.       File$, FLen%
  8973.    Drive$ = LEFT$(Drive$, DLen%)
  8974.    Subdir$ = LEFT$(Subdir$, SLen%)
  8975.    File$ = LEFT$(File$, FLen%)
  8976.  
  8977. FileSpec$   file specification
  8978. -------
  8979. Drive$      drive letter (init to 1+)
  8980. DLen%       length of Drive$
  8981. SubDir$     subdirectory (init to 64+)
  8982. SLen%       length of Subdir$
  8983. File$       file name (init to 12+)
  8984. FLen%       length of File$
  8985.  
  8986. Name  : PatchDone            (Patch Done)
  8987. Class : Disk
  8988. Level : DOS
  8989.  
  8990. This routine closes the file opened by FindPatch.  You must use
  8991. PatchDone when you are finished patching the file.
  8992.  
  8993. Routines in this set include FindPatch, SetPatch, and PatchDone.
  8994.  
  8995.    PatchDone
  8996.  
  8997. Name  : PCDat$               (PC Date)
  8998. Class : Equipment
  8999. Level : Clone
  9000.  
  9001. The PCDat$ routine tells you the date of the BIOS ROM chip.
  9002. This date is not always available on some (mostly older)
  9003. clones, in which case "No Date" is returned.
  9004.  
  9005.    ROMDate$ = PCDat$
  9006.  
  9007. -------
  9008. ROMDate$   date of the BIOS ROM (xx/xx/xx).
  9009.  
  9010. Name  : PCDate               (PC Date)
  9011. Class : Equipment
  9012. Level : Clone
  9013.  
  9014. The PCDate routine tells you the date of the BIOS ROM chip.
  9015. This date is not always available on some (mostly older)
  9016. clones, in which case "No Date " is returned.  See also PCDat,
  9017. a function version of this routine.
  9018.  
  9019.    ROMDate$ = SPACE$(8)
  9020.    PCDate ROMDate$
  9021.  
  9022. -------
  9023. ROMDate$   date of the BIOS ROM (xx/xx/xx).  Init to 8+ chars.
  9024.  
  9025. Name  : PCType               (PC Type)
  9026. Class : Equipment
  9027. Level : Clone
  9028.  
  9029. This routine returns the machine I.D. code.  This code may not
  9030. be one of the listed values for some (mostly older) clones, but
  9031. the following is usually correct:
  9032.  
  9033.    I.D.  ....Machine....
  9034.    255   PC or XT
  9035.    254   XT
  9036.    253   PCjr
  9037.    252   PC AT
  9038.    251   XT
  9039.    250   PS/2 Model 30
  9040.    249   PC Convertible
  9041.    248   PS/2 Model 70 or 80
  9042.    154   Compaq Portable
  9043.     45   Compaq Portable
  9044.  
  9045. Note that, for identification purposes, a PC and XT are
  9046. essentially the same. The XT is simply a PC with an auto-boot
  9047. hard drive.  New I.D. numbers come out more or less at random
  9048. from IBM, although they aren't as capricious about it as they
  9049. used to be.  It is useful to identify Compaq Portables as
  9050. separate from PCs because those machines had an unusual
  9051. display, which acts like a CGA but has the resolution (in text
  9052. modes) of an MDA.  Hence, the cursor size of a Compaq Portable
  9053. is MDA-sized in text mode, but CGA-sized in graphics modes,
  9054. even though ordinary tests will tell your program that a CGA is
  9055. attached.  If you intend to alter the cursor size, this is an
  9056. important distinction, since the Compaq Portable was a great
  9057. success and is still in wide use.  Current Compaq machines,
  9058. like most other clones, follow the standard IBM I.D. codes.
  9059.  
  9060. See also PCType2, a function version of this routine.
  9061.  
  9062.    PCType MachineID%
  9063.  
  9064. -------
  9065. MachineID%   type of computer
  9066.  
  9067. Name  : PCType2%             (PC Type)
  9068. Class : Equipment
  9069. Level : Clone
  9070.  
  9071. This routine returns the machine I.D. code.  This code may not
  9072. be one of the listed values for some (mostly older) clones, but
  9073. the following is usually correct:
  9074.    I.D.  ....Machine....
  9075.    255   PC or XT
  9076.    254   XT
  9077.    253   PCjr
  9078.    252   PC AT
  9079.    251   XT
  9080.    250   PS/2 Model 30
  9081.    249   PC Convertible
  9082.    248   PS/2 Model 70 or 80
  9083.    154   Compaq Portable
  9084.     45   Compaq Portable
  9085.  
  9086. Note that, for identification purposes, a PC and XT are
  9087. essentially the same. The XT is simply a PC with an auto-boot
  9088. hard drive.  New I.D. numbers come out more or less at random
  9089. from IBM, although they aren't as capricious about it as they
  9090. used to be.  It is useful to identify Compaq Portables as
  9091. separate from PCs because those machines had an unusual
  9092. display, which acts like a CGA but has the resolution (in text
  9093. modes) of an MDA.  Hence, the cursor size of a Compaq Portable
  9094. is MDA-sized in text mode, but CGA-sized in graphics modes,
  9095. even though ordinary tests will tell your program that a CGA is
  9096. attached.  If you intend to alter the cursor size, this is an
  9097. important distinction, since the Compaq Portable was a great
  9098. success and is still in wide use.  Current Compaq machines,
  9099. like most other clones, follow the standard IBM I.D. codes.
  9100.  
  9101.    MachineID% = PCType2%
  9102.  
  9103. -------
  9104. MachineID%   type of computer
  9105.  
  9106. Name  : Phone2Num&           (Phone# to Number)
  9107. Class : Numeric String
  9108. Level : Any
  9109.  
  9110. This function converts a U.S. or Canadian phone number from
  9111. string form to a long integer.  It accepts phone numbers of 4,
  9112. 7, 10, or 11 digits.  If there are 11 digits, the first digit
  9113. must be a 1.  Non-numeric characters are ignored so that
  9114. formatted phone numbers can be used.  If the phone number is of
  9115. the wrong length or otherwise does not appear to be valid, -1
  9116. is returned; otherwise, the result is a long integer which
  9117. represents the phone number in a format that can be decoded by
  9118. Num2Phone$.
  9119.  
  9120. This function will accept alphabetic phone numbers and convert
  9121. them to their numeric equivalents.
  9122.  
  9123. Since it only takes 4 bytes to store a long integer, as opposed
  9124. to 7 to 10 or more for the usual alphanumeric form, this can be
  9125. considered a compression routine as well as a validation
  9126. routine.  At worst, for 4-digit phone numbers, it is exactly as
  9127. efficient as a character representation.  For 7 or 10-digit
  9128. phone numbers, it roughly doubles your storage space.
  9129.  
  9130. A few words on how checking is done: obviously, there is no way
  9131. to tell whether a number is in use or is in fact whoever you
  9132. wished to call.  However, there are certain regularities to
  9133. numeric phone numbers which can be used to detect blatantly
  9134. false numbers.  Alphabetic phone numbers do not include all the
  9135. letters of the alphabet, either.  This routine will check for
  9136. any obvious peculiarities and warn you accordingly.
  9137.  
  9138. NOTE that this function will handle current US-style phone
  9139. numbers.  It expects the first three digits of a 10-digit phone
  9140. number to represent an area code, where the middle digit of the
  9141. area code is always either zero or one.  This convention is
  9142. expected to change as of 1994 or so, whereupon this function
  9143. will no longer be reliable <sigh>.
  9144.  
  9145.    Result& = Phone2Num&(PhoneNumber$)
  9146.  
  9147. PhoneNumber$    phone number (may be formatted)
  9148. -------
  9149. Result&         encoded phone number (-1 if invalid number)
  9150.  
  9151. Name  : PrintBox             (Print a Box)
  9152. Class : Display
  9153. Level : Clone
  9154.  
  9155. This routine displays a box, filled with a character or string
  9156. of your choice.  Only text modes are supported.
  9157.  
  9158.    PrintBox St$, TopRow%, LftCol%, BotRow%, RhtCol%, VAttr%, _
  9159.      Page%, Fast%
  9160.  
  9161. St$        string to fill box with (one or more chars)
  9162. TopRow%    top row of box
  9163. LftCol%    left column of box
  9164. BotRow%    bottom row of box
  9165. RhtCol%    right column of box
  9166. VAttr%     color/attribute of box (see CalcAttr)
  9167. Page%      display page (for color adapters)
  9168. Fast%      display speed (-1 fast, 0 slow for old CGAs)
  9169.  
  9170. Name  : PrinterInit          (Printer Initialize)
  9171. Class : Printer
  9172. Level : BIOS
  9173.  
  9174. This routine initializes a printer in the same way as if the
  9175. computer had been rebooted.
  9176.  
  9177. Note that this will not work on serial printers, even if the
  9178. MODE command was used to redirect the port.  It works at the
  9179. BIOS level, so it doesn't know about any fooling around DOS
  9180. does.
  9181.  
  9182.    PrinterInit Port%
  9183.  
  9184. Port%         parallel port number (1-3)
  9185.  
  9186. Name  : PrinterReady%        (Printer Ready)
  9187. Class : Printer
  9188. Level : BIOS
  9189.  
  9190. This function lets you know if a printer is ready.  It checks
  9191. to make sure that the specified port exists, then makes sure a
  9192. printer is connected, turned on, and has paper in it.
  9193.  
  9194. Note that this will not work on serial printers, even if the
  9195. MODE command was used to redirect the port.  It works at the
  9196. BIOS level, so it doesn't know about any fooling around DOS
  9197. does.
  9198.  
  9199.    Ready% = PrinterReady%(Port%)
  9200.  
  9201. Port%         parallel port number (1-3)
  9202. -------
  9203. Ready%        whether there's a printer ready at that port
  9204.  
  9205. Name  : PrintFile            (Print File)
  9206. Class : Printer
  9207. Level : DOS
  9208.  
  9209. This routine sends a file to the printer.  It does not
  9210. paginate, spool, or anything else fancy.  The LPT1 or PRN
  9211. device is used by default, although you can change this using
  9212. the PrtSwap routine.
  9213.  
  9214. The predefined device handle for stdprn is used, so don't use
  9215. FClose1 to free that handle if you expect to use this routine.
  9216. The results could be nasty.
  9217.  
  9218.    PrintFile FileName$, ErrCode%
  9219.  
  9220. FileName$     name of the file to print
  9221. -------
  9222. ErrCode%      whether there was an error (0 no, else DOS Error)
  9223.  
  9224. Name  : PrintScreen          (Print Screen)
  9225. Class : Display / Printer
  9226. Level : BIOS
  9227.  
  9228. Just like pressing the PrtSc/PrintScrn key on the keyboard,
  9229. this routine sends the contents of the display to the printer.
  9230. It is mostly designed for text modes, but use of the GRAPHICS
  9231. TSR provided with DOS will allow it to print out CGA graphics
  9232. displays as well.  For some reason, the GRAPHICS utility does
  9233. not handle Hercules, EGA or VGA displays; however, alternative
  9234. utilities which provide such features may be obtained from your
  9235. local BBS.
  9236.  
  9237.    PrintScreen
  9238.  
  9239. Name  : Processor            (Processor)
  9240. Class : Equipment
  9241. Level : Any
  9242.  
  9243. Processor returns the type of processor (CPU) installed.
  9244.  
  9245. Results are returned as follows:
  9246.  
  9247.    0    NEC V20
  9248.    1    8088 or 8086
  9249.    2    80186
  9250.    3    80286
  9251.    4    80386
  9252.    5    80486
  9253.  
  9254. Note that, for most practical purposes, a NEC V20 works just
  9255. like an 80186.
  9256.  
  9257.    Processor ProcType%
  9258.  
  9259. -------
  9260. ProcType%    type of CPU (see above)
  9261.  
  9262. Name  : Processor2%          (Processor)
  9263. Class : Equipment
  9264. Level : Any
  9265.  
  9266. Processor returns the type of processor (CPU) installed.
  9267.  
  9268. Results are returned as follows:
  9269.  
  9270.    0    NEC V20
  9271.    1    8088 or 8086
  9272.    2    80186
  9273.    3    80286
  9274.    4    80386
  9275.    5    80486
  9276.  
  9277. Note that, for most practical purposes, a NEC V20 works just
  9278. like an 80186.
  9279.  
  9280.    ProcType% = Processor2%
  9281.  
  9282. -------
  9283. ProcType%    type of CPU (see above)
  9284.  
  9285. Name  : PrtSc                (Print Screen key)
  9286. Class : Input / Printer
  9287. Level : BIOS
  9288.  
  9289. This routine allows you to disable the "print screen" key.
  9290. This only affects the keyboard, not the PrintScreen routine in
  9291. PBClone.
  9292.  
  9293. When the print screen key is disabled, you can detect whether
  9294. it was pressed using the GetPrtSc% function.  This provides a
  9295. way of using the key for your own purposes.
  9296.  
  9297. If you disable the print screen key, be sure to enable it again
  9298. before your program ends.  Otherwise, the print screen key will
  9299. be left in an undefined state, probably causing the computer to
  9300. crash when it is next pressed.
  9301.  
  9302.    PrtSc Enable%
  9303.  
  9304. Enable%   whether print screen key should be enabled (0 if no)
  9305.  
  9306. Name  : PrtSwap              (Printer Swap)
  9307. Class : Printer
  9308. Level : Clone
  9309.  
  9310. It's handy to use LPRINT, but it isn't always practical.
  9311. LPRINT only works on the first printer available (PRN or
  9312. LPT1).  With this routine, it doesn't matter.  PrtSwap allows
  9313. you to swap any two printer ports.
  9314.  
  9315. Note that it's a good idea to swap the ports back to their
  9316. original locations before exiting your program.  You could
  9317. cause major confusion otherwise!
  9318.  
  9319.    PrtSwap Port1%, Port2%
  9320.  
  9321. Port1%    number of the first port (1-3)
  9322. Port2%    number of the second port (1-3)
  9323.  
  9324. Name  : PSortD               (Pointer Sort Double precision)
  9325. Class : Array management
  9326. Level : Any
  9327.  
  9328. This routine sorts the elements in a double precision array...
  9329. well, actually, it doesn't change the position of anything in
  9330. the double precision array.  It sorts the array using a set of
  9331. pointers to the array.  You can then use the pointers to refer
  9332. to the array or to re-order the array yourself.
  9333.  
  9334. Why bother with pointers?  Well, it's a lot faster than sorting
  9335. the numbers directly, since less information has to be
  9336. swapped.  It has another major advantage, though-- it allows
  9337. you to sort an array without losing track of how it corresponds
  9338. to any related arrays.
  9339.  
  9340. The array is assumed to start at element 1.  You may specify
  9341. the last element in the array, allowing you to sort only part
  9342. of an array if you like.
  9343.  
  9344. The pointer array must be initialized so that each element is
  9345. equal to its index.  Either use InitPtr or do:
  9346.    FOR tmp% = 1 TO Elements%
  9347.       Ptr%(tmp%) = tmp%
  9348.    NEXT
  9349.  
  9350. After this routine, you can access the sorted array via the
  9351. pointer array. For instance, to print out a sorted double
  9352. precision array, you'd use:
  9353.    FOR tmp% = 1 TO Elements%
  9354.       PRINT Array#(Ptr%(tmp%))
  9355.    NEXT
  9356.  
  9357. If you would like the results to be last-to-first, rather than
  9358. first-to-last, just call ReverseI to reverse the pointer array
  9359. (after this routine).
  9360.  
  9361.    PSortD Ptr%(), Array#(), Elements%
  9362.  
  9363. Ptr%()      pointers to array to be sorted
  9364. Array#()    array to be sorted
  9365. Elements%   number of elements in array
  9366. -------
  9367. Ptr%()      pointers which allow accessing array in sorted order
  9368.  
  9369. Name  : PSortI               (Pointer Sort Integer)
  9370. Class : Array management
  9371. Level : Any
  9372.  
  9373. This routine sorts the elements in an integer array... well,
  9374. actually, it doesn't change the position of anything in the
  9375. integer array.  It sorts the array using a set of pointers to
  9376. the array.  You can then use the pointers to refer to the array
  9377. or to re-order the array yourself.
  9378.  
  9379. Why bother with pointers?  It has a major advantage-- it allows
  9380. you to sort an array without losing track of how it corresponds
  9381. to any related arrays.
  9382.  
  9383. The array is assumed to start at element 1.  You may specify
  9384. the last element in the array, allowing you to sort only part
  9385. of an array if you like.
  9386.  
  9387. The pointer array must be initialized so that each element is
  9388. equal to its index.  Either use InitPtr or do:
  9389.    FOR tmp% = 1 TO Elements%
  9390.       Ptr%(tmp%) = tmp%
  9391.    NEXT
  9392.  
  9393. After this routine, you can access the sorted array via the
  9394. pointer array. For instance, to print out a sorted integer
  9395. array, you'd use:
  9396.    FOR tmp% = 1 TO Elements%
  9397.       PRINT Array%(Ptr%(tmp%))
  9398.    NEXT
  9399.  
  9400. If you would like the results to be last-to-first, rather than
  9401. first-to-last, just call ReverseI to reverse the pointer array
  9402. (after this routine).
  9403.  
  9404.    PSortI Ptr%(), Array%(), Elements%
  9405.  
  9406. Ptr%()      pointers to array to be sorted
  9407. Array%()    array to be sorted
  9408. Elements%   number of elements in array
  9409. -------
  9410. Ptr%()      pointers which allow accessing array in sorted order
  9411.  
  9412. Name  : PSortL               (Pointer Sort Long integer)
  9413. Class : Array management
  9414. Level : Any
  9415.  
  9416. This routine sorts the elements in a long integer array...
  9417. well, actually, it doesn't change the position of anything in
  9418. the long integer array.  It sorts the array using a set of
  9419. pointers to the array.  You can then use the pointers to refer
  9420. to the array or to re-order the array yourself.
  9421.  
  9422. Why bother with pointers?  Well, it's a lot faster than sorting
  9423. the numbers directly, since less information has to be
  9424. swapped.  It has another major advantage, though-- it allows
  9425. you to sort an array without losing track of how it corresponds
  9426. to any related arrays.
  9427.  
  9428. The array is assumed to start at element 1.  You may specify
  9429. the last element in the array, allowing you to sort only part
  9430. of an array if you like.
  9431.  
  9432. The pointer array must be initialized so that each element is
  9433. equal to its index.  Either use InitPtr or do:
  9434.    FOR tmp% = 1 TO Elements%
  9435.       Ptr%(tmp%) = tmp%
  9436.    NEXT
  9437.  
  9438. After this routine, you can access the sorted array via the
  9439. pointer array. For instance, to print out a sorted long integer
  9440. array, you'd use:
  9441.    FOR tmp% = 1 TO Elements%
  9442.       PRINT Array&(Ptr%(tmp%))
  9443.    NEXT
  9444.  
  9445. If you would like the results to be last-to-first, rather than
  9446. first-to-last, just call ReverseI to reverse the pointer array
  9447. (after this routine).
  9448.  
  9449.    PSortL Ptr%(), Array&(), Elements%
  9450.  
  9451. Ptr%()      pointers to array to be sorted
  9452. Array&()    array to be sorted
  9453. Elements%   number of elements in array
  9454. -------
  9455. Ptr%()      pointers which allow accessing array in sorted order
  9456.  
  9457. Name  : PSortS               (Pointer Sort Single precision)
  9458. Class : Array management
  9459. Level : Any
  9460.  
  9461. This routine sorts the elements in a single precision array...
  9462. well, actually, it doesn't change the position of anything in
  9463. the single precision array.  It sorts the array using a set of
  9464. pointers to the array.  You can then use the pointers to refer
  9465. to the array or to re-order the array yourself.
  9466.  
  9467. Why bother with pointers?  Well, it's a lot faster than sorting
  9468. the numbers directly, since less information has to be
  9469. swapped.  It has another major advantage, though-- it allows
  9470. you to sort an array without losing track of how it corresponds
  9471. to any related arrays.
  9472.  
  9473. The array is assumed to start at element 1.  You may specify
  9474. the last element in the array, allowing you to sort only part
  9475. of an array if you like.
  9476.  
  9477. The pointer array must be initialized so that each element is
  9478. equal to its index.  Either use InitPtr or do:
  9479.    FOR tmp% = 1 TO Elements%
  9480.       Ptr%(tmp%) = tmp%
  9481.    NEXT
  9482.  
  9483. After this routine, you can access the sorted array via the
  9484. pointer array. For instance, to print out a sorted single
  9485. precision array, you'd use:
  9486.    FOR tmp% = 1 TO Elements%
  9487.       PRINT Array!(Ptr%(tmp%))
  9488.    NEXT
  9489.  
  9490. If you would like the results to be last-to-first, rather than
  9491. first-to-last, just call ReverseI to reverse the pointer array
  9492. (after this routine).
  9493.  
  9494.    PSortS Ptr%(), Array!(), Elements%
  9495.  
  9496. Ptr%()      pointers to array to be sorted
  9497. Array!()    array to be sorted
  9498. Elements%   number of elements in array
  9499. -------
  9500. Ptr%()      pointers which allow accessing array in sorted order
  9501.  
  9502. Name  : PSortSt              (Pointer Sort String)
  9503. Class : Array management
  9504. Level : Any
  9505.  
  9506. This routine sorts the elements in a string array... well,
  9507. actually, it doesn't change the position of anything in the
  9508. string array.  It sorts the array using a set of pointers to
  9509. the array.  You can then use the pointers to refer to the array
  9510. or to re-order the array yourself.
  9511.  
  9512. Why bother with pointers?  Well, it's a lot faster than sorting
  9513. the strings directly, since less information has to be
  9514. swapped.  It has another major advantage, though-- it allows
  9515. you to sort an array without losing track of how it corresponds
  9516. to any related arrays.  For instance, if you have one array
  9517. holding names and another holding phone numbers, this allows
  9518. you to sort on names without losing track of which phone
  9519. numbers are which.
  9520.  
  9521. The array is assumed to start at element 1.  You may specify
  9522. the last element in the array, allowing you to sort only part
  9523. of an array if you like.  You can also specify whether the
  9524. capitalization of letters in a string should matter for sorting
  9525. purposes.
  9526.  
  9527. The pointer array must be initialized so that each element is
  9528. equal to its index.  Either use InitPtr or do:
  9529.    FOR tmp% = 1 TO Elements%
  9530.       Ptr%(tmp%) = tmp%
  9531.    NEXT
  9532.  
  9533. After this routine, you can access the sorted array via the
  9534. pointer array. For instance, to print out a sorted string
  9535. array, you'd use:
  9536.    FOR tmp% = 1 TO Elements%
  9537.       PRINT Array$(Ptr%(tmp%))
  9538.    NEXT
  9539.  
  9540. If you would like the results to be last-to-first, rather than
  9541. first-to-last, just call ReverseI to reverse the pointer array
  9542. (after this routine).
  9543.  
  9544.    PSortSt Ptr%(), Array$(), Elements%, CapsCount%
  9545.  
  9546. Ptr%()      pointers to array to be sorted
  9547. Array$()    array to be sorted
  9548. CapsCount%  use 0 if uppercase/lowercase distinctions don't matter
  9549. Elements%   number of elements in array
  9550. -------
  9551. Ptr%()      pointers which allow accessing array in sorted order
  9552.  
  9553. Name  : PutScreen            (Put Screen)
  9554. Class : Display
  9555. Level : Clone
  9556.  
  9557. This routine restores a portion of the display (which was saved
  9558. to an array by DGetScreen or GetScreen) to the screen.  Only
  9559. text modes are supported. If your program uses multiple display
  9560. pages, you can put the image onto any of those pages.  A
  9561. special "slow" mode is supported for the CGA, to prevent
  9562. flickering (a problem only with some CGAs).
  9563.  
  9564. If you wish to restore the entire screen, you may find ScrRest
  9565. easier (see).
  9566.  
  9567.    PutScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  9568.  
  9569. Array%()   array from which to restore the image
  9570. TRow%      top row of the desired screen area
  9571. LCol%      left column of the desired screen area
  9572. BRow%      bottom row of the desired screen area
  9573. RCol%      right column of the desired screen area
  9574. Page%      page on which to restore the display
  9575. Fast%      whether to use fast mode (0 no)
  9576.  
  9577. Name  : QPrint               (Quick Print)
  9578. Class : Display
  9579. Level : Clone
  9580.  
  9581. This is a replacement for the PRINT statement.  It is less
  9582. flexible in that it does not move the cursor or interpret
  9583. control codes, and because it uses the color that is already on
  9584. the screen instead of a specified color value. It also works
  9585. only in text modes.
  9586.  
  9587. In exchange, QPrint gives you much faster display speeds.
  9588.  
  9589. See also XQPrint, which is a bit more flexible (and somewhat
  9590. slower).
  9591.  
  9592. The results of this routine are not redirectable by DOS.
  9593.  
  9594.    QPrint St$, Row%, Column%, Page%, Fast%
  9595.  
  9596. St$        text to display
  9597. Row%       starting row
  9598. Column%    starting column
  9599. Page%      page on which to display
  9600. Fast%      whether to use fast mode (0 no)
  9601.  
  9602. Name  : Rand%                (Random number)
  9603. Class : Numeric
  9604. Level : Clone
  9605.  
  9606. This is a pseudo-random number function.  It returns a "random"
  9607. number in a range you specify (e.g., if you pass it 10, it will
  9608. return 0-9).  The number is less random than you'd get from the
  9609. BASIC function RND, and you can't set a random number seed a la
  9610. RANDOMIZE.  There is one major advantage to Rand%, however: it
  9611. doesn't bring in BASIC's floating point support, which makes it
  9612. much faster than RND and may make your program much smaller.
  9613.  
  9614. See also RndI%, which is based on RND itself.
  9615.  
  9616.    Number% = Rand%(Range%)
  9617.  
  9618. Range%      range of desired pseudo-random number
  9619. -------
  9620. Number%     pseudo-random number from 0 to Range% - 1
  9621.  
  9622. Name  : RandFile$            (Random Filename)
  9623. Class : File
  9624. Level : DOS
  9625.  
  9626. This function returns a pseudo-random filename.  The returned
  9627. string is based on the current time, to hundredths of a second,
  9628. and will be a dollar sign followed by up to seven characters
  9629. and digits, terminated by a space.  This leaves you room to add
  9630. your own file extension, if you like.
  9631.  
  9632. The anticipated use for this function is creating temporary
  9633. files which will be used for a brief time by your program
  9634. before being deleted.  The filename returned will be rather
  9635. unlikely to conflict with any existing files.
  9636.  
  9637.    FileName$ = RandFile$
  9638.  
  9639. -------
  9640. FileName$    pseudo-random filename (e.g., "$P382227.")
  9641.  
  9642. Name  : RClickLoc            (Right Click Location)
  9643. Class : Mouse
  9644. Level : BIOS
  9645.  
  9646. This routine returns the position of the mouse cursor at the
  9647. last click of the right mouse button.  It must be used after
  9648. one of the routines which check for mouse clicks, as they
  9649. maintain the click position.  These routines include GetKey,
  9650. GetKey3, MMClick, and MMClick3.
  9651.  
  9652. The values returned are in graphics coordinates (virtual
  9653. coordinates for SCREEN 0 through SCREEN 2, due to the nature of
  9654. the mouse driver).
  9655.  
  9656.    RClickLoc X%, Y%
  9657.  
  9658. -------
  9659. X%         horizontal coordinate at last right click
  9660. Y%         vertical coordinate at last right click
  9661.  
  9662. Name  : ReadBitF             (Read Bit Field)
  9663. Class : Numeric
  9664. Level : Any
  9665.  
  9666. This routine allows you to get an element of a virtual array.
  9667. The actual array can be any numeric type, as it is just being
  9668. used as a storage area. The virtual array is composed of
  9669. numbers of a bit length that you specify (1-8).  This provides
  9670. efficient storage for numbers which have a limited range.
  9671.  
  9672. See also WriteBitF.
  9673.  
  9674.    ReadBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  9675.  
  9676. DSeg%        segment of actual array
  9677. DOfs%        offset of actual array
  9678. ElementNr&   virtual element number (starts at 0)
  9679. BitLen%      bits per virtual element (1-8)
  9680. -------
  9681. Value%       result (0-255 or less, depending on BitLen%)
  9682.  
  9683. Name  : ReadScreen           (Read Screen into string)
  9684. Class : Display
  9685. Level : Clone
  9686.  
  9687. This routine reads a string off the screen.  The screen must be
  9688. in text mode.
  9689.  
  9690. See also GetLine, which reads a row of text from a virtual or
  9691. saved screen.
  9692.  
  9693.    Result$ = SPACE$(10)    ' init to desired length
  9694.    ReadScreen Result$, Row%, Column%, Page%
  9695.  
  9696. Result$      result string: init to desired length first
  9697. Row%         row (1-25, 1-43, etc [depends on screen mode])
  9698. Column%      column (1-40, 1-80, etc [depends on mode])
  9699. Page%        page (0, 0-3, etc [depends on display and mode])
  9700.  
  9701. Name  : Reboot               (Reboot)
  9702. Class : Miscellaneous
  9703. Level : Clone
  9704.  
  9705. This routine restarts the computer, just like typing
  9706. Control-Alt-Del at the keyboard.
  9707.  
  9708.    Reboot
  9709.  
  9710. Name  : Recolor              (Recolor)
  9711. Class : Display
  9712. Level : Clone
  9713.  
  9714. The Recolor routine changes all text in one color to another
  9715. color.  It works only in text modes.  The colors are specified
  9716. as attributes (see CalcAttr).
  9717.  
  9718.    Recolor OldAttr%, NewAttr%
  9719.  
  9720. OldAttr%   color to be changed
  9721. NewAttr%   color to which to change
  9722.  
  9723. Name  : RecolorArea          (Recolor Area)
  9724. Class : Display
  9725. Level : Clone
  9726.  
  9727. The RecolorArea routine changes a specified area of the screen
  9728. to a specified color.  It works only in text modes.  The color
  9729. is specified as an attribute (see CalcAttr).
  9730.  
  9731. See also HiLite, which provides an easier way of highlighting
  9732. between two columns on a single row.
  9733.  
  9734.    RecolorArea TRow%, LCol%, BRow%, RCol%, VAttr%, Page%, Fast%
  9735.  
  9736. TRow%       top row of area to recolor
  9737. LCol%       left column of area to recolor
  9738. BRow%       bottom row of area to recolor
  9739. RCol%       right column of area to recolor
  9740. VAttr%      desired color
  9741. Page%       display page (normally zero)
  9742. Fast%       whether to use fast mode (0 no)
  9743.  
  9744. Name  : RedirectIn%          (Redirect Input)
  9745. Class : Miscellaneous
  9746. Level : DOS
  9747.  
  9748. The RedirectIn% function allows you to determine whether input
  9749. has been redirected.  This lets you know whether input is
  9750. coming from the keyboard or from a file or device.
  9751.  
  9752. Input that is done by BIOS key routines (e.g., BIOSInkey) is
  9753. not affected by redirection, so if you want to support
  9754. redirection it is best to avoid such routines unless there is
  9755. something that must come from the keyboard.
  9756.  
  9757.    Redir% = RedirectIn%
  9758.  
  9759. -------
  9760. Redir%     whether input has been redirected (0 no)
  9761.  
  9762. Name  : RedirectOut%         (Redirect Output)
  9763. Class : Miscellaneous
  9764. Level : DOS
  9765.  
  9766. The RedirectOut% function allows you to determine whether
  9767. output has been redirected.  This lets you know whether output
  9768. is going to the display or to a file or device.
  9769.  
  9770. Output that is done by direct screen writes (e.g., XQPrint) is
  9771. not affected by redirection, so if you want to allow
  9772. redirection it is best to avoid such routines unless there is
  9773. something that must to go to the screen itself.
  9774.  
  9775.    Redir% = RedirectOut%
  9776.  
  9777. -------
  9778. Redir%     whether output has been redirected (0 no)
  9779.  
  9780. Name  : Rename               (Rename file)
  9781. Class : Disk
  9782. Level : DOS
  9783.  
  9784. This routine allows you to rename an ordinary file.  See also
  9785. RenSub.
  9786.  
  9787.    Rename CurrentName$, NewName$, ErrCode%
  9788.  
  9789. CurrentName$   current name of the file
  9790. NewName$       desired name of the file
  9791. -------
  9792. ErrCode%       error code: 0 if no error, else DOS Error
  9793.  
  9794. Name  : RenSub               (Rename Subdirectory)
  9795. Class : Disk
  9796. Level : DOS
  9797.  
  9798. This routine provides a service that was inexplicably left out
  9799. of the DOS command shell.  It allows you to rename a
  9800. subdirectory.
  9801.  
  9802. Note that renaming a subdirectory is only possible using
  9803. old-style FCB file handling.  This means that the subdirectory
  9804. which you specify must be in the current directory (the routine
  9805. doesn't really understand subdirectories per se, but treats
  9806. them like any other file).  In this implementation, no drive
  9807. specification is allowed either.  Finally, if there is an
  9808. error, the error code may be a simple "255" instead of a useful
  9809. disk error number.
  9810.  
  9811.    RenSub CurrentSub$, NewSub$, ErrCode%
  9812.  
  9813. CurrentSub$   current name of the subdirectory
  9814. NewSub$       desired name of the subdirectory
  9815. -------
  9816. ErrCode%      error code: 0 if no error, else DOS Error
  9817.  
  9818. Name  : Replace              (Replace character)
  9819. Class : String
  9820. Level : Any
  9821.  
  9822. This routine replaces all occurrences of a given character in a
  9823. string with another character.
  9824.  
  9825.    Replace St$, CurCh$, NewCh$
  9826.  
  9827. St$         string to process
  9828. CurCh$      character to be replaced
  9829. NewCh$      character to replace with
  9830. -------
  9831. St$         processed string
  9832.  
  9833. Name  : ReplaceString        (Replace String)
  9834. Class : String
  9835. Level : Any
  9836.  
  9837. This routine replaces all occurrences of a given substring
  9838. within a string with another substring.  The substrings may be
  9839. of any length.
  9840.  
  9841. An error code will be returned if the string to search for is
  9842. null.
  9843.  
  9844.    ReplaceString St$, Old$, New$, Found%, ErrCode%
  9845.  
  9846. St$         string to process
  9847. Old$        substring to be replaced
  9848. New$        substring to replace with
  9849. -------
  9850. Found%      whether a replacement was done (0 if no)
  9851. ErrCode%    whether there was an error (0 if no)
  9852.  
  9853. Name  : Retries              (Retries)
  9854. Class : Disk
  9855. Level : DOS 3.1+
  9856.  
  9857. This routine allows you to adjust the handling of file-sharing
  9858. errors.  When such an error occurs, DOS normally retries 3
  9859. times, with a wait of 1 between tries.  This allows temporary
  9860. conditions, such as someone else using the file you want to
  9861. access, to clear up.  In many cases, though, you may want to
  9862. change this delay.  A shorter delay will improve response time,
  9863. allowing your program to handle the error more quickly.  A
  9864. longer delay may be more suited for a busy network, allowing
  9865. the request to proceed after a reasonable waiting period.
  9866.  
  9867. The delay period between each retry is unfortunately
  9868. machine-dependent, i.e., you will need larger delays on faster
  9869. machines to achieve the same effect. This can only be
  9870. considered a flaw in DOS.
  9871.  
  9872. Note that shorter waiting periods will improve response time
  9873. for your program, but may adversely affect the network.
  9874. Normally, you should use the longest waiting period with which
  9875. you feel comfortable.
  9876.  
  9877.    Retries Times%, WaitTime%
  9878.  
  9879. Times%     # of times to retry if file-sharing violation occurs
  9880. WaitTime%  amount of time to delay between retries
  9881.  
  9882. Name  : Reverse              (Reverse)
  9883. Class : String
  9884. Level : Any
  9885.  
  9886. This little fellow reverses the order of the characters in a
  9887. string.  It is one of the vital components of RInstr, but other
  9888. than that I see no real use for it.  On the other hand, George
  9889. Boole thought that Boolean logic was of solely theoretical
  9890. interest, and yet without it there would be no computers. I
  9891. leave it to you to find the earth-shattering possibilities of
  9892. Reverse!
  9893.  
  9894.    Reverse St$
  9895.  
  9896. St$      string to be reversed
  9897. -------
  9898. St$      reversed string
  9899.  
  9900. Name  : ReverseD             (Reverse Double precision array)
  9901. Class : Array management
  9902. Level : Any
  9903.  
  9904. This routine reverses the elements in an array of
  9905. double-precision numbers. This will probably be most useful for
  9906. an array sorted by SortD, in case you want the numbers to go
  9907. from largest to smallest.
  9908.  
  9909. The array is assumed to start at element 1.  You may specify
  9910. the last element in the array, allowing you to reverse only
  9911. part of an array if you like.
  9912.  
  9913.    ReverseD Array#(), Elements%
  9914.  
  9915. Array#()    array to be reversed
  9916. Elements%   number of elements in array
  9917. -------
  9918. Array#()    reversed array
  9919.  
  9920. Name  : ReverseI             (Reverse Integer array)
  9921. Class : Array management
  9922. Level : Any
  9923.  
  9924. This routine reverses the elements in an array of integers.
  9925. This will probably be most useful for an array sorted by SortI,
  9926. or a pointer array used in PSortD, PSortI, PSortL, PSortS, or
  9927. PSortSt, in case you want the values to go from largest to
  9928. smallest.
  9929.  
  9930. The array is assumed to start at element 1.  You may specify
  9931. the last element in the array, allowing you to reverse only
  9932. part of an array if you like.
  9933.  
  9934.    ReverseI Array%(), Elements%
  9935.  
  9936. Array%()    array to be reversed
  9937. Elements%   number of elements in array
  9938. -------
  9939. Array%()    reversed array
  9940.  
  9941. Name  : ReverseL             (Reverse Long integer array)
  9942. Class : Array management
  9943. Level : Any
  9944.  
  9945. This routine reverses the elements in an array of long
  9946. integers.  This will probably be most useful for an array
  9947. sorted by SortL, in case you want the values to go from largest
  9948. to smallest.
  9949.  
  9950. The array is assumed to start at element 1.  You may specify
  9951. the last element in the array, allowing you to reverse only
  9952. part of an array if you like.
  9953.  
  9954.    ReverseL Array&(), Elements%
  9955.  
  9956. Array&()    array to be reversed
  9957. Elements%   number of elements in array
  9958. -------
  9959. Array&()    reversed array
  9960.  
  9961. Name  : ReverseS             (Reverse Single precision array)
  9962. Class : Array management
  9963. Level : Any
  9964.  
  9965. This routine reverses the elements in an array of
  9966. single-precision numbers. This will probably be most useful for
  9967. an array sorted by SortS, in case you want the numbers to go
  9968. from largest to smallest.
  9969.  
  9970. The array is assumed to start at element 1.  You may specify
  9971. the last element in the array, allowing you to reverse only
  9972. part of an array if you like.
  9973.  
  9974.    ReverseS Array!(), Elements%
  9975.  
  9976. Array!()    array to be reversed
  9977. Elements%   number of elements in array
  9978. -------
  9979. Array!()    reversed array
  9980.  
  9981. Name  : ReverseSt            (Reverse String array)
  9982. Class : Array management
  9983. Level : Any
  9984.  
  9985. This routine reverses the elements in a string array.  This
  9986. will probably be most useful for an array sorted by SortSt, in
  9987. case you want the strings to be in reverse-alphabetical order.
  9988.  
  9989. The array is assumed to start at element 1.  You may specify
  9990. the last element in the array, allowing you to reverse only
  9991. part of an array if you like.
  9992.  
  9993.    ReverseSt Array$(), Elements%
  9994.  
  9995. Array$()    array to be reversed
  9996. Elements%   number of elements in array
  9997. -------
  9998. Array$()    reversed array
  9999.  
  10000. Name  : RInstr               (Reverse INSTR)
  10001. Class : String
  10002. Level : Any
  10003.  
  10004. Like INSTR, this routine tells you the position of a substring
  10005. within a string.  A "reverse" search is used, however-- whereas
  10006. INSTR tells you the first match, RInstr tells you the last
  10007. match.  Similarly, whereas INSTR will tell you that a null
  10008. search string matches the main string at the first position,
  10009. RInstr will match on the last position.  Of course, most of the
  10010. time you won't be searching for a null string!
  10011.  
  10012.    RInstr MainSt$, SeekSt$, Posn%
  10013.  
  10014. MainSt$    string to search
  10015. SeekSt$    string for which to search
  10016. -------
  10017. Posn%      position of substring within main string (0 no match)
  10018.  
  10019. Name  : RndI%                (Random Integer)
  10020. Class : Numeric
  10021. Level : Any
  10022.  
  10023. This function provides a shell around the BASIC function, RND.
  10024. It returns a "random" number in a range you specify (e.g., if
  10025. you pass it 10, it will return 0-9).
  10026.  
  10027. See also Rand%, which is entirely independent of RND.
  10028.  
  10029.    Number% = RndI%(Range%)
  10030.  
  10031. Range%      range of desired pseudo-random number
  10032. -------
  10033. Number%     pseudo-random number from 0 to Range% - 1
  10034.  
  10035. Name  : RolSt                (Rotate Left String of bits)
  10036. Class : String
  10037. Level : Any
  10038.  
  10039. This routine rotates the bits in a string left by a desired
  10040. amount.  This may be helpful for manupulating strings
  10041. containing bit flags, images, et al.
  10042.  
  10043.    RolSt St$, Count%
  10044.  
  10045. St$       string to rotate left
  10046. Count%    bits by which to rotate
  10047. -------
  10048. St$       rotated string
  10049.  
  10050. Name  : RorSt                (Rotate Right String of bits)
  10051. Class : String
  10052. Level : Any
  10053.  
  10054. This routine rotates the bits in a string right by a desired
  10055. amount.  This may be helpful for manupulating strings
  10056. containing bit flags, images, et al.
  10057.  
  10058.    RorSt St$, Count%
  10059.  
  10060. St$       string to rotate right
  10061. Count%    bits by which to rotate
  10062. -------
  10063. St$       rotated string
  10064.  
  10065. Name  : RotateL              (Rotate Left)
  10066. Class : Numeric
  10067. Level : Any
  10068.  
  10069. This routine rotates the bits in an integer left by a desired
  10070. amount.
  10071.  
  10072.    RotateL Value%, Count%
  10073.  
  10074. Value%    number to rotate left
  10075. Count%    bits by which to rotate
  10076. -------
  10077. Value%    rotated number
  10078.  
  10079. Name  : RotateLL             (Rotate Left Long)
  10080. Class : Numeric
  10081. Level : Any
  10082.  
  10083. This routine rotates the bits in a long integer left by a
  10084. desired amount.
  10085.  
  10086.    RotateLL Value&, Count%
  10087.  
  10088. Value&    number to rotate left
  10089. Count%    bits by which to rotate
  10090. -------
  10091. Value&    rotated number
  10092.  
  10093. Name  : RotateR              (Rotate Right)
  10094. Class : Numeric
  10095. Level : Any
  10096.  
  10097. This routine rotates the bits in an integer right by a desired
  10098. amount.
  10099.  
  10100.    RotateR Value%, Count%
  10101.  
  10102. Value%    number to rotate right
  10103. Count%    bits by which to rotate
  10104. -------
  10105. Value%    rotated number
  10106.  
  10107. Name  : RotateRL             (Rotate Right Long)
  10108. Class : Numeric
  10109. Level : Any
  10110.  
  10111. This routine rotates the bits in a long integer right by a
  10112. desired amount.
  10113.  
  10114.    RotateRL Value&, Count%
  10115.  
  10116. Value&    number to rotate right
  10117. Count%    bits by which to rotate
  10118. -------
  10119. Value&    rotated number
  10120.  
  10121. Name  : RRotate              (Right Rotate string)
  10122. Class : String
  10123. Level : Any
  10124.  
  10125. This routine rotates the characters in a string right once.
  10126. I'll admit that I haven't found a use for this myself, but
  10127. people are always coming up with new uses for things... and it
  10128. complements the more useful LRotate routine.
  10129.  
  10130. See also LRotate.
  10131.  
  10132.    RRotate St$
  10133.  
  10134. St$      string to be rotated right once
  10135. -------
  10136. St$      string after being rotated right once
  10137.  
  10138. Name  : RScroll              (Right Scroll)
  10139. Class : Display
  10140. Level : Clone
  10141.  
  10142. This routine scrolls any selected part of the display right.
  10143. You may scroll as many times as you like, or scroll "zero"
  10144. times to totally clear the selected part of the display.
  10145.  
  10146.    RScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  10147.  
  10148. TopRow%      top row of the area to scroll
  10149. LeftCol%     left column of the area to scroll
  10150. BottomRow%   top row of the area to scroll
  10151. RightCol%    left column of the area to scroll
  10152. Times%       number of times (or rows) to scroll
  10153.  
  10154. Name  : SBFreeHandles%       (SoundBlaster Free Handles)
  10155. Class : SoundBlaster
  10156. Level : BIOS
  10157.  
  10158. This function tells you how many SoundBlaster XMS handles are
  10159. available.  In order for any such handles to be available, the
  10160. SBSIM driver must have been configured to use XMS (with the
  10161. SBSIM.CFG file-- see your SoundBlaster manual for details), and
  10162. XMS memory must also be available.  XMS requires an AT-class
  10163. computer (80286 or better) with extended memory and an XMS
  10164. driver.  XMS drivers are included with current versions of
  10165. MS-DOS, Windows, and memory managers such as QEMM and 386Max.
  10166.  
  10167. Routines in this set include:
  10168.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetBuffer,
  10169.    SBGetDrivers, SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile,
  10170.    SBInitSrcXMS, SBIsFree, SBLoadXMS, SBMapMIDI, SBPause,
  10171.    SBPlay, SBResume, SBSetVolume, SBStatus%, SBStop
  10172.  
  10173.    Free% = SBFreeHandles%
  10174.  
  10175. -------
  10176. Free%      number of free SBSIM XMS handles
  10177.  
  10178. Name  : SBFreeXMS            (SoundBlaster Free XMS handle)
  10179. Class : SoundBlaster
  10180. Level : BIOS
  10181.  
  10182. This routine frees an SBSIM XMS handle that you were using.  It
  10183. returns the associated XMS memory to the system and releases
  10184. the handle.  You should always free a handle when you're done
  10185. using it, as it takes up valuable system resources.
  10186.  
  10187. See PLAYVOC.BAS for an example.
  10188.  
  10189. Routines in this set include:
  10190.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10191.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10192.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10193.    SBSetVolume, SBStatus%, SBStop
  10194.  
  10195.    SBFreeXMS Handle%
  10196.  
  10197. Handle%     SBSIM XMS handle to release
  10198.  
  10199. Name  : SBGetActive          (SoundBlaster Get Active drivers)
  10200. Class : SoundBlaster
  10201. Level : BIOS
  10202.  
  10203. This routine tells you which SoundBlaster drivers are active.
  10204. Active drivers are those involved in playing something, so this
  10205. routine tells you when a sound is finished.  You can terminate
  10206. a sound at any point with SBStop.
  10207.  
  10208. Routines in this set include:
  10209.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10210.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10211.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10212.    SBSetVolume, SBStatus%, SBStop
  10213.  
  10214. See PLAYVOC.BAS for an example.
  10215.  
  10216.    SBGetActive FM%, DskVoice%, MemVoice%, Auxiliary%, MIDI%
  10217.  
  10218. -------
  10219. FM%         whether FM driver (.CMF) is active (0 no)
  10220. DskVoice%   whether Disk Voice driver (.VOC) is active (0 no)
  10221. MemVoice%   whether Memory Voice driver (.VOC in XMS) is active
  10222. Auxiliary%  whether Auxiliary driver is active (0 no)
  10223. MIDI%       whether MIDI driver (.MID) is active (0 no)
  10224.  
  10225. Name  : SBGetDrivers         (SoundBlaster Get Drivers)
  10226. Class : SoundBlaster
  10227. Level : BIOS
  10228.  
  10229. This routine tells you which SoundBlaster drivers are installed.
  10230.  
  10231. Routines in this set include:
  10232.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10233.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10234.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10235.    SBSetVolume, SBStatus%, SBStop
  10236.  
  10237.    SBGetDrivers FM%, DskVoice%, MemVoice%, Auxiliary%, MIDI%
  10238.  
  10239. -------
  10240. FM%         whether FM driver (.CMF) is there (0 no)
  10241. DskVoice%   whether Disk Voice driver (.VOC) is there (0 no)
  10242. MemVoice%   whether Memory Voice driver (.VOC in XMS) is there
  10243. Auxiliary%  whether Auxiliary driver is there (0 no)
  10244. MIDI%       whether MIDI driver (.MID) is there (0 no)
  10245.  
  10246. Name  : SBGetVer             (SoundBlaster Get Version)
  10247. Class : SoundBlaster
  10248. Level : BIOS
  10249.  
  10250. This routine returns the version number of the SBSIM driver.
  10251.  
  10252. Routines in this set include:
  10253.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10254.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10255.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10256.    SBSetVolume, SBStatus%, SBStop
  10257.  
  10258.    SBGetVer MajorV%, MinorV%
  10259.  
  10260. -------
  10261. MajorV%     major version number (e.g., 1 for v1.20)
  10262. MinorV%     minor version number (e.g., 20 for v1.20)
  10263.  
  10264. Name  : SBGetVolume          (SoundBlaster Get Volume level)
  10265. Class : SoundBlaster
  10266. Level : BIOS
  10267.  
  10268. This routine allows you to get the volume level for specified
  10269. SBSIM devices.  Stereo volume controls are provided for SBPro
  10270. and SB-16 adapters, which support stereo.  For older mono
  10271. SoundBlasters, the "left" speaker is the active one.
  10272.  
  10273. You may select from any of the following SBSIM sound sources:
  10274.  
  10275.  Source   Description
  10276.  ------   ------------
  10277.    0      Master
  10278.    1      Voice
  10279.    2      FM
  10280.    3      CD
  10281.    4      Line in
  10282.    5      Microphone
  10283.    6      PC Speaker
  10284.  
  10285. Routines in this set include:
  10286.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10287.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10288.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10289.    SBSetVolume, SBStatus%, SBStop
  10290.  
  10291.    SBGetVolume Source%, LeftVol%, RightVol%
  10292.  
  10293. Source%     sound source
  10294. -------
  10295. LeftVol%    left volume (0-255)
  10296. RightVol%   right volume (0-255)
  10297.  
  10298. Name  : SBInitSrcFile        (SoundBlaster Init Source File)
  10299. Class : SoundBlaster
  10300. Level : BIOS
  10301.  
  10302. This routine prepares the SoundBlaster to play from a file. You
  10303. must specify which SBSIM driver to prepare.  The driver may be
  10304. any of the following:
  10305.  
  10306.  Driver   File    Description
  10307.  ------   ----    ------------
  10308.    1      .CMF    FM synthesis
  10309.    2      .VOC    Disk voice
  10310.    5      .MID    MIDI
  10311.  
  10312. Don't forget to include the file extension.  Also, be aware
  10313. that this routine doesn't start the sound playing-- that is
  10314. accomplished with SBPlay.  See also SBLoadXMS, which allows you
  10315. to initialize from XMS memory instead of from a file.
  10316.  
  10317. See PLAYVOC.BAS for an example.
  10318.  
  10319. Routines in this set include:
  10320.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10321.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10322.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10323.    SBSetVolume, SBStatus%, SBStop
  10324.  
  10325.    SBInitSrcXMS Handle%, ErrCode%
  10326.  
  10327. DriverNr%   SoundBlaster driver to initialize
  10328. FileName$   file to play
  10329. -------
  10330. ErrCode%    error code (0 if initialization succeeded)
  10331.  
  10332. Name  : SBInitSrcXMS         (SoundBlaster Init Source XMS)
  10333. Class : SoundBlaster
  10334. Level : BIOS
  10335.  
  10336. This routine prepares the SoundBlaster to play from XMS.  You
  10337. pass it the SBSIM XMS handle which was returned when the sound
  10338. file was loaded into XMS by SBLoadXMS.  Note that this routine
  10339. doesn't start the sound playing-- that is accomplished with
  10340. SBPlay.
  10341.  
  10342. When you are done with an XMS handle, remember to free it using
  10343. SBFreeXMS.
  10344.  
  10345. Routines in this set include:
  10346.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10347.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10348.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10349.    SBSetVolume, SBStatus%, SBStop
  10350.  
  10351.    SBInitSrcXMS Handle%, ErrCode%
  10352.  
  10353. Handle%     SBSIM XMS handle of sound to play
  10354. -------
  10355. ErrCode%    error code (0 if initialization succeeded)
  10356.  
  10357. Name  : SBInt%               (SoundBlaster Interrupt)
  10358. Class : SoundBlaster
  10359. Level : BIOS
  10360.  
  10361. This function returns the software interrupt number used by the
  10362. SBSIM driver.  Most people won't ever need to know the actual
  10363. number.  However, this also works as an installation check, as
  10364. the function returns 0 if SBSIM is not installed.
  10365.  
  10366. Routines in this set include:
  10367.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10368.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10369.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10370.    SBSetVolume, SBStatus%, SBStop
  10371.  
  10372.    IntNr% = SBInt%
  10373.  
  10374. -------
  10375. IntNr%      interrupt number used by SBSIM (0 if no SBSIM)
  10376.  
  10377. Name  : SBIsFree%            (SoundBlaster handle Is Free)
  10378. Class : SoundBlaster
  10379. Level : BIOS
  10380.  
  10381. This function tells you whether a specified SBSIM XMS handle is
  10382. free.
  10383.  
  10384. Routines in this set include:
  10385.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10386.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10387.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10388.    SBSetVolume, SBStatus%, SBStop
  10389.  
  10390.    Free% = SBIsFree%(Handle%)
  10391.  
  10392. Handle%     SBSIM XMS handle to test
  10393. -------
  10394. Free%       whether handle is free (0 no, -1 yes)
  10395.  
  10396. Name  : SBLoadXMS            (SoundBlaster Load XMS)
  10397. Class : SoundBlaster
  10398. Level : BIOS
  10399.  
  10400. This routine is used to load a .VOC file into XMS.  If you just
  10401. want to play directly from a file, see SBInitSrcFile instead.
  10402.  
  10403. Unlike SBInitSrcFile, you don't have to specify which SBSIM
  10404. driver to use.  SBLoadXMS implicitly uses the Memory Voice
  10405. driver, which handles XMS sound data in .VOC file format.
  10406.  
  10407. You must pass this routine the handle of an SBSIM XMS area.
  10408. Normally, you will want to set the handle to zero, which tells
  10409. the routine to use the first available handle.  A non-zero
  10410. handle will be returned for you to use with SBInitSrcXMS.
  10411.  
  10412. Don't forget to include the file extension.  Also, be aware
  10413. that this routine doesn't start the sound playing-- that is
  10414. accomplished with SBPlay.
  10415.  
  10416. Routines in this set include:
  10417.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10418.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10419.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10420.    SBSetVolume, SBStatus%, SBStop
  10421.  
  10422.    SBLoadXMS FileName$, Handle%, ErrCode%
  10423.  
  10424. FileName$   file to play
  10425. Handle%     SBSIM XMS handle to use (set to 0; see above)
  10426. -------
  10427. Handle%     active SBSIM XMS handle
  10428. ErrCode%    error code (0 if initialization succeeded)
  10429.  
  10430. Name  : SBMapMIDI            (SoundBlaster Map MIDI)
  10431. Class : SoundBlaster
  10432. Level : BIOS
  10433.  
  10434. This routine sets the MIDI channel mapper.  You may choose from
  10435. the following:
  10436.  
  10437.    0   General mapper
  10438.    1   Basic mapper
  10439.    2   Extended mapper
  10440.  
  10441. Routines in this set include:
  10442.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10443.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10444.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10445.    SBSetVolume, SBStatus%, SBStop
  10446.  
  10447.    SBMapMIDI MapNr%
  10448.  
  10449. MapNr%      desired MIDI channel mapping
  10450.  
  10451. Name  : SBPause              (SoundBlaster Pause)
  10452. Class : SoundBlaster
  10453. Level : BIOS
  10454.  
  10455. This routine pauses a playing driver.  You may select from any
  10456. of the following SBSIM drivers:
  10457.  
  10458.  Driver   File    Description
  10459.  ------   ----    ------------
  10460.    1      .CMF    FM synthesis
  10461.    2      .VOC    Disk voice
  10462.    3      <XMS>   Memory voice
  10463.    5      .MID    MIDI
  10464.  
  10465. Routines in this set include:
  10466.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10467.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10468.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10469.    SBSetVolume, SBStatus%, SBStop
  10470.  
  10471.    SBPause Driver%
  10472.  
  10473. Driver%     driver to pause
  10474.  
  10475. Name  : SBPlay               (SoundBlaster Play)
  10476. Class : SoundBlaster
  10477. Level : BIOS
  10478.  
  10479. This routine plays a specified driver.  The driver must have
  10480. been initialized beforehand by SBInitSrcFile or SBInitSrcXMS.
  10481. You may select from any of the following SBSIM drivers:
  10482.  
  10483.  Driver   File    Description
  10484.  ------   ----    ------------
  10485.    1      .CMF    FM synthesis
  10486.    2      .VOC    Disk voice
  10487.    3      <XMS>   Memory voice
  10488.    5      .MID    MIDI
  10489.  
  10490. Play can be paused with SBPause, resumed with SBResume, and
  10491. stopped with SBStop.  You can tell which drivers are currently
  10492. playing with SBGetActive.  You can read the status word with
  10493. SBStatus%, though most people won't need it.
  10494.  
  10495. Routines in this set include:
  10496.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10497.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10498.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10499.    SBSetVolume, SBStatus%, SBStop
  10500.  
  10501. See PLAYVOC.BAS for an example.
  10502.  
  10503.    SBStop Driver%
  10504.  
  10505. Driver%     driver to stop
  10506.  
  10507. Name  : SBResume             (SoundBlaster Resume)
  10508. Class : SoundBlaster
  10509. Level : BIOS
  10510.  
  10511. This routine resumes playing a paused driver.  You may select
  10512. from any of the following SBSIM drivers:
  10513.  
  10514.  Driver   File    Description
  10515.  ------   ----    ------------
  10516.    1      .CMF    FM synthesis
  10517.    2      .VOC    Disk voice
  10518.    3      <XMS>   Memory voice
  10519.    5      .MID    MIDI
  10520.  
  10521. Routines in this set include:
  10522.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10523.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10524.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10525.    SBSetVolume, SBStatus%, SBStop
  10526.  
  10527.    SBResume Driver%
  10528.  
  10529. Driver%     driver to resume
  10530.  
  10531. Name  : SBSetVolume          (SoundBlaster Set Volume level)
  10532. Class : SoundBlaster
  10533. Level : BIOS
  10534.  
  10535. This routine allows you to set the volume level for specified
  10536. SBSIM devices.  Stereo volume controls are provided for SBPro
  10537. and SB-16 adapters, which support stereo.  For older mono
  10538. SoundBlasters, the "left" speaker is the active one.
  10539.  
  10540. You may select from any of the following SBSIM sound sources:
  10541.  
  10542.  Source   Description
  10543.  ------   ------------
  10544.    0      Master
  10545.    1      Voice
  10546.    2      FM
  10547.    3      CD
  10548.    4      Line in
  10549.    5      Microphone
  10550.    6      PC Speaker
  10551.  
  10552. Routines in this set include:
  10553.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10554.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10555.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10556.    SBSetVolume, SBStatus%, SBStop
  10557.  
  10558.    SBSetVolume Source%, LeftVol%, RightVol%
  10559.  
  10560. Source%     sound source
  10561. LeftVol%    left volume (0-255)
  10562. RightVol%   right volume (0-255)
  10563.  
  10564. Name  : SBStatus%            (SoundBlaster Status)
  10565. Class : SoundBlaster
  10566. Level : BIOS
  10567.  
  10568. This function returns the status word for a specified SBSIM
  10569. driver.  The status generally seems to be -1 while a driver is
  10570. playing something and 0 when it isn't, but different status
  10571. values can be encoded into sound files.  This is typically used
  10572. to synchronize video with the sound.
  10573.  
  10574. If you just want to know whether or not a specific driver is
  10575. busy, use SBGetActive instead.
  10576.  
  10577. You may select from any of the following SBSIM drivers:
  10578.  
  10579.  Driver   File    Description
  10580.  ------   ----    ------------
  10581.    1      .CMF    FM synthesis
  10582.    2      .VOC    Disk voice
  10583.    3      <XMS>   Memory voice
  10584.    5      .MID    MIDI
  10585.  
  10586. Routines in this set include:
  10587.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10588.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10589.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10590.    SBSetVolume, SBStatus%, SBStop
  10591.  
  10592.    Status% = SBStatus%(Driver%)
  10593.  
  10594. Driver%     driver to check
  10595.  
  10596. Name  : SBStop               (SoundBlaster Stop)
  10597. Class : SoundBlaster
  10598. Level : BIOS
  10599.  
  10600. This routine stops playing a paused driver.  You may select
  10601. from any of the following SBSIM drivers:
  10602.  
  10603.  Driver   File    Description
  10604.  ------   ----    ------------
  10605.    1      .CMF    FM synthesis
  10606.    2      .VOC    Disk voice
  10607.    3      <XMS>   Memory voice
  10608.    5      .MID    MIDI
  10609.  
  10610. Routines in this set include:
  10611.    SBFreeHandles%, SBFreeXMS, SBGetActive, SBGetDrivers,
  10612.    SBGetVer, SBGetVolume, SBInt%, SBInitSrcFile, SBInitSrcXMS,
  10613.    SBIsFree, SBLoadXMS, SBMapMIDI, SBPause, SBPlay, SBResume,
  10614.    SBSetVolume, SBStatus%, SBStop
  10615.  
  10616. See PLAYVOC.BAS for an example.
  10617.  
  10618.    SBStop Driver%
  10619.  
  10620. Driver%     driver to stop
  10621.  
  10622. Name  : ScanKey              (Scan Keyboard)
  10623. Class : Input
  10624. Level : BIOS
  10625.  
  10626. This one's like INKEY$, but a little bit more subtle.  It will
  10627. tell you if there's a key waiting (and if so, what key it is)
  10628. without actually getting the key.  The key will remain
  10629. available for later retrieval.
  10630.  
  10631. Among the more common uses for this routine is to handle keys
  10632. like Control-S (pause the display) and Control-C (abort).  You
  10633. can see if these keys have been pressed without disturbing
  10634. anything else the user might have typed.  DOS uses exactly this
  10635. technique for handling these keys.  Since BASIC doesn't go
  10636. through DOS I/O, though, the only way for you to support such
  10637. nice features is to write them into your program with ScanKey.
  10638.  
  10639.    ScanKey CharCode%, CharType%
  10640.  
  10641. -------
  10642. CharType%   key type: 0 none, 1 normal, 2 extended (scan code)
  10643. CharCode%   key ASCII or scan code
  10644.  
  10645. Name  : Scroll               (Scroll)
  10646. Class : Display
  10647. Level : BIOS
  10648.  
  10649. This routine scrolls any selected part of the display up.  You
  10650. may scroll as many times as you like, or scroll "zero" times to
  10651. totally clear the selected part of the display.
  10652.  
  10653. Note that BIOS-level scrolling can cause the screen to flicker
  10654. on some CGAs due to a combination of unfortunate design factors.
  10655.  
  10656.    Scroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  10657.  
  10658. TopRow      top row of the area to scroll
  10659. LeftCol%    left column of the area to scroll
  10660. BottomRow   top row of the area to scroll
  10661. RightCol%   left column of the area to scroll
  10662. Times%      number of times (or rows) to scroll
  10663.  
  10664. Name  : ScrRest              (Screen Restore)
  10665. Class : Display
  10666. Level : Clone
  10667.  
  10668. The ScrRest routine restores a display that was saved using
  10669. ScrSave or a similar routine.  It only works in text modes, and
  10670. expects an 80x25 screen.  See PutScreen or DPutScreen if you
  10671. need to work with other screen sizes.
  10672.  
  10673.    ScrRest Array%(), Page%, Fast%
  10674.  
  10675. Array%()   array holding the display information
  10676. Page%      page on which to restore the display
  10677. Fast%      whether to use fast mode (0 no)
  10678.  
  10679. Name  : ScrSave              (Screen Save)
  10680. Class : Display
  10681. Level : Clone
  10682.  
  10683. The ScrSave routine saves the display to an integer array.
  10684. Only text modes are supported.  For an 80x25 display, the array
  10685. must hold 4,000 bytes, so you would use DIM Array%(1 TO 2000).
  10686.  
  10687. ScrSave expects an 80x25 screen.  Use GetScreen or DGetScreen
  10688. if you need to work with other screen sizes.
  10689.  
  10690.    ScrSave Array%(), Page%, Fast%
  10691.  
  10692. Page%      display page to get
  10693. Fast%      whether to use fast mode (0 no)
  10694. -------
  10695. Array%()   saved display information
  10696.  
  10697. Name  : SCrunch              (Screen Crunch)
  10698. Class : Display
  10699. Level : Any
  10700.  
  10701. This routine is designed to be used in conjunction with ScrSave
  10702. and the other routines which store an entire 80x25 text screen
  10703. in an array.  It performs a "screen crunch", compressing the
  10704. original data into a new array.  The average result is about 8x
  10705. smaller than the original screen, resulting in a vast savings
  10706. in memory (4,000 bytes vs 500 or so).  The compression
  10707. algorithm is very fast and will not take any noticeable amount
  10708. of time for most purposes.
  10709.  
  10710. Besides saving main memory, this is great for storing screens
  10711. as disk files! The compression will not only make the file(s)
  10712. smaller, but will make disk access faster since there is less
  10713. information to transfer.
  10714.  
  10715. If you need to deal with text screen images of other than 80x25
  10716. in size, try the SCrunchSS routine instead.
  10717.  
  10718.    SCrunch DSeg%, DOfs%, CSeg%, COfs%, Bytes%
  10719.  
  10720. DSeg%     segment of the original screen image
  10721. DOfs%     offset of the original screen image
  10722. CSeg%     segment of array in which to store compressed image
  10723. COfs%     offset of array in which to store compressed image
  10724. -------
  10725. Bytes%    number of bytes in the compressed image
  10726.  
  10727. Name  : SCrunchSS            (Screen Crunch, Sized Screen)
  10728. Class : Display
  10729. Level : Any
  10730.  
  10731. This routine is designed to be used in conjunction with ScrSave
  10732. and the other routines which store a text screen in an array.
  10733. It performs a "screen crunch", compressing the original data
  10734. into a new array.  The average result is about 8x smaller than
  10735. the original screen, resulting in a vast savings in memory.
  10736. The compression algorithm is very fast and will not take any
  10737. noticeable amount of time for most purposes.
  10738.  
  10739. Besides saving main memory, this is great for storing screens
  10740. as disk files! The compression will not only make the file(s)
  10741. smaller, but will make disk access faster since there is less
  10742. information to transfer.
  10743.  
  10744. If you only work with 80x25 text screen images, you may find it
  10745. more convenient to use the SCrunch routine instead.
  10746.  
  10747.    SCrunchSS DSeg%, DOfs%, Rows%, Cols%, CSeg%, COfs%, Bytes%
  10748.  
  10749. DSeg%     segment of the original screen image
  10750. DOfs%     offset of the original screen image
  10751. Rows%     rows in original screen image
  10752. Cols%     columns in original screen image
  10753. CSeg%     segment of array in which to store compressed image
  10754. COfs%     offset of array in which to store compressed image
  10755. -------
  10756. Bytes%    number of bytes in the compressed image
  10757.  
  10758. Name  : SDFlush              (SmartDrive Flush)
  10759. Class : Disk
  10760. Level : BIOS
  10761.  
  10762. This routine flushes SmartDrive disk caches, forcing it to
  10763. write any data in memory to the appropriate disk(s).
  10764.  
  10765. This routine requires SmartDrive 4.0 or later.
  10766.  
  10767. Routines in this set include:
  10768.    SDFlush, SDRCached%, SDReset, SDStats, SDGetVer, SDWCached%
  10769.  
  10770.    SDFlush
  10771.  
  10772. Name  : SDGetVer            (SmartDrive Get Version)
  10773. Class : Disk Equipment
  10774. Level : BIOS
  10775.  
  10776. This routine returns the SmartDrive version.  It is known to
  10777. work with SmartDrive 4.0 and later.  It should work with 3.x
  10778. versions, but I haven't been able to test it-- if you are using
  10779. a version of SmartDrive before 4.0, please let me know which
  10780. version and what results you get.
  10781.  
  10782. The other PBClone routines which access SmartDrive require
  10783. SmartDrive 4.0 or later to function.  This is due to a radical
  10784. alteration of the SmartDrive interface as of v4.0, making it
  10785. incompatible with earlier versions-- more Microsoft craziness.
  10786.  
  10787. Routines in this set include:
  10788.    SDFlush, SDRCached%, SDReset, SDStats, SDGetVer, SDWCached%
  10789.  
  10790.    SDGetVer MajorV%, MinorV%
  10791.  
  10792. -------
  10793. MajorV%    major part of version number (e.g., 4 in v4.10)
  10794. MinorV%    minor part of version number (e.g., 10 in v4.10)
  10795.  
  10796. Name  : SDRCached%           (SmartDrive Read Cached)
  10797. Class : Disk
  10798. Level : BIOS
  10799.  
  10800. This function tells you whether a specified drive is being
  10801. read-cached by SmartDrive.
  10802.  
  10803. Note that, in the case of a doubled drive (DoubleSpace,
  10804. Stacker, etc), the virtual drive letter is not the one cached--
  10805. for instance, my physical hard drive is mapped to H: by
  10806. DoubleSpace, leaving C: as a virtual drive. The virtual drive
  10807. is not cached as such, but the physical drive is-- for example,
  10808. on my system, C: is not cached, but H: is.  So, be careful
  10809. about what conclusions you draw about the setup based on this
  10810. routine.  It is useful for information and for helping
  10811. safeguard against problems if your program must run without
  10812. cacheing, but it isn't a panacea.
  10813.  
  10814. This routine requires SmartDrive 4.0 or later.
  10815.  
  10816. Routines in this set include:
  10817.    SDFlush, SDRCached%, SDReset, SDStats, SDGetVer, SDWCached%
  10818.  
  10819.    Cached% = SDRCached% (Drive$)
  10820.  
  10821. Drive$     drive letter to examine ("" for default drive)
  10822. -------
  10823. Cached%    whether drive is read cached (0 no, -1 yes)
  10824.  
  10825. Name  : SDReset              (SmartDrive Reset)
  10826. Class : Disk
  10827. Level : BIOS
  10828.  
  10829. This routine resets SmartDrive disk caches, clearing them and
  10830. starting caching from a blank slate.
  10831.  
  10832. This routine requires SmartDrive 4.0 or later.
  10833.  
  10834. Routines in this set include:
  10835.    SDFlush, SDRCached%, SDReset, SDStats, SDGetVer, SDWCached%
  10836.  
  10837.    SDReset
  10838.  
  10839. Name  : SDStats              (SmartDrive Statistics)
  10840. Class : Disk
  10841. Level : BIOS
  10842.  
  10843. This routine returns the hit/miss statistics for SmartDrive
  10844. cacheing.  Hits are the number of times a disk request is
  10845. satisfied by the cache.  Misses are the number of times a disk
  10846. request must be read from the disk itself.
  10847.  
  10848. This routine requires SmartDrive 4.0 or later.
  10849.  
  10850. Routines in this set include:
  10851.    SDFlush, SDRCached%, SDReset, SDStats, SDGetVer, SDWCached%
  10852.  
  10853.    SDStats Hits&, Misses&
  10854.  
  10855. -------
  10856. Hits&      number of cache hits
  10857. Misses&    number of cache misses
  10858.  
  10859. Name  : SDWCached%           (SmartDrive Write Cached)
  10860. Class : Disk
  10861. Level : BIOS
  10862.  
  10863. This function tells you whether a specified drive is being
  10864. write-cached by SmartDrive.
  10865.  
  10866. Note that, in the case of a doubled drive (DoubleSpace,
  10867. Stacker, etc), the virtual drive letter is not the one cached--
  10868. for instance, my physical hard drive is mapped to H: by
  10869. DoubleSpace, leaving C: as a virtual drive.  The virtual drive
  10870. is not cached as such, but the physical drive is-- for example,
  10871. on my system, C: is not cached, but H: is.  So, be careful
  10872. about what conclusions you draw about the setup based on this
  10873. routine.  It is useful for information and for helping
  10874. safeguard against problems if your program must run without
  10875. cacheing, but it isn't a panacea.
  10876.  
  10877. This routine requires SmartDrive 4.0 or later.
  10878.  
  10879. Routines in this set include:
  10880.    SDFlush, SDRCached%, SDReset, SDStats, SDGetVer, SDWCached%
  10881.  
  10882.    Cached% = SDWCached% (Drive$)
  10883.  
  10884. Drive$     drive letter to examine ("" for default drive)
  10885. -------
  10886. Cached%    whether drive is write cached (0 no, -1 yes)
  10887.  
  10888. Name  : Sec2Time$            (Seconds to Time)
  10889. Class : Time
  10890. Level : Any
  10891.  
  10892. This routine converts the number of seconds past midnight into
  10893. a time string.
  10894.  
  10895.    TimeSt$ = Sec2Time$(Seconds&)
  10896.  
  10897. Seconds&   number of seconds past midnight
  10898. -------
  10899. TimeSt$    time string (TIME$ format)
  10900.  
  10901. Name  : SetBit               (Set Bit)
  10902. Class : Numeric
  10903. Level : Any
  10904.  
  10905. This routine sets a single bit "on" in an integer.  Bits are
  10906. numbered 0-15, with 0 being the least significant bit.
  10907.  
  10908.    SetBit Number%, BitNr%
  10909.  
  10910. Number%    number for which to set bit
  10911. BitNr%     bit number (0-15) to set
  10912. -------
  10913. Number%    number with the specified bit set
  10914.  
  10915. Name  : SetCGAColor          (Set CGA Color)
  10916. Class : Display
  10917. Level : Clone
  10918.  
  10919. This routine allows you to set certain aspects of CGA colors
  10920. which aren't available otherwise.  It is very CGA-specific,
  10921. however, and may not work on EGA or VGA systems.
  10922.  
  10923. The color specified has different meanings in different CGA
  10924. modes.  In the SCREEN 1 graphics mode, it changes the
  10925. background and border color.  In SCREEN 2, however, it allows
  10926. you to change the foreground color.  While you are still stuck
  10927. with a single foreground color, you can choose what that color
  10928. will be.
  10929.  
  10930.    SetCGAColor Colour%
  10931.  
  10932. Colour%    color to set (see above)
  10933.  
  10934. Name  : SetComm              (Set Comm port)
  10935. Class : Serial
  10936. Level : DOS
  10937.  
  10938. Although QuickBASIC has a fair range of communications support,
  10939. it doesn't do the capabilities of the PC full justice.  It's
  10940. also impossible to change the serial parameters "on the fly"
  10941. without risking disconnection, if BASIC alone is used.  SetComm
  10942. gets around those limitations.  It should be used -after- the
  10943. appropriate comm port is OPENed by BASIC.
  10944.  
  10945. Note that the true upper limits of the comm speed are
  10946. determined by your program and by the hardware being used.
  10947. Some PC/XTs may have trouble with 9,600 bps, for instance.  The
  10948. ability to set the serial port to a high speed doesn't
  10949. guarantee that the hardware can handle it!
  10950.  
  10951.    SetComm CommPort%, Bps%, Parity%, WordLength%, StopBits%
  10952.  
  10953. CommPort%    serial port (1-4, though BASIC only uses 1-2)
  10954. Bps%         bits per second ("baud rate"):
  10955.                 0 for   300       5 for   9,600
  10956.                 1 for   600       6 for  19,200
  10957.                 2 for 1,200       7 for  38,400
  10958.                 3 for 2,400       8 for  57,600
  10959.                 4 for 4,800       9 for 115,200
  10960. Parity%      parity:
  10961.                 0  none
  10962.                 1  odd            3  mark  (always on)
  10963.                 2  even           4  space (always off)
  10964. WordLength%  word length (5-8)
  10965. StopBits%    stop bits (1-2; if WordLength=5, "2" means 1 1/2)
  10966.  
  10967. Name  : SetCommAddr          (Set Comm Address)
  10968. Class : Serial
  10969. Level : Clone
  10970.  
  10971. This routine allows you to set the base port address of a
  10972. serial port.
  10973.  
  10974. One use for SetCommAddr is to give QuickBASIC access to the
  10975. comm port on those unusual machines which have a COM2 but no
  10976. COM1.  Use GetCommAddr to get the address of COM2, set the COM1
  10977. address accordingly, and tell QuickBASIC to use COM1.
  10978.  
  10979. BASIC will normally handle COM1 and COM2, but not COM3 or
  10980. COM4.  Although there is no way to use more two ports at once,
  10981. you can fool BASIC into using COM3 by swapping it with COM1, or
  10982. COM4 by swapping it with COM2.
  10983.  
  10984. Don't forget to set the ports back to their original values
  10985. before your program ends!
  10986.  
  10987.    SetCommAddr PortNr%, PortAddr%
  10988.  
  10989. PortNr%     COM port number (1-4)
  10990. PortAddr%   port address
  10991.  
  10992. Name  : SetDateAT            (Set Date of AT clock)
  10993. Class : Time
  10994. Level : BIOS (AT)
  10995.  
  10996. This routine sets the date of the hardware real-time clock in
  10997. AT-class computers.  Depending on the DOS version, this date
  10998. may be partially or completely independent of the date kept by
  10999. DOS in software.  DOS always reads the date from the hardware
  11000. clock when it starts up.  However, use of the DATE command in
  11001. DOS (and the DATE$ function in QuickBASIC) may relate only to
  11002. the software copy of the date, which is not always guaranteed
  11003. to be the same as the date in the hardware clock due to certain
  11004. discrepancies in DOS.
  11005.  
  11006. You may express the year as either a two-digit or four-digit
  11007. number.
  11008.  
  11009. The ProBas and PBClone versions of this routine do not work the
  11010. same way in regards to the year.  ProBas assumed that any
  11011. two-digit year was in the 1900s.  In contrast, PBClone assumes
  11012. that years 80-99 should be converted to 1980-1999 and that 0-79
  11013. should be converted to 2000-2079.  I consider the PBClone
  11014. method more appropriate, with the turn of the century moving
  11015. closer. The date format used does not allow dates before 1980
  11016. anyway, so nothing is being lost by this change.
  11017.  
  11018.    SetDateAT MonthNr%, DayNr%, YearNr%
  11019.  
  11020. MonthNr%    month number (1-12)
  11021. DayNr%      day (1-31)
  11022. YearNr%     year (1980-2079; see above for two-digit years)
  11023.  
  11024. Name  : SetDrv               (Set default Drive)
  11025. Class : Disk
  11026. Level : DOS
  11027.  
  11028. This routine sets the default disk drive.
  11029.  
  11030. If the specified drive does not exist, the current default
  11031. drive will remain the default.
  11032.  
  11033.    SetDrv Drive$
  11034.  
  11035. Drive$    drive letter
  11036.  
  11037. Name  : SetError             (Set Error code)
  11038. Class : Miscellaneous
  11039. Level : DOS
  11040.  
  11041. The SetError routine allows you to set the "error level" to be
  11042. returned by DOS when your program ends.  This is particularly
  11043. handy for returning information to batch files.
  11044.  
  11045. Note that SetError is best used just before your program ENDs,
  11046. to avoid complications.
  11047.  
  11048.    SetError ErrorLevel%
  11049.  
  11050. ErrorLevel%   exit code to be returned by your program
  11051.  
  11052. Name  : SetFAttr             (Set File Attribute)
  11053. Class : Disk
  11054. Level : DOS
  11055.  
  11056. This routine allows you to set the attribute of a file or
  11057. subdirectory.  Any combination of the following may be set:
  11058.  
  11059.    Normal          0      (nothing special)
  11060.    Read Only       1      file can be read, but not written to
  11061.    Hidden          2      file will be "invisible"
  11062.    System          4      (for special DOS files-- leave alone)
  11063.    Archive        32      (used by some backup utils- leave be)
  11064.  
  11065. To set more than one attribute, just add the numbers for the
  11066. desired attributes together.  The attributes marked "leave
  11067. alone" shouldn't be used casually, but if you're sure you know
  11068. what you're doing...
  11069.  
  11070.    SetFAttr FileName$, FAttr%
  11071.  
  11072. FileName$   name of the file (or subdirectory) to manipulate
  11073. FAttr%      attribute(s) to set
  11074.  
  11075. Name  : SetFTD               (Set File Time and Date)
  11076. Class : Disk
  11077. Level : DOS
  11078.  
  11079. This routine lets you set the time and date of a specified
  11080. file.  You may give the year either as two digits or four
  11081. digits.
  11082.  
  11083. The ProBas and PBClone versions of this routine do not work the
  11084. same way in regards to the year.  ProBas assumed that any
  11085. two-digit year was in the 1900s.  In contrast, PBClone assumes
  11086. that years 80-99 should be converted to 1980-1999 and that 0-79
  11087. should be converted to 2000-2079.  I consider the PBClone
  11088. method more appropriate, with the turn of the century moving
  11089. closer. The DOS date format does not allow dates before 1980
  11090. anyway, so nothing is being lost by this change.
  11091.  
  11092. Note that the Second% value, if odd, will be rounded down to an
  11093. even number. This is due to the way DOS compresses the time
  11094. format, rather than any limitation in this routine.
  11095.  
  11096.    SetFTD File$, MonthNr%, DayNr%, YearNr%, HourNr%, _
  11097.      MinuteNr%, SecondNr%
  11098.  
  11099. File$        name of file for which to set the time and date
  11100. MonthNr%     month number (1-12)
  11101. DayNr%       day (1-31)
  11102. YearNr%      year (1980-2079; see above for two-digit years)
  11103. HourNr%      hour (0-23)
  11104. MinuteNr%    minute (0-59)
  11105. SecondNr%    second (0-59; if odd, rounded down to even number)
  11106. -------
  11107. MonthNr%     -1 if there was an error, else unchanged
  11108.  
  11109. Name  : SetKbd               (Set Keyboard toggles)
  11110. Class : Input
  11111. Level : Clone
  11112.  
  11113. The SetKbd routine allows you to set the state of any of the
  11114. four keyboard toggles: Insert, Caps lock, Num lock, and Scroll
  11115. Lock.  You can give your input routines a professional touch by
  11116. setting this toggles instead of making the user remember to do
  11117. so.
  11118.  
  11119. It's considered proper to restore the original keyboard toggles
  11120. before your program exits, unless of course the purpose of the
  11121. program is to leave the toggles in a particular state!  The
  11122. GetKbd routine can be used in conjunction with SetKbd to do
  11123. this.
  11124.  
  11125.    SetKbd Insert%, Caps%, Num%, Scrl%
  11126.  
  11127. Insert%    whether to turn on "insert" mode (0 if no)
  11128. Caps%      whether to turn on "caps lock" (0 if no)
  11129. Num%       whether to put the keypad into numeric mode (0 no)
  11130. Scrl%      whether to turn on "scroll lock" (0 if no)
  11131.  
  11132. Name  : SetLabel             (Set disk volume Label)
  11133. Class : Disk
  11134. Level : DOS
  11135.  
  11136. This routine creates, renames or deletes a disk volume label.
  11137.  
  11138. Note that a disk volume label is essentially a file name
  11139. without an extension.  It can contain any character that can
  11140. normally be in a file name, plus spaces and periods.
  11141.  
  11142.    SetLabel Drive$, Label$, ErrCode%
  11143.  
  11144. Drive$     drive to set label on (use "" for current drive)
  11145. Label$     label to install (use "" to delete current label)
  11146. -------
  11147. ErrCode%   whether there was an error (0 no)
  11148.  
  11149. Name  : SetLogiDrive         (Set Logical Drive)
  11150. Class : Disk
  11151. Level : DOS 3.2+
  11152.  
  11153. This routine is useful for systems which only have a single
  11154. floppy drive.  In such cases, DOS connects both drive letters
  11155. A: and B: to the same drive.  However, only one drive letter is
  11156. active, and when you try to access the "other" drive, DOS
  11157. displays the message:
  11158.  
  11159.   "Insert diskette for drive x: and press any key when ready."
  11160.  
  11161. By setting the active drive yourself, you can bypass this
  11162. message, and your program will look much more professional.
  11163. See also GetLogiDrive$, which allows you to determine which
  11164. drive letter is active for a given drive.
  11165.  
  11166.    SetLogiDrive Drive$, ErrCode%
  11167.  
  11168. Drive$     drive letter to select (use "" for current drive)
  11169. -------
  11170. ErrCode%   whether there was an error (0 no)
  11171.  
  11172. Name  : SetMatD              (Set Matrix to Double)
  11173. Class : Array
  11174. Level : Any
  11175.  
  11176. This routine sets as many elements of a double-precision array
  11177. as you like, starting at a specified place in the array.  A
  11178. good use for it is to initialize an array (or a portion of it)
  11179. to a given value.
  11180.  
  11181.    SetMatD DSeg%, DOfs%, Elements%, Value#
  11182.  
  11183. DSeg%      segment of the first array element to add
  11184. DOfs%      offset of the first array element to add
  11185. Elements%  number of array elements to which to add
  11186. Value#     value to which to set each array element
  11187.  
  11188. Name  : SetMatI              (Set Matrix to Integer)
  11189. Class : Array
  11190. Level : Any
  11191.  
  11192. This routine sets as many elements of an integer array as you
  11193. like, starting at a specified place in the array.  A good use
  11194. for it is to initialize an array (or a portion of it) to a
  11195. given value.
  11196.  
  11197.    SetMatI DSeg%, DOfs%, Elements%, Value%
  11198.  
  11199. DSeg%      segment of the first array element to add
  11200. DOfs%      offset of the first array element to add
  11201. Elements%  number of array elements to which to add
  11202. Value%     value to which to set each array element
  11203.  
  11204. Name  : SetMatL              (Set Matrix to Long)
  11205. Class : Array
  11206. Level : Any
  11207.  
  11208. This routine sets as many elements of an long integer array as
  11209. you like, starting at a specified place in the array.  A good
  11210. use for it is to initialize an array (or a portion of it) to a
  11211. given value.
  11212.  
  11213.    SetMatL DSeg%, DOfs%, Elements%, Value&
  11214.  
  11215. DSeg%      segment of the first array element to add
  11216. DOfs%      offset of the first array element to add
  11217. Elements%  number of array elements to which to add
  11218. Value&     value to which to set each array element
  11219.  
  11220. Name  : SetMatS              (Set Matrix to Single)
  11221. Class : Array
  11222. Level : Any
  11223.  
  11224. This routine sets as many elements of a single-precision array
  11225. as you like, starting at a specified place in the array.  A
  11226. good use for it is to initialize an array (or a portion of it)
  11227. to a given value.
  11228.  
  11229.    SetMatS DSeg%, DOfs%, Elements%, Value!
  11230.  
  11231. DSeg%      segment of the first array element to add
  11232. DOfs%      offset of the first array element to add
  11233. Elements%  number of array elements to which to add
  11234. Value!     value to which to set each array element
  11235.  
  11236. Name  : SetMouseLoc          (Set Mouse Location)
  11237. Class : Mouse
  11238. Level : BIOS
  11239.  
  11240. This routine allows you to set the current location of the
  11241. mouse cursor.  It doesn't matter if the cursor is visible or
  11242. invisible.  SetMouseLoc is only for use in text mode.
  11243.  
  11244. This routine will not work properly if there is no mouse
  11245. available.  Use the MMCheck routine if you are not sure.
  11246.  
  11247. See also MMSetLoc, which is for use in graphics modes.
  11248.  
  11249.    SetMouseLoc Row%, Column%
  11250.  
  11251. Row%       mouse cursor row
  11252. Column%    mouse cursor column
  11253.  
  11254. Name  : SetPatch             (Set Patch information)
  11255. Class : Disk
  11256. Level : DOS
  11257.  
  11258. This routine is used after FindPatch.  The FindPatch routine
  11259. finds the first DATA statement to be patched.  SetPatch places
  11260. new information in that DATA statement and moves the file
  11261. pointer to the position of the next DATA statement.  Note that
  11262. there must be only one item per DATA statement; this item must
  11263. be a quoted string.  The string in the DATA statement and the
  11264. patch string must be the same length.
  11265.  
  11266. If you need this routine to be able to handle variable-length
  11267. strings, don't fret!  Make the DATA string one character longer
  11268. than the maximum you need, and use the extra character to
  11269. indicate the actual string length:
  11270.    SetPatch CHR$(LEN(St$)) + St$
  11271. Then when you READ St$, decode it like so:
  11272.    St$ = MID$(St$, 2, ASC(St$))
  11273.  
  11274. Routines in this set include FindPatch, SetPatch, PatchDone.
  11275.  
  11276.    SetPatch St$
  11277.  
  11278. St$       string to patch into the current DATA statement
  11279.  
  11280. Name  : SetPrtAddr           (Set Printer Address)
  11281. Class : Printer
  11282. Level : Clone
  11283.  
  11284. This routine allows you to set the base port address of a
  11285. parallel port.
  11286.  
  11287. One use for this routine is to fool BASIC into using a
  11288. different port than LPT1 for LPRINT.  See also PRTSWAP.
  11289.  
  11290. Note that PS/2 systems only have ports 1-3 available.  They use
  11291. the fourth port data area for holding other information.  It
  11292. may be a good idea to restrict yourself to ports 1-3 for
  11293. compatibility purposes, although other computers allow ports
  11294. 1-4.
  11295.  
  11296. Don't forget to set the ports back to their original values
  11297. before your program ends!
  11298.  
  11299.    SetPrtAddr PortNr%, PortAddr%
  11300.  
  11301. PortNr%     LPT port number (1-4 or 1-3 [see above])
  11302. PortAddr%   port address
  11303.  
  11304. Name  : SetSub               (Set default Subdirectory)
  11305. Class : Disk
  11306. Level : DOS
  11307.  
  11308. Just like the DOS CD (or CHDIR) command, this routine allows
  11309. you to change the current subdirectory.  Unlike the
  11310. corresponding DOS command, you may not use a period or double
  11311. period as shorthand for a directory.  However, you may specify
  11312. either an absolute or relative path, as usual, and can also use
  11313. either slashes or backslashes as delimiters.
  11314.  
  11315.    SetSub SubDir$, ErrCode%
  11316.  
  11317. SubDir$    subdirectory name
  11318. -------
  11319. ErrCode%   error code: 0 if no error, else a DOS Error number
  11320.  
  11321. Name  : SetTimeAT            (Set Time of AT clock)
  11322. Class : Time
  11323. Level : BIOS (AT)
  11324.  
  11325. This routine sets the time to the hardware real-time clock in
  11326. AT-class computers.  Depending on the DOS version, this time
  11327. may be partially or completely independent of the time kept by
  11328. DOS in software.  DOS always reads the time from the hardware
  11329. clock when it starts up.  However, use of the TIME command in
  11330. DOS (and the TIME$ function in QuickBASIC) may relate only to
  11331. the software copy of the time, which is not always guaranteed
  11332. to be the same as the time in the hardware clock due to certain
  11333. discrepancies in DOS.
  11334.  
  11335.    SetTimeAT HourNr%, MinuteNr%, SecondNr%
  11336.  
  11337. HourNr%      hour (0-23)
  11338. MinuteNr%    minute
  11339. SecondNr%    second
  11340.  
  11341. Name  : SetVerify            (Set Verify state)
  11342. Class : Disk
  11343. Level : DOS
  11344.  
  11345. The SetVerify routine allows you to set the state of the DOS
  11346. VERIFY flag. When VERIFY is on, some checking is done to make
  11347. sure that writing to the disk works as requested.  The checks
  11348. are not very good, however, and VERIFY slows down disk
  11349. handling, so it is usually better to have VERIFY off.
  11350.  
  11351.    SetVerify VerifyOn%
  11352.  
  11353. VerifyOn%   whether to turn VERIFY on (0 if no)
  11354.  
  11355. Name  : SetVGAColor          (Set VGA Color)
  11356. Class : Display
  11357. Level : BIOS
  11358.  
  11359. This routine sets the color associated with a given color
  11360. number.  The color is specified as a combination of red, green,
  11361. and blue intensities.  Each intensity may range from off (0) to
  11362. very bright (63).
  11363.  
  11364. If you are dealing with more than one color at a time, you may
  11365. find SetVGAPalette more appropriate.
  11366.  
  11367.    SetVGAColor ColorNr%, Red%, Green%, Blue%
  11368.  
  11369. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  11370. Red%       red intensity (0-63)
  11371. Green%     green intensity (0-63)
  11372. Blue%      blue intensity (0-63)
  11373.  
  11374. Name  : SetVGAPalette        (Set VGA Palette)
  11375. Class : Display
  11376. Level : BIOS
  11377.  
  11378. This routine allows you to set any number of the VGA palette
  11379. values from a TYPEd array.  The TYPE for the array should be
  11380. defined like this:
  11381.  
  11382.    TYPE Palet
  11383.       IRed AS STRING * 1
  11384.       IBlue AS STRING * 1
  11385.       IGreen AS STRING * 1
  11386.    END TYPE
  11387.  
  11388. This type holds a CHR$-encoded representation of the intensity
  11389. of each component of the color.  The values range from 0-63.
  11390.  
  11391. You can change many palette settings at a time, very quickly,
  11392. with this routine.  This routine is sufficiently faster than
  11393. the BASIC PALETTE statement as to make palette animation (and
  11394. some stupendous special effects) possible.  It may cause
  11395. flickering on displays with less well-designed video BIOS
  11396. chips, however.
  11397.  
  11398. If you only need to set a few colors, you may find SetVGAColor
  11399. more convenient.
  11400.  
  11401.    SetVGAPalette DSeg%, DOfs%, Start%, Colors%
  11402.  
  11403. DSeg%      segment of the palette array
  11404. DOfs%      offset of the palette array
  11405. Start%     color number to start with
  11406. Colors%    number of colors to set
  11407.  
  11408. Name  : SFRead               (String File Read)
  11409. Class : Disk / String
  11410. Level : DOS
  11411.  
  11412. This routine reads a string from a file that was opened by
  11413. FOpen1 or FCreate. The length of the string you provide
  11414. determines how many characters should be read.  If it wasn't
  11415. possible to read all the characters desired, an error code will
  11416. be returned and the BytesRead% value will tell you how many
  11417. characters were actually retrieved.
  11418.  
  11419.    St$ = SPACE$(BytesToRead%)
  11420.    SFRead Handle%, St$, BytesRead%, ErrCode%
  11421.  
  11422. Handle%     handle of the file from which to read
  11423. -------
  11424. St$         data read from the file.  Init to # of chars wanted
  11425. BytesRead%  number of bytes read from the file (if error)
  11426. ErrCode%    error code: 0 if no error, else DOS Error
  11427.  
  11428. Name  : SFWrite              (String File Write)
  11429. Class : Disk / String
  11430. Level : DOS
  11431.  
  11432. This routine writes a string to a file that was opened by
  11433. FOpen1 or FCreate.  The length of the string you provide
  11434. determines how many characters will be written.  If it wasn't
  11435. possible to write the entire string to the file, an error code
  11436. will be returned and the BytesWrit% value will tell you how
  11437. many characters were actually written.
  11438.  
  11439.    SFWrite Handle%, St$, BytesWrit%, ErrCode%
  11440.  
  11441. Handle%     handle of the file to which to write
  11442. St$         data to write to the file.
  11443. -------
  11444. BytesWrit%  number of bytes written to the file (if error)
  11445. ErrCode%    error code: 0 if no error, else DOS Error
  11446.  
  11447. Name  : ShiftL               (Shift Left)
  11448. Class : Numeric
  11449. Level : Any
  11450.  
  11451. This routine shifts the bits in an integer left by a desired
  11452. amount.  The effect of this is similar to multiplying the
  11453. number by a power of two, if the number is positive, but is
  11454. much faster.
  11455.  
  11456.    ShiftL Value%, Count%
  11457.  
  11458. Value%    number to shift left
  11459. Count%    bits by which to shift
  11460. -------
  11461. Value%    shifted number
  11462.  
  11463. Name  : ShiftLL              (Shift Left Long)
  11464. Class : Numeric
  11465. Level : Any
  11466.  
  11467. This routine shifts the bits in a long integer left by a
  11468. desired amount.  The effect of this is similar to multiplying
  11469. the number by a power of two, if the number is positive, but is
  11470. much faster.
  11471.  
  11472.    ShiftLL Value&, Count%
  11473.  
  11474. Value&    number to shift left
  11475. Count%    bits by which to shift
  11476. -------
  11477. Value&    shifted number
  11478.  
  11479. Name  : ShiftR               (Shift Right)
  11480. Class : Numeric
  11481. Level : Any
  11482.  
  11483. This routine shifts the bits in an integer right by a desired
  11484. amount.  The effect of this is similar to dividing the number
  11485. by a power of two, if the number is positive, but is much
  11486. faster.
  11487.  
  11488.    ShiftR Value%, Count%
  11489.  
  11490. Value%    number to shift right
  11491. Count%    bits by which to shift
  11492. -------
  11493. Value%    shifted number
  11494.  
  11495. Name  : ShiftRL              (Shift Right Long)
  11496. Class : Numeric
  11497. Level : Any
  11498.  
  11499. This routine shifts the bits in a long integer right by a
  11500. desired amount. The effect of this is similar to dividing the
  11501. number by a power of two, if the number is positive, but is
  11502. much faster.
  11503.  
  11504.    ShiftRL Value&, Count%
  11505.  
  11506. Value&    number to shift right
  11507. Count%    bits by which to shift
  11508. -------
  11509. Value&    shifted number
  11510.  
  11511. Name  : ShlSt                (Shift Left String of bits)
  11512. Class : String
  11513. Level : Any
  11514.  
  11515. This routine shifts the bits in a string left by a desired
  11516. amount.  This may be helpful for manupulating strings
  11517. containing bit flags, images, et al.
  11518.  
  11519.    ShlSt St$, Count%
  11520.  
  11521. St$       string to shift left
  11522. Count%    bits by which to shift
  11523. -------
  11524. St$       shifted string
  11525.  
  11526. Name  : ShowBMP              (Show Bitmap)
  11527. Class : Display File
  11528. Level : BIOS
  11529.  
  11530. This routine displays a bitmap file (MS Windows .BMP format) on
  11531. the screen.  The display must be in SCREEN 13 mode (MCGA or
  11532. VGA, 320x200, 256 colors).  You can specify a starting X,Y
  11533. coordinate, or use -1,-1 to scale the image to the screen.
  11534. Scaling allows you to display images larger than 320x200.
  11535.  
  11536. Only 256-color bitmaps are supported.  The palette will be
  11537. changed according to the directions in the bitmap file.  If
  11538. scaling is chosen and the image is larger than 320x200, the
  11539. screen coordinates will be altered with WINDOW SCREEN to let
  11540. the image fit.  Proportional scaling is used to avoid having a
  11541. flattened or stretched image.
  11542.  
  11543.    ShowBMP FileName$, X%, Y%, ErrCode%
  11544.  
  11545. FileName$   name of bitmap file
  11546. X%          X coordinate (0-319, or -1 for scaling)
  11547. Y%          Y coordinate (0-199, or -1 for scaling)
  11548. -------
  11549. ErrCode%    error code (0 if none; >0, DOS error; <0, bad .BMP)
  11550.  
  11551. Name  : ShowIcon             (Show Icon)
  11552. Class : Display File
  11553. Level : BIOS
  11554.  
  11555. This routine displays an icon file (MS Windows .ICO format) on
  11556. the screen.  The display mode may be any of the EGA or VGA
  11557. graphics modes, and you can specify a starting X,Y coordinate.
  11558.  
  11559. Only the standard icon format is supported.  These icons are
  11560. 32x32 pixels and are contained in 766-byte .ICO files.  Note
  11561. that colors are translated from Windows colors, which are a
  11562. close (but not exact) match for BASIC colors.
  11563.  
  11564.    ShowIcon FileName$, X%, Y%, ErrCode%
  11565.  
  11566. FileName$   name of icon file
  11567. X%          X coordinate (0-319 or 0-639 depending on mode)
  11568. Y%          Y coordinate (0-199, -349, etc; depends on mode)
  11569. -------
  11570. ErrCode%    error code (0 if none; >0, DOS error; <0, not .ICO)
  11571.  
  11572. Name  : ShrSt                (Shift Right String of bits)
  11573. Class : String
  11574. Level : Any
  11575.  
  11576. This routine shifts the bits in a string right by a desired
  11577. amount.  This may be helpful for manupulating strings
  11578. containing bit flags, images, et al.
  11579.  
  11580.    ShrSt St$, Count%
  11581.  
  11582. St$       string to shift right
  11583. Count%    bits by which to shift
  11584. -------
  11585. St$       shifted string
  11586.  
  11587. Name  : ShuffleSt            (Shuffle String)
  11588. Class : String
  11589. Level : Any
  11590.  
  11591. This routine shuffles the characters in a string, efficiently
  11592. randomizing their order.  It relies on the RND function, so
  11593. you'd be advised to use the RANDOMIZE statement at the top of
  11594. your program unless you want the results to be predictable.  A
  11595. good way of initializing the random number generator is:
  11596.    RANDOMIZE TIMER
  11597.  
  11598. See also the array shuffles: MatShuffleD, MatShuffleI,
  11599. MatShuffleL, MatShuffleS, MatShuffleSt
  11600.  
  11601.    ShuffleSt St$
  11602.  
  11603. St$       string to shuffle
  11604. -------
  11605. St$       shuffled string
  11606.  
  11607. Name  : SInput               (String Input)
  11608. Class : Input
  11609. Level : Clone
  11610.  
  11611. This is a flexible line input routine which supports WordStar
  11612. and DOS-style editing, default entries, key screening, and any
  11613. number of other options.  To keep SInput manageable, the less
  11614. volatile parameters are set with separate routines instead of
  11615. being passed directly.
  11616.  
  11617. The St$ parameter must be set to the maximum desired input
  11618. length.  It may also contain a default entry, in which case
  11619. SLen% should be set to the length of the default entry (set
  11620. SLen% to zero if there is no default entry).
  11621.  
  11622. Character screening is done through selection of valid
  11623. character types.  This may be any combination of the following
  11624. (add the desired types together):
  11625.  
  11626.     1    letters
  11627.     2    digits
  11628.     4    symbols
  11629.    16    graphics (ASCII 128-255)
  11630.    32    spaces
  11631.  
  11632. You can use -1 to allow any character.  You can also make use
  11633. of the NOT operator, e.g. NOT 2 allows everything but digits.
  11634.  
  11635. The ExitCode% returns the key used to terminate input.  This
  11636. will normally be 13 (return) or 27 (esc), but other results may
  11637. be returned depending on how you use the various SInputSet
  11638. routines.  Note that the cursor position is not altered when
  11639. SInput exits, to avoid accidentally scrolling your screen.  You
  11640. are left with full control over the cursor.
  11641.  
  11642. The SInput routine is designed with the idea of input forms and
  11643. windows in mind.  It is not capable of handling more than one
  11644. line of text at a time. It also doesn't know how to wrap at the
  11645. edge of the screen.
  11646.  
  11647. Routines in this series include:
  11648.    SInput, SInputSet, SInputSet1, SInputSet2
  11649.  
  11650. Since everyone has their own ideas about the perfect input
  11651. routine, I have recoded SInput largely in BASIC to allow
  11652. registered PBClone owners to modify it easily.  I've gotten a
  11653. huge number of requests for SInput modifications in the past;
  11654. hopefully this will be the best solution!
  11655.  
  11656.    SInput St$, SLen%, Valid%, MustFill%, VAttr%, ExitCode%
  11657.  
  11658. St$         init to max length of input (may hold default)
  11659. SLen%       length of default entry (0 if none)
  11660. Valid%      valid character types (see above)
  11661. MustFill%   whether input field must be totally filled (0 no)
  11662. VAttr%      color/attribute for input (see CalcAttr)
  11663. -------
  11664. St$         entered string
  11665. SLen%       length of entered string
  11666. ExitCode%   key used to exit (13 for <CR> or 27 for <ESC>)
  11667.  
  11668. Name  : SInputSet            (String Input Settings)
  11669. Class : Input
  11670. Level : Clone
  11671.  
  11672. This is one of a number of routines which allow you to modify
  11673. the default operation of SInput.
  11674.  
  11675. If you allow extended keys (like Alt keys and function keys) to
  11676. exit SInput, the ExitCode% parameter will return the negative
  11677. scan code of the key.
  11678.  
  11679. Routines in this series include:
  11680.    SInput, SInputSet, SInputSet1, SInputSet2
  11681.  
  11682.    SInputSet FillCh$, ExtExit%, BadBeep%, FullBeep%, Fast%
  11683.  
  11684. FillCh$     character used to show field length (default "_")
  11685. ExtExit%    extended keys can be used to exit (default 0, no)
  11686. BadBeep%    beep on invalid keys (default 0, no)
  11687. FullBeep%   beep when input field is full (default 0, no)
  11688. Fast%       use fast display, may make CGA flicker (def 0, no)
  11689.  
  11690. Name  : SInputSet1           (String Input Settings)
  11691. Class : Input
  11692. Level : Clone
  11693.  
  11694. This is one of a number of routines which allow you to modify
  11695. the default operation of SInput.
  11696.  
  11697. If you give SInput a default entry, it will normally place the
  11698. cursor at the end of that entry when input begins.  The
  11699. CurPosn% option here allows you to place the cursor where you
  11700. want it (1 - LEN(St$), or 0 for end of entry).
  11701.  
  11702. Routines in this series include:
  11703.    SInput, SInputSet, SInputSet1, SInputSet2
  11704.  
  11705.    SInputSet1 CurPosn%, FullExit%
  11706.  
  11707. CurPosn%    starting cursor posn within input field (default 0)
  11708. FullExit%   auto-exit when input field is full (default 0, no)
  11709.  
  11710. Name  : SInputSet2           (String Input Settings)
  11711. Class : Input
  11712. Level : Clone
  11713.  
  11714. This is one of a number of routines which allow you to modify
  11715. the default operation of SInput.
  11716.  
  11717. If you allow tabs to exit SInput, the ExitCode% may return an
  11718. additional value: 9 (tab).  A "back tab", by the way, can be
  11719. retrieved if you use SInputSet to allow extended keys to exit
  11720. (back tab would return -15).
  11721.  
  11722. Routines in this series include:
  11723.    SInput, SInputSet, SInputSet1, SInputSet2
  11724.  
  11725.    SInputSet2 Capitalize%, TabExit%
  11726.  
  11727. Capitalize%   whether to capitalize letters (default 0, no)
  11728. TabExit%      whether tab key can to exit (default 0, no)
  11729.  
  11730. Name  : SortD                (Sort Double precision)
  11731. Class : Array management
  11732. Level : Any
  11733.  
  11734. This routine sorts the elements in an array of double-precision
  11735. numbers.
  11736.  
  11737. The array is assumed to start at element 1.  You may specify
  11738. the last element in the array, allowing you to sort only part
  11739. of an array if you like.
  11740.  
  11741. If you would like the results to be largest-to-smallest, rather
  11742. than smallest-to-largest, just call ReverseD after this routine.
  11743.  
  11744.    SortD Array#(), Elements%
  11745.  
  11746. Array#()    array to be sorted
  11747. Elements%   number of elements in array
  11748. -------
  11749. Array#()    sorted array
  11750.  
  11751. Name  : SortI                (Sort Integer)
  11752. Class : Array management
  11753. Level : Any
  11754.  
  11755. This routine sorts the elements in an array of integers.
  11756.  
  11757. The array is assumed to start at element 1.  You may specify
  11758. the last element in the array, allowing you to sort only part
  11759. of an array if you like.
  11760.  
  11761. If you would like the results to be largest-to-smallest, rather
  11762. than smallest-to-largest, just call ReverseI after this routine.
  11763.  
  11764.    SortI Array%(), Elements%
  11765.  
  11766. Array%()    array to be sorted
  11767. Elements%   number of elements in array
  11768. -------
  11769. Array%()    sorted array
  11770.  
  11771. Name  : SortL                (Sort Long integer)
  11772. Class : Array management
  11773. Level : Any
  11774.  
  11775. This routine sorts the elements in an array of long integers.
  11776.  
  11777. The array is assumed to start at element 1.  You may specify
  11778. the last element in the array, allowing you to sort only part
  11779. of an array if you like.
  11780.  
  11781. If you would like the results to be largest-to-smallest, rather
  11782. than smallest-to-largest, just call ReverseL after this routine.
  11783.  
  11784.    SortL Array&(), Elements%
  11785.  
  11786. Array&()    array to be sorted
  11787. Elements%   number of elements in array
  11788. -------
  11789. Array&()    sorted array
  11790.  
  11791. Name  : SortS                (Sort Single precision)
  11792. Class : Array management
  11793. Level : Any
  11794.  
  11795. This routine sorts the elements in an array of single-precision
  11796. numbers.
  11797.  
  11798. The array is assumed to start at element 1.  You may specify
  11799. the last element in the array, allowing you to sort only part
  11800. of an array if you like.
  11801.  
  11802. If you would like the results to be largest-to-smallest, rather
  11803. than smallest-to-largest, just call ReverseS after this routine.
  11804.  
  11805.    SortS Array!(), Elements%
  11806.  
  11807. Array!()    array to be sorted
  11808. Elements%   number of elements in array
  11809. -------
  11810. Array!()    sorted array
  11811.  
  11812. Name  : SortSt               (Sort String)
  11813. Class : Array management
  11814. Level : Any
  11815.  
  11816. This routine sorts the elements in a string array.
  11817.  
  11818. The array is assumed to start at element 1.  You may specify
  11819. the last element in the array, allowing you to sort only part
  11820. of an array if you like.  You can also specify whether the
  11821. capitalization of letters in a string should matter for sorting
  11822. purposes.
  11823.  
  11824. If you would like the results to be last-to-first, rather than
  11825. first-to-last, just call ReverseSt after this routine.
  11826.  
  11827.    SortSt Array$(), Elements%, CapsCount%
  11828.  
  11829. Array$()    array to be sorted
  11830. CapsCount%  use 0 if uppercase/lowercase doesn't matter
  11831. Elements%   number of elements in array
  11832. -------
  11833. Array$()    sorted array
  11834.  
  11835. Name  : Soundex              (Soundex code)
  11836. Class : String
  11837. Level : Any
  11838.  
  11839. This is a string comparison routine which returns a code that
  11840. is loosely based on the "sound" of a word.  It removes the
  11841. vowels and repeated characters from a word, then converts it
  11842. into a numeric code.  Any words with the same code are
  11843. considered to sound alike.
  11844.  
  11845. While not perfect, this algorithm does a fast and reasonably
  11846. good job.  It can be helpful in applications like spelling
  11847. checkers and phone books, where a search based on exact text
  11848. may not be appropriate.
  11849.  
  11850.    Code$ = St$
  11851.    Soundex St$, Code$, CodeLen%
  11852.    Code$ = LEFT$(St$, CodeLen%)
  11853.  
  11854. St$       string to be encoded
  11855. -------
  11856. Code$     result code.  Init to >= length of original string.
  11857. CodeLen%  length of the result code
  11858.  
  11859. Name  : SpeedKey             (Speed up Keyboard)
  11860. Class : Input
  11861. Level : BIOS (AT)
  11862.  
  11863. This routine provides control over the keyboard repeat rate for
  11864. AT-class machines.  Increasing the repeat rate can make the
  11865. computer seem a lot more responsive and pleasant to deal with.
  11866.  
  11867.   RepDelay%   Delay Time
  11868.      0        250 milliseconds
  11869.      1        500 ms
  11870.      2        750 ms
  11871.      3        1 second
  11872.  
  11873.   RepRate% is the key repeat rate, 0-31 (from around 30 cps to
  11874.   around 2 cps)
  11875.  
  11876.    SpeedKey RepDelay%, RepRate%
  11877.  
  11878. RepDelay%   delay before starting to repeat (0-3, default 1)
  11879. RepRate%    rate at which to repeat key (0-31, default 11)
  11880.  
  11881. Name  : Split                (Split screen image)
  11882. Class : Display
  11883. Level : Clone
  11884.  
  11885. This provides an elegant way to clear a text-mode screen.  It
  11886. splits the display into four parts, scrolling each part up or
  11887. down until it slides off the screen.
  11888.  
  11889.    Split
  11890.  
  11891. Name  : Spooler              (check for print Spooler)
  11892. Class : Printer
  11893. Level : DOS
  11894.  
  11895. The Spooler routine allows you to see whether the print spooler
  11896. (installed by the DOS PRINT utility) is available.
  11897.  
  11898.    Spooler Status%
  11899.  
  11900. -------
  11901. Status%   spooler status:
  11902.              -1   it's installed
  11903.               0   it isn't installed, but can be
  11904.               1   it isn't installed, and can't be
  11905.  
  11906. Name  : SSrch                (String Search)
  11907. Class : String
  11908. Level : Any
  11909.  
  11910. This is a string search routine which tells you whether one
  11911. string can be found inside another.  Uppercase/lowercase
  11912. distinctions are ignored.  Leading and trailing spaces in the
  11913. string for which to search are also ignored.
  11914.  
  11915. Note that the positions of the main string and search string
  11916. parameters are in the reverse of the order you might expect.
  11917.  
  11918.    SSrch Search$, MainSt$, Found%
  11919.  
  11920. Search$   string for which to search
  11921. MainSt$   string to be searched
  11922. -------
  11923. Found%    whether a match was found (0 if no)
  11924.  
  11925. Name  : StrDel               (String Delete)
  11926. Class : String
  11927. Level : Any
  11928.  
  11929. StrDel deletes a character from a string.  Actually, it doesn't
  11930. make the string any shorter, but it acts like a delete.  The
  11931. end of the string is filled with a space.
  11932.  
  11933.    StrDel St$, Posn%
  11934.  
  11935. St$       string from which to delete a character
  11936. Posn%     position of the character to delete (1-LEN(St$))
  11937. -------
  11938. St$       processed string
  11939.  
  11940. Name  : StrIns               (String Insert)
  11941. Class : String
  11942. Level : Any
  11943.  
  11944. StrIns inserts a space into a string.  Actually, it doesn't
  11945. make the string any longer, but it acts like an insert.  The
  11946. former end of the string is discarded.
  11947.  
  11948.    StrIns St$, Posn%
  11949.  
  11950. St$       string in which to insert a space
  11951. Posn%     where to insert the space (1-LEN(St$))
  11952. -------
  11953. St$       processed string
  11954.  
  11955. Name  : Strip                (Strip spaces)
  11956. Class : String
  11957. Level : Any
  11958.  
  11959. This routine strips both leading and trailing white space from
  11960. a string. This includes control characters as well as blanks
  11961. (anything below CHR$(33)).
  11962.  
  11963.    Strip St$
  11964.  
  11965. St$      string to process
  11966. -------
  11967. St$      processed string
  11968.  
  11969. Name  : Strip2$              (Strip Spaces)
  11970. Class : String
  11971. Level : Any
  11972.  
  11973. This routine strips both leading and trailing white space from
  11974. a string.  It works just like Strip, but is a function rather
  11975. than a subprogram.  White space includes control characters as
  11976. well as blanks (anything below CHR$(33)).
  11977.  
  11978.    Result$ = Strip2$(St$)
  11979.  
  11980. St$       string to process
  11981. -------
  11982. Result$   processed string
  11983.  
  11984. Name  : StripBlanks          (Strip Blanks)
  11985. Class : String
  11986. Level : Any
  11987.  
  11988. This routine strips leading and/or trailing white space from a
  11989. string.  This includes control characters as well as blanks
  11990. (anything below CHR$(33)).
  11991.  
  11992. See also StripSpaces.
  11993.  
  11994.    StripBlanks St$, Which%, StLen%
  11995.    St$ = LEFT$(St$, StLen%)
  11996.  
  11997. St$      string to process
  11998. Which%   1: strip left, 2: strip right, 3: strip left and right
  11999. -------
  12000. St$      processed string
  12001. StLen    length of processed string
  12002.  
  12003. Name  : StripChar            (Strip Characters)
  12004. Class : String
  12005. Level : Any
  12006.  
  12007. This routine strips all occurrences of a given list of
  12008. characters out of a string.  Among the uses for this are
  12009. cleaning up user-entered values.  For instance, a strip list of
  12010. "$," would remove commas and dollar signs from a number, and
  12011. "()- " will remove telephone delimiters.
  12012.  
  12013.    StripChar St$, StripList$, StLen%
  12014.    St$ = LEFT$(St$, StLen%)
  12015.  
  12016. St$         string to process
  12017. StripList$  characters to remove from the string
  12018. -------
  12019. St$         processed string
  12020. StLen%      length of processed string
  12021.  
  12022. Name  : StripRange           (Strip Range of characters)
  12023. Class : String
  12024. Level : Any
  12025.  
  12026. This routine strips an inclusive range of characters out of a
  12027. string.  The range is specified as the first and last ASCII
  12028. codes to strip.  For instance, using a low character of "0" and
  12029. a high of "9" would remove all digits from a string.
  12030.  
  12031.    StripRange St$, ASC(LowChar$), ASC(HighChar$), StLen%
  12032.    St$ = LEFT$(St$, StLen%)
  12033.  
  12034. St$         string to process
  12035. LowChar$    lowest character to strip
  12036. HighChar$   highest character to strip
  12037. -------
  12038. St$         processed string
  12039. StLen%      length of processed string
  12040.  
  12041. Name  : StripSpaces          (Strip Spaces)
  12042. Class : String
  12043. Level : Any
  12044.  
  12045. This routine strips leading and/or trailing spaces from a
  12046. string.
  12047.  
  12048. See also StripBlanks.
  12049.  
  12050.    StripSpaces St$, Which%, StLen%
  12051.    St$ = LEFT$(St$, StLen%)
  12052.  
  12053. St$      string to process
  12054. Which%   1: strip left, 2: strip right, 3: strip left and right
  12055. -------
  12056. St$      processed string
  12057. StLen%   length of processed string
  12058.  
  12059. Name  : StrSqu$              (String Squish)
  12060. Class : String
  12061. Level : Any
  12062.  
  12063. This is a text compression routine which uses 2-gram and 3-gram
  12064. compression to shrink a string.  It combines the best of the
  12065. StrSqu2 and StrSqu3 routines with additional ease of use. The
  12066. one limitation is that only plain text may be compressed; the
  12067. text may not contain CHR$(128) through CHR$(255), as these
  12068. codes are used by the compression algorithm.
  12069.  
  12070. The compressed text can be restored to original form with the
  12071. StrUnsq$ function.
  12072.  
  12073.    Result$ = StrSqu$(St$)
  12074.  
  12075. St$       string to compress
  12076. -------
  12077. Result$   compressed string
  12078.  
  12079. Name  : StrSqu2              (String Squish, 2-gram)
  12080. Class : String
  12081. Level : Any
  12082.  
  12083. This is a text compression routine which uses a 2-gram
  12084. algorithm to compress common pairs of characters out of a
  12085. string.  You can reasonably expect to reduce the text size by
  12086. about a third with this routine.  Compression is quite fast.
  12087. The one limitation is that only plain text may be compressed;
  12088. the text may not contain CHR$(128) through CHR$(255), as these
  12089. codes are used by the compression algorithm.
  12090.  
  12091. You must use StrSquLen2 before this routine to determine the
  12092. proper length to which to initialize the result string.
  12093.  
  12094. The compressed text can be restored to original form with
  12095. StrUnsqu2.
  12096.  
  12097.    StrSquLen2 St$, ResultLen%
  12098.    Result$ = SPACE$(ResultLen%)
  12099.    StrSqu2 St$, Result$
  12100.  
  12101. St$       string to compress
  12102. -------
  12103. Result$   compressed string
  12104.  
  12105. Name  : StrSqu3              (String Squish, 3-gram)
  12106. Class : String
  12107. Level : Any
  12108.  
  12109. This is a text compression routine which uses a 3-gram
  12110. algorithm to compress common triplets of characters out of a
  12111. string.  You can reasonably expect to reduce the text size by
  12112. about a third with this routine.  Compression is quite fast.
  12113. The one limitation is that only plain text may be compressed;
  12114. the text may not contain CHR$(128) through CHR$(255), as these
  12115. codes are used by the compression algorithm.
  12116.  
  12117. You must use StrSquLen3 before this routine to determine the
  12118. proper length to which to initialize the result string.
  12119.  
  12120. The compressed text can be restored to original form with
  12121. StrUnsqu3.
  12122.  
  12123.    StrSquLen3 St$, ResultLen%
  12124.    Result$ = SPACE$(ResultLen%)
  12125.    StrSqu3 St$, Result$
  12126.  
  12127. St$       string to compress
  12128. -------
  12129. Result$   compressed string
  12130.  
  12131. Name  : StrSquLen2           (String Squished Length, 2-gram)
  12132. Class : String
  12133. Level : Any
  12134.  
  12135. This routine is used in conjunction with the StrSqu2 text
  12136. compressor. It tells you what size the resulting text will be.
  12137. See StrSqu2 for further information.
  12138.  
  12139.    StrSquLen2 St$, ResultLen%
  12140.    Result$ = SPACE$(ResultLen%)
  12141.    StrSqu2 St$, Result$
  12142.  
  12143. St$          string to compress
  12144. -------
  12145. ResultLen%   length of the compressed string
  12146.  
  12147. Name  : StrSquLen3           (String Squished Length, 3-gram)
  12148. Class : String
  12149. Level : Any
  12150.  
  12151. This routine is used in conjunction with the StrSqu3 text
  12152. compressor. It tells you what size the resulting text will be.
  12153. See StrSqu3 for further information.
  12154.  
  12155.    StrSquLen3 St$, ResultLen%
  12156.    Result$ = SPACE$(ResultLen%)
  12157.    StrSqu3 St$, Result$
  12158.  
  12159. St$          string to compress
  12160. -------
  12161. ResultLen%   length of the compressed string
  12162.  
  12163. Name  : StrUnsq$             (String Unsquish)
  12164. Class : String
  12165. Level : Any
  12166.  
  12167. This routine decompresses text which was compressed by the
  12168. StrSqu$ function.
  12169.  
  12170.    Result$ = StrUnsq$(St$)
  12171.  
  12172. St$       string to decompress
  12173. -------
  12174. Result$   decompressed string
  12175.  
  12176. Name  : StrUnsqu2            (String Unsquish, 2-gram)
  12177. Class : String
  12178. Level : Any
  12179.  
  12180. This routine decompresses text which was compressed by
  12181. StrSqu2.  Text is decompressed at lightning speed, as this
  12182. routine has no overhead to speak of.
  12183.  
  12184. You must use StrUnsquLen2 before this routine to determine the
  12185. proper length to which to initialize the result string.
  12186.  
  12187.    StrUnsquLen2 St$, ResultLen%
  12188.    Result$ = SPACE$(ResultLen%)
  12189.    StrUnsqu2 St$, Result$
  12190.  
  12191. St$       string to decompress
  12192. -------
  12193. Result$   decompressed string
  12194.  
  12195. Name  : StrUnsqu3            (String Unsquish, 3-gram)
  12196. Class : String
  12197. Level : Any
  12198.  
  12199. This routine decompresses text which was compressed by
  12200. StrSqu3.  Text is decompressed at lightning speed, as this
  12201. routine has no overhead to speak of.
  12202.  
  12203. You must use StrUnsquLen3 before this routine to determine the
  12204. proper length to which to initialize the result string.
  12205.  
  12206.    StrUnsquLen3 St$, ResultLen%
  12207.    Result$ = SPACE$(ResultLen%)
  12208.    StrUnsqu3 St$, Result$
  12209.  
  12210. St$       string to decompress
  12211. -------
  12212. Result$   decompressed string
  12213.  
  12214. Name  : StrUnsquLen2         (String Unsquished Length, 2-gram)
  12215. Class : String
  12216. Level : Any
  12217.  
  12218. This routine is used in conjunction with the StrUnsqu2 text
  12219. decompressor. It tells you what size the resulting text will
  12220. be.  See StrUnsqu2 for further information.
  12221.  
  12222.    StrUnsquLen2 St$, ResultLen%
  12223.    Result$ = SPACE$(ResultLen%)
  12224.    StrUnsqu2 St$, Result$
  12225.  
  12226. St$          string to decompress
  12227. -------
  12228. ResultLen%   length of the decompressed string
  12229.  
  12230. Name  : StrUnsquLen3         (String Unsquished Length, 3-gram)
  12231. Class : String
  12232. Level : Any
  12233.  
  12234. This routine is used in conjunction with the StrUnsqu3 text
  12235. decompressor. It tells you what size the resulting text will
  12236. be.  See StrUnsqu3 for further information.
  12237.  
  12238.    StrUnsquLen3 St$, ResultLen%
  12239.    Result$ = SPACE$(ResultLen%)
  12240.    StrUnsqu3 St$, Result$
  12241.  
  12242. St$          string to decompress
  12243. -------
  12244. ResultLen%   length of the decompressed string
  12245.  
  12246. Name  : SubExist             (Subdirectory Existence)
  12247. Class : Disk
  12248. Level : DOS
  12249.  
  12250. This routine lets you see if a given drive and/or subdirectory
  12251. actually exists.
  12252.  
  12253. See also SubExist2, the FUNCTION version of this routine.
  12254.  
  12255.    SubExist SubDir$, Found%
  12256.  
  12257. SubDir$   name of the path to check
  12258. -------
  12259. Found%    whether the path exists (0 if no, -1 if yes)
  12260.  
  12261. Name  : SubExist2%           (Subdirectory Existence)
  12262. Class : Disk
  12263. Level : DOS
  12264.  
  12265. This routine lets you see if a given drive and/or subdirectory
  12266. actually exists.
  12267.  
  12268. See also SubExist, the SUB version of this routine.
  12269.  
  12270.    Found% = SubExist2%(SubDir$)
  12271.  
  12272. SubDir$   name of the path to check
  12273. -------
  12274. Found%    whether the path exists (0 if no, -1 if yes)
  12275.  
  12276. Name  : Time2Int             (Time to Integer)
  12277. Class : Time
  12278. Level : Any
  12279.  
  12280. This routine compresses a time into a single integer.  Note
  12281. that this integer is not in a format that lends itself to
  12282. simple computation-- you cannot subtract one from another to
  12283. find out the length of time between them.  If that's what you
  12284. want, try the Elapsed routine.
  12285.  
  12286. Note that odd numbers of seconds will be rounded down to the
  12287. previous even number.  This is a result of the storage format
  12288. used.
  12289.  
  12290.    Time2Int HourNr%, MinuteNr%, SecondNr%, IntTimeNr%
  12291.  
  12292. HourNr%      hour (0-23)
  12293. MinuteNr%    minute
  12294. SecondNr%    second
  12295. -------
  12296. IntTime%     time compressed into an integer
  12297.  
  12298. Name  : Time2Sec&            (Time to Seconds)
  12299. Class : Time
  12300. Level : Any
  12301.  
  12302. This routine converts a time string into the number of seconds
  12303. past midnight. This is convenient if you want to find the
  12304. difference between two times or to calculate what time it will
  12305. be after a given interval.
  12306.  
  12307.    Seconds& = Time2Sec&(TimeSt$)
  12308.  
  12309. TimeSt$    time string (TIME$ format)
  12310. -------
  12311. Seconds&   number of seconds past midnight
  12312.  
  12313. Name  : TimeN2S              (Time Numbers to String)
  12314. Class : Time
  12315. Level : Any / DOS
  12316.  
  12317. Many of the PBClone routines return the time as a set of
  12318. numbers.  This routine provides an easy way to convert those
  12319. numbers into string form.  The time format used (whether
  12320. seconds are included) will be based on the length of the string
  12321. which you pass to the routine.  For instance, a string like
  12322. "xx:xx" would return a time like "21:35", whereas "xx:xx:xx"
  12323. would return "21:35:08".
  12324.  
  12325.    TimeSt$ = "xx:xx:xx"
  12326.    TimeN2S HourNr%, MinuteNr%, SecondNr%, TimeSt$
  12327.  
  12328. HourNr%     hour (0-23)
  12329. MinuteNr%   minute
  12330. SecondNr%   second
  12331. -------
  12332. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  12333.  
  12334. Name  : TimeS2N              (Time String to Numbers)
  12335. Class : Time
  12336. Level : Any
  12337.  
  12338. Many of the PBClone routines need to be passed the time as a
  12339. set of numbers. This routine provides an easy way to convert a
  12340. time from string form into numbers.  You may use either
  12341. "xx:xx:xx" or "xx:xx" form to specify the time (the string
  12342. length is important, but the delimiter and contents of the
  12343. string are ignored).  If the 5-character short form is used,
  12344. the Second% value will be zero.
  12345.  
  12346.    TimeS2N HourNr%, MinuteNr%, SecondNr%, TimeSt$
  12347.  
  12348. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  12349. -------
  12350. HourNr%     hour (0-23)
  12351. MinuteNr%   minute
  12352. SecondNr%   second (0 if 5-char format)
  12353.  
  12354. Name  : TInstr               (Typed INSTR)
  12355. Class : String
  12356. Level : Any
  12357.  
  12358. As you might guess from the "Instr" part of the name, this
  12359. routine searches a string.  Instead of searching for a specific
  12360. character or substring, though, it looks for a specific type of
  12361. character-- letters, numbers, control codes, or whatever.  You
  12362. can search for the first of a combination of types, too, which
  12363. also allows searching for "anything but" a specific type.
  12364.  
  12365. The character type code is specified by adding any of the
  12366. following:
  12367.  
  12368.     1    alphabetic
  12369.     2    numeric
  12370.     4    symbolic
  12371.     8    control
  12372.    16    graphics
  12373.    32    space
  12374.  
  12375. The TInstr routine is handy for parsing and cleaning up user
  12376. input, among other uses.
  12377.  
  12378.    TInstr St$, ChrType%, Place%
  12379.  
  12380. St$          string to search
  12381. ChrType%     type of character(s) to search for
  12382. -------
  12383. Place%       position of first char of desired type, or 0
  12384.  
  12385. Name  : ToPostal$            (To Postal Abbreviation)
  12386. Class : String
  12387. Level : Any
  12388.  
  12389. This function returns the two-letter U.S. postal abbreviation
  12390. corresponding to a given place name.  It handles all valid
  12391. abbreviations, including states (e.g., "AZ" = "Arizona") and a
  12392. number of other countries (e.g., "PR" = "Puerto Rico").
  12393.  
  12394. A null string ("") is returned if the specified place can't be
  12395. abbreviated.  Capitalization is not important, but spelling is.
  12396. This function is best used with validated input.  If you have
  12397. control of the input method, consider using a "pick list" menu.
  12398. Otherwise, a fuzzy scanner would be appropriate, using perhaps
  12399. the Bickel and/or Soundex routines to find the closest match if
  12400. a perfect match is not found.
  12401.  
  12402. The conversion can also be done the other way around-- see the
  12403. FromPostal$ function.
  12404.  
  12405.    Abbrev$ = ToPostal$(PlaceName$)
  12406.  
  12407. PlaceName$   place name to abbreviate
  12408. -------
  12409. Abbrev$      two-letter postal abbreviation
  12410.  
  12411. Name  : TVIdle               (TopView Idle)
  12412. Class : Miscellaneous
  12413. Level : BIOS
  12414.  
  12415. If your program is running under TopView or a compatible
  12416. multitasker, such as DESQview, it can take advantage of this
  12417. routine to give up the rest of its time slice.  This would
  12418. normally done at a point where the program is liable to be idle
  12419. for a brief while, such as during user input.
  12420.  
  12421. The advantage of giving up part of your program's time when you
  12422. can afford it is that any other running programs will be able
  12423. to make use of it, hence improving overall system performance.
  12424.  
  12425.    TVIdle
  12426.  
  12427. Name  : TypeIn               (Type In)
  12428. Class : Input
  12429. Level : Clone
  12430.  
  12431. This is an unusual routine which combines both output and
  12432. input.  It sends a string to the keyboard buffer, where it acts
  12433. as if it had been typed in by someone.  The string may be up to
  12434. 15 key codes in length (anything past 15 keys will be ignored,
  12435. due to the limited length of the keyboard buffer).
  12436.  
  12437. Normal keys can be put into the string simply as characters.
  12438. Extended keys, like Alt-key combinations, arrow keys, and
  12439. function keys, must be encoded as CHR$(0) + CHR$(ScanCode),
  12440. where the ScanCode is the key's scan code.  You can look up
  12441. such scan codes in your BASIC manual or use GetKey to find out
  12442. what they are.  Extended keys, although apparently taking up
  12443. two characters, only take up one space in the keyboard buffer.
  12444. The TypeIn routine allows for this fact.
  12445.  
  12446. Among other things, this routine can be used to provide default
  12447. answers to input routines, or to execute another program once
  12448. your program exits.
  12449.  
  12450.    TypeIn St$
  12451.  
  12452. St$     keys to be "typed" into the keyboard buffer
  12453.  
  12454. Name  : TypePrint            (Type Print)
  12455. Class : Display
  12456. Level : Clone
  12457.  
  12458. TypePrint displays a string as if it was being typed.  The
  12459. string is displayed a character at a time, with a delay between
  12460. each character.  You may choose one color to highlight the
  12461. just-displayed character and another color for the character to
  12462. turn after the delay is done.
  12463.  
  12464.    TypePrint St$, Row%, Column%, WaitTime%, TmpAttr%, _
  12465.       VAttr%, Fast%
  12466.  
  12467. St$        string to display
  12468. Row%       row at which to display string
  12469. Column%    column at which to display string
  12470. WaitTime%  delay between chars (milliseconds; 20-60 is decent)
  12471. TmpAttr%   color/attribute for just-displayed character
  12472. VAttr%     color/attribute for character after the delay is up
  12473. Fast%      whether to use fast displays (0 no)
  12474.  
  12475. Name  : UnCalcAttr           (Undo Calculated Attribute)
  12476. Class : Display
  12477. Level : Any
  12478.  
  12479. Many of the display routines in this library require an
  12480. "attribute" rather than foreground and background colors.  An
  12481. attribute is a combination of the foreground and background
  12482. colors in a format which is used by all types of displays when
  12483. in text mode.  The UnCalcAttr routine allows you to decode the
  12484. original colors given the attribute.
  12485.  
  12486. Foreground colors are usually specified as 0-31, with
  12487. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  12488. may be more convenient to express the same thing as foreground
  12489. 0-15, background 0-15.  The CalcAttr routine will accept either
  12490. way of expressing it.
  12491.  
  12492. Note, however, that UnCalcAttr will always return the former
  12493. pair of results, since it has no way of knowing whether Blink
  12494. has been used (foreground 0-31, background 0-15).  The below
  12495. routine shows how to get around this, if needed.
  12496.  
  12497.    UnCalcAttr Foreground%, Background%, VAttr%
  12498.    ' the following is optional and may not be desired...
  12499.    ' it converts colors to "no blink" equivalents (see above)
  12500.    IF Foreground% AND 16 THEN
  12501.       Foreground% = Foreground% - 16
  12502.       Background% = Background% + 8
  12503.    END IF
  12504.  
  12505. VAttr%        color "attribute"
  12506. -------
  12507. Foreground%   foreground color
  12508. Background%   background color
  12509.  
  12510. Name  : UnSCrunch            (Undo Screen Crunch)
  12511. Class : Display
  12512. Level : Any
  12513.  
  12514. This routine is designed to be used in conjunction with ScrRest
  12515. and the other routines which restore an entire 80x25 text
  12516. screen from an array.  It expands screens that were compressed
  12517. by SCrunch to their full original size. The uncompression
  12518. algorithm is very fast and will not take any noticeable amount
  12519. of time for most purposes.
  12520.  
  12521. If your original screen was not 80x25 in size, use the
  12522. UnSCrunchSS routine instead.
  12523.  
  12524.    REDIM FullScreen%(1 TO 2000)
  12525.    DSeg% = VARSEG(FullScreen%(1))
  12526.    DOfs% = VARPTR(FullScreen%(1))
  12527.    UnSCrunch DSeg%, DOfs%, CSeg%, COfs%
  12528.  
  12529. DSeg%     segment of array in which to store expanded image
  12530. DOfs%     offset of array in which to store expanded image
  12531. CSeg%     segment of the compressed image
  12532. COfs%     offset of the compressed image
  12533.  
  12534. Name  : UnSCrunchSS          (Undo Screen Crunch Sized Screen)
  12535. Class : Display
  12536. Level : Any
  12537.  
  12538. This routine is designed to be used in conjunction with ScrRest
  12539. and the other routines which restore a text screen from an
  12540. array.  It expands screens that were compressed by SCrunchSS or
  12541. SCrunch to their full original size.  The uncompression
  12542. algorithm is very fast and will not take any noticeable amount
  12543. of time for most purposes.
  12544.  
  12545. If your original screen was 80x25 in size, you may find it
  12546. convenient to use the UnSCrunch routine instead.
  12547.  
  12548.    REDIM FullScreen%(1 TO Rows% * Cols%)
  12549.    DSeg% = VARSEG(FullScreen%(1))
  12550.    DOfs% = VARPTR(FullScreen%(1))
  12551.    UnSCrunchSS DSeg%, DOfs%, Rows%, Cols%, CSeg%, COfs%
  12552.  
  12553. DSeg%     segment of array in which to store expanded image
  12554. DOfs%     offset of array in which to store expanded image
  12555. Rows%     rows in image
  12556. Cols%     columns in image
  12557. CSeg%     segment of the compressed image
  12558. COfs%     offset of the compressed image
  12559.  
  12560. Name  : UnSplit              (Undo Split)
  12561. Class : Display
  12562. Level : Clone
  12563.  
  12564. This routine does the opposite of Split-- instead of clearing
  12565. the screen by scrolling it in different directions, it puts
  12566. text on the screen by scrolling it on from different
  12567. locations.  The effect is quite stunning.
  12568.  
  12569. The information to place on the screen comes from an array that
  12570. you specify which contains a saved screen.  Only 80x25 text
  12571. modes are supported.  Any of the screen save routines (e.g.,
  12572. ScrSave) may be used to load the array.  In a typical case, you
  12573. will use this routine with screens that were created in advance
  12574. and stored to disk for use by your program.
  12575.  
  12576.    UnSplit Scrn%(), Fast%
  12577.  
  12578. Scrn%()   array containing the text to display
  12579. Fast%     whether to use fast mode (0 no)
  12580.  
  12581. Name  : Upcase               (Uppercase)
  12582. Class : String
  12583. Level : Any
  12584.  
  12585. This routine, like BASIC's UCASE$ function, converts a string
  12586. to uppercase. Since it doesn't have to create a new return
  12587. string (a fairly slow process), it's faster than the BASIC
  12588. equivalent.
  12589.  
  12590. The Upcase routine is designed for the U.S. character set.  If
  12591. your program is intended for distribution, you would be well
  12592. advised to use Upcase1 instead, as it supports international
  12593. character sets.
  12594.  
  12595.    Upcase St$
  12596.  
  12597. St$     string to be capitalized
  12598. -------
  12599. St$     capitalized string
  12600.  
  12601. Name  : Upcase1              (Uppercase)
  12602. Class : String
  12603. Level : DOS
  12604.  
  12605. This routine, like BASIC's UCASE$ function, converts a string
  12606. to uppercase. It converts letters in the extended character set
  12607. as well as the usual letters, making it well suited for text
  12608. which may not be in English.
  12609.  
  12610. Note that DOS 5.0 is required for optimal performance.  With
  12611. older DOS versions, this routine makes assumptions about the
  12612. character set which may not be appropriate.
  12613.  
  12614.    Upcase1 St$
  12615.  
  12616. St$     string to be capitalized
  12617. -------
  12618. St$     capitalized string
  12619.  
  12620. Name  : UpcaseI%             (Uppercase Integer char)
  12621. Class : Numeric
  12622. Level : Any
  12623.  
  12624. This function converts a character to uppercase.  Rather than
  12625. taking a string parameter, though, UpcaseI% works on an integer
  12626. which contains an ASCII code.
  12627.  
  12628. The UpcaseI% function is designed for the U.S. character set.
  12629. If your program is intended for distribution, you would be well
  12630. advised to use UpcaseI1% instead, as it supports international
  12631. character sets.
  12632.  
  12633.    CapCh% = UpcaseI%(Ch%)
  12634.  
  12635. Ch%      character to be capitalized
  12636. -------
  12637. CapCh%   capitalized character
  12638.  
  12639. Name  : UpcaseI1%            (Uppercase Integer char)
  12640. Class : Numeric
  12641. Level : DOS
  12642.  
  12643. This function converts a character to uppercase.  Rather than
  12644. taking a string parameter, though, UpcaseI% works on an integer
  12645. which contains an ASCII code.
  12646.  
  12647. Note that DOS 5.0 is required for optimal performance.  With
  12648. older DOS versions, this routine makes assumptions about the
  12649. character set which may not be appropriate.
  12650.  
  12651.    CapCh% = UpcaseI1%(Ch%)
  12652.  
  12653. Ch%      character to be capitalized
  12654. -------
  12655. CapCh%   capitalized character
  12656.  
  12657. Name  : UpdTVScreen          (Update TopView Screen)
  12658. Class : Display
  12659. Level : BIOS
  12660.  
  12661. UpdTVScreen tells a TopView-compatible multitasker to update
  12662. the screen using a specified screen buffer (use GetTVScreen to
  12663. get the buffer location).  Some multitaskers will do this
  12664. automatically, but some won't.  It's safe to use this routine
  12665. either way.
  12666.  
  12667. See also GetDView, GetTView, GetTVScreen.
  12668.  
  12669.    UpdTVScreen DSeg%, DOfs%
  12670.  
  12671. DSeg%       segment of screen buffer
  12672. DOfs%       offset of screen buffer
  12673.  
  12674. Name  : ValidSt%             (Valid String)
  12675. Class : String
  12676. Level : Any
  12677.  
  12678. This function is used for string validation.  It lets you make
  12679. sure that a string contains only approved characters.  If the
  12680. string contains any characters that aren't in the approved
  12681. list, 0 is returned; otherwise, -1 is returned.
  12682.  
  12683.    IsValid% = ValidSt%(St$, GoodCh$)
  12684.  
  12685. St$          string to validate
  12686. GoodCh$      characters which may be in the string
  12687. -------
  12688. IsValid%     whether the string is valid (0 no, -1 yes)
  12689.  
  12690. Name  : VGARest13            (VGA Restore for SCREEN 13)
  12691. Class : Display
  12692. Level : Clone
  12693.  
  12694. This routine allows you to restore a SCREEN 13 (VGA, 320x200,
  12695. 256 color) display that was saved using VGASave13 (see).
  12696.  
  12697.    VGARest13 DSeg%, DOfs%
  12698.  
  12699. DSeg%        segment of storage array, returned by VARSEG
  12700. DOfs%        offset  of storage array, returned by VARPTR
  12701.  
  12702. Name  : VGASave13            (VGA Save of SCREEN 13)
  12703. Class : Display
  12704. Level : Clone
  12705.  
  12706. This routine allows you to save a SCREEN 13 (VGA, 320x200, 256
  12707. color) display that can be restored using VGARest13 (see).
  12708.  
  12709. The array used to hold the screen must contain 64,000 bytes.
  12710. For an integer array, this means that you must create the array
  12711. by DIM Array%(1 TO 32000).
  12712.  
  12713.    VGASave13 DSeg%, DOfs%
  12714.  
  12715. DSeg%        segment of storage array, returned by VARSEG
  12716. DOfs%        offset  of storage array, returned by VARPTR
  12717.  
  12718. Name  : Weekday0             (Weekday)
  12719. Class : Time
  12720. Level : DOS
  12721.  
  12722. This routine tells you what the day of the week is, just the
  12723. thing for calendar programs and whatnot.  The day is returned
  12724. as a number from 1-7, which identifies a day from Sunday
  12725. through Saturday.
  12726.  
  12727.    Weekday0 DayNr%
  12728.  
  12729. -------
  12730. DayNr%     current day
  12731.  
  12732. Name  : Weekday1             (Weekday)
  12733. Class : Time
  12734. Level : Any
  12735.  
  12736. This routine tells you the day of the week for any given date.
  12737. A shortcut is available if you just want the day of the week
  12738. for today's date-- use zero (or less) for the MonthNr% or
  12739. DayNr% values.
  12740.  
  12741.    Weekday1 MonthNr%, DayNr%, YearNr%, DayName$
  12742.  
  12743. MonthNr%     month number (1-12)
  12744. DayNr%       day number (1-31)
  12745. YearNr%      year number (1900 on)
  12746. -------
  12747. DayName$     day of the week (e.g., "Tuesday")
  12748.  
  12749. Name  : WinCheck             (Windows Check)
  12750. Class : Equipment
  12751. Level : BIOS
  12752.  
  12753. The WinCheck routine tells you what version of Microsoft
  12754. Windows is in use, if any.  It returns the results as two
  12755. integers containing the major and minor version numbers.  For
  12756. instance, Windows 3.0 would return a major number of 3, minor
  12757. 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  12758. not running, 0.0 will be returned.  NOTE that this routine is
  12759. not able to detect Windows 1.x versions!
  12760.  
  12761.    WinCheck MajorV%, MinorV%
  12762.  
  12763. -------
  12764. MajorV%   major part of the Windows version
  12765. MinorV%   minor part of the Windows version
  12766.  
  12767. Name  : WindowMan2           (Window Manager)
  12768. Class : Display
  12769. Level : Clone
  12770.  
  12771. This routine is identical to WindowManager but for the fact
  12772. that it allows you to design your own custom window frames.
  12773. Please see the description of WindowManager for general
  12774. information.
  12775.  
  12776. These are the additional frame types:
  12777.     6   custom frame composed of a single character
  12778.     7   custom frame composed of the specified 7-character list:
  12779.         top left corner, top middle, top right corner,
  12780.         left middle, right middle,
  12781.         bottom left corner, bottom middle, bottom right corner
  12782.  
  12783.  /------------------------------------------------------------\
  12784.  | A custom frame like this would be defined as frame type 7, |
  12785.  | with a frame string of "/-\||\-/", for instance.           |
  12786.  \------------------------------------------------------------/
  12787.  
  12788.  *************************************************
  12789.  * On the other hand, a frame like this would be *
  12790.  * frame type 6, with a frame string of "*".     *
  12791.  *************************************************
  12792.  
  12793. Note that this routine differs from the ProBas equivalent in
  12794. that it supports full frame definitions through frame type 7
  12795. (ProBas only supports type 6). The other differences mentioned
  12796. under WindowManager are also relevant.
  12797.  
  12798.    WindowMan2 TRow%, LCol%, BRow%, RCol%, Frame%, FSt$,
  12799.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  12800.  
  12801. TRow%       top row of window
  12802. LCol%       left column of window
  12803. BRow%       bottom row of window
  12804. RCol%       right column of window
  12805. Frame%      frame type (see above)
  12806. FSt$        frame definition string (see above)
  12807. Fore%       frame foreground color
  12808. Back%       frame background color
  12809. Grow%       window growing option (see above)
  12810. Shade%      window shadow option (see above)
  12811. TFore%      title foreground color
  12812. Title$      window title ("" if none)
  12813. Page%       display page (normally zero)
  12814. Fast%       whether to use fast mode (0 no)
  12815.  
  12816. Name  : WindowMan3           (Window Manager)
  12817. Class : Display
  12818. Level : Clone
  12819.  
  12820. This routine is identical in function to WindowManager.  The
  12821. parameters are mostly passed as an array, however, instead of
  12822. one by one.  Please see the description of WindowManager for
  12823. general information.
  12824.  
  12825.    WindowMan3 Parm%(), Title$
  12826.  
  12827. Parm%(1)    top row of window
  12828. Parm%(2)    left column of window
  12829. Parm%(3)    bottom row of window
  12830. Parm%(4)    right column of window
  12831. Parm%(5)    frame type (see above)
  12832. Parm%(6)    frame foreground color
  12833. Parm%(7)    frame background color
  12834. Parm%(8)    window growing option (see above)
  12835. Parm%(9)    window shadow option (see above)
  12836. Parm%(10)   title foreground color
  12837. Parm%(11)   display page (normally zero)
  12838. Parm%(12)   whether to use fast mode (0 no)
  12839. Title$      window title ("" if none)
  12840.  
  12841. Name  : WindowMan4           (Window Manager)
  12842. Class : Display
  12843. Level : Clone
  12844.  
  12845. This is an extremely cut-down version of WindowManager,
  12846. providing no more than a simple frame generator.
  12847.  
  12848. These are the available frame types:
  12849.     0   no frame
  12850.     1   single lines
  12851.     2   double lines
  12852.     3   single horizontal, double vertical lines
  12853.     4   double horizontal, single vertical lines
  12854.     5   block graphic lines
  12855.  
  12856. Note that this routine is different from its ProBas equivalent
  12857. in that a new frame type (5) is available.
  12858.  
  12859.    WindowMan4 TRow%, LCol%, BRow%, RCol%, Frame%, VAttr%, _
  12860.       Page%, Fast%
  12861.  
  12862. TRow%       top row of window
  12863. LCol%       left column of window
  12864. BRow%       bottom row of window
  12865. RCol%       right column of window
  12866. Frame%      frame type (see above)
  12867. VAttr%      frame color/attribute (use CalcAttr)
  12868. Page%       display page (normally zero)
  12869. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  12870.  
  12871. Name  : WindowManager        (Window Manager)
  12872. Class : Display
  12873. Level : Clone
  12874.  
  12875. WindowManager displays a pop-up window according to your
  12876. specifications.  The window may have any of a variety of
  12877. frames, a title, or a shadow, and it may appear instantly or
  12878. "grow" onto the screen.  Only text mode is supported.
  12879.  
  12880. These are the available frame types:
  12881.     0   no frame
  12882.     1   single lines
  12883.     2   double lines
  12884.     3   single horizontal, double vertical lines
  12885.     4   double horizontal, single vertical lines
  12886.     5   block graphic lines
  12887.  
  12888. These are the available shadows:
  12889.    -3   transparent shadow on the right
  12890.    -2   transparent shadow on the left
  12891.    -1   solid black shadow on the left
  12892.     0   no shadow
  12893.    1+   shadow attribute (use CalcAttr) for a colored shadow
  12894.  
  12895. Options for growing windows are as follows:
  12896.    -1   grow as fast as possible
  12897.     0   pop onto the screen
  12898.    1+   grow with delay given in milliseconds (15 works for me)
  12899.  
  12900. Note that this routine is different from its ProBas equivalent
  12901. in a number of respects.  The grow delay time is different.
  12902. Growing is done more smoothly. The shadow and title parameters
  12903. are not changed by this routine.  A new frame type (5) was
  12904. added.  If a title is too long, it is truncated instead of
  12905. being ignored completely.  Using a -1 as the title foreground
  12906. color will not turn off the title; instead, use a null title
  12907. 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
  12933. numbers of a bit length that you specify (1-8).  This provides
  12934. efficient 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
  12972. BASIC has a UCASE$ function and PBClone has an Upcase routine.
  12973. Well, Upcase is faster than UCASE$, since it doesn't have to
  12974. create a return string; but Xlate would be even faster, since
  12975. it translates every character directly instead of deciding
  12976. whether 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
  12997. allows you to display using DOS services while being able to
  12998. translate or screen out characters.  Each character of the
  12999. string to display is passed through a translation table you
  13000. provide (256 bytes, where each position corresponds directly to
  13001. the ASCII code of the same number [0-255]).  If the result is
  13002. 0, the character is not displayed.  Otherwise, the translated
  13003. character is displayed using DOS display services.  The new
  13004. cursor position is returned so you can inform BASIC about it.
  13005.  
  13006. Note that the new cursor position may not be accurate!  Some
  13007. ANSI drivers do not update the BIOS cursor position info, in
  13008. which case the results won't be useful.  That's a hazard of
  13009. using DOS 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
  13025. corresponding byte in a second string.  The strings must be the
  13026. same length.
  13027.  
  13028.    XorSt St1$, St2$
  13029.  
  13030. St1$      string to XOR
  13031. St2$      string to XOR with
  13032. -------
  13033. St1$      result
  13034.  
  13035. Name  : XQPrint              (Extended Quick Print)
  13036. Class : Display
  13037. Level : Clone
  13038.  
  13039. This routine provides a rather crude, but very fast, display
  13040. capability.  It works like the PRINT statement in BASIC, except
  13041. that it doesn't move the cursor or process control codes.  It
  13042. works only in text modes.
  13043.  
  13044. See also QPrint, a slightly less flexible (but even faster)
  13045. routine.
  13046.  
  13047. The results of this routine are not redirectable by DOS.
  13048.  
  13049.    XQPrint St$, Row%, Column%, VAttr%, Page%, Fast%
  13050.  
  13051. St$       string to display
  13052. Row%      starting row
  13053. Column%   starting column
  13054. VAttr%    color/attribute (see CalcAttr)
  13055. Page%     display page (unused on MDA/Herc; normally 0)
  13056. Fast%     whether to use fast mode (0 no)
  13057.  
  13058. Name  : XQPrintOver          (Extended Quick Print Overwrite)
  13059. Class : Display
  13060. Level : Clone
  13061.  
  13062. This routine provides a rather crude, but very fast, display
  13063. capability.  It works like the PRINT statement in BASIC, except
  13064. that it doesn't move the cursor or process control codes.  It
  13065. works only in text modes.
  13066.  
  13067. This is a slightly unusual variant on a print routine.  It
  13068. displays all characters except spaces.  If your string contains
  13069. a space, that position on the screen will be skipped.  In other
  13070. words, it acts kind of like an overlay. This can be handy when
  13071. you have text in alternating colors.
  13072.  
  13073. I came up with this routine when I designed a program with a
  13074. function key display at the bottom of the screen-- the names of
  13075. the function keys were one color and the associated definitions
  13076. were another color.  It was obvious that the easiest way of
  13077. handling that would be to use an "overlay" approach.  The
  13078. function key definitions were laid down with XQPrint.  I then
  13079. overlaid the line with the function key names in a different
  13080. color, using XQPrintOver.
  13081.  
  13082. If you need a "solid" space, rather than a "transparent" space,
  13083. use CHR$(255) instead of CHR$(32).
  13084.  
  13085. The results of this routine are not redirectable by DOS.
  13086.  
  13087.    XQPrintOver St$, Row%, Column%, VAttr%, Page%, Fast%
  13088.  
  13089. St$       string to display
  13090. Row%      starting row
  13091. Column%   starting column
  13092. VAttr%    color/attribute (see CalcAttr)
  13093. Page%     display page (unused on MDA/Herc; normally 0)
  13094. Fast%     whether to use fast mode (0 no)
  13095.  
  13096.