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

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