home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / basic / dframe45 / pbc-subs.doc < prev   
Encoding:
Text File  |  1993-07-19  |  43.9 KB  |  1,393 lines

  1.  
  2.  The following routines are available for your use. DoorFrame itself does not
  3. use most of the routines so you may retain or delete them from DFRAME.LIB as
  4. you see fit (the ones DoorFrame uses are noted - DON'T DELETE THEM!). The
  5. library is modularized so if you don't CALL a routine in your code, it will
  6. not be included in the final .EXE file. Since these routines come from the
  7. PBClone library by Tom Hanlin, I have taken the liberty of including his
  8. descriptions of the routines.
  9.  
  10. Name  : BigPrint             (Called by DoorFrame - DON'T DELETE!)
  11. Class : Display
  12. Level : BIOS
  13.  
  14. As the name suggests, this routine displays text in large
  15. characters.  How large?  Eight times as high and as wide as
  16. normal!  Each "big character" will be composed of many
  17. normal-sized characters.  You may choose the normal character
  18. used to create the big characters (the default is a CHR$(219)
  19. solid block character, if you pass a null string here).
  20.  
  21. You should avoid using CHR$(128) to CHR$(255) when in either of
  22. the CGA graphics modes, as many CGAs are unable to display
  23. these characters when in graphics mode.
  24.  
  25.    BigPrint St$, FormCh$, Row%, Column%, Attr%
  26.  
  27. St$       string to display in big characters
  28. FormCh$   character used to compose the big characters
  29. Row%      starting row
  30. Column%   starting column
  31. Attr%     color/attribute of big characters (see CalcAttr)
  32.           NOTE: This is a local only procedure. It will NOT be sent to the
  33.                 remote computer!
  34.  
  35.  
  36. Name  : CalcAttr                (Called by DoorFrame - DON'T DELETE!)
  37. Class : Display
  38. Level : Any
  39.  
  40. An attribute is a combination of the foreground and background colors in a 
  41. format which is used by all types of displays when in text mode. 
  42.  
  43. Foreground colors are usually specified as 0-15, with backgrounds as 0-7.
  44.  
  45.    CalcAttr Foreground%, Background%, Attr%
  46.  
  47. Foreground%  foreground color
  48. Background%  background color
  49. -------
  50. Attr%        color "attribute"
  51.  
  52.  
  53. Name  : CalcDate             (Calculate Date)
  54. Class : Time
  55. Level : Any
  56.  
  57. This routine calculates what the date will be a given number of
  58. days from now, either in the past or the future.  Actually, you
  59. may use any starting date, not just the current date.  An error
  60. code is returned if the starting date or resulting date are not
  61. valid.  Dates may not preceed January 1, 1900.
  62.  
  63. CalcDate accepts the date in any standard form ("01/30/91" or
  64. "01-30-1991", for example) and returns its results in the same
  65. format.
  66.  
  67.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  68.  
  69. StartDate$   starting date
  70. Days&        number of days from the current date (0 or more)
  71. Direction%   return future result (0) or past (nonzero)
  72. -------
  73. NewDate$     resulting date
  74. ErrCode%     whether the dates are valid (0 yes)
  75.  
  76.  
  77. Name  : CDROM
  78. Class : Disk / Equipment
  79. Level : DOS
  80.  
  81. This routine tells you whether the Microsoft CD-ROM Extensions are installed.
  82. If so, it tells you what the letter of the first CD-ROM logical drive is and
  83. how many logical drives exist.
  84.  
  85. Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
  86. installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
  87. This may cause unexpected results.  I'm not yet sure whether DOS 5.0 is
  88. similarly afflicted.
  89.  
  90.    FirstDrive$ = "x"
  91.    CDROM FirstDrive$, Drives%
  92.  
  93. -------
  94. FirstDrive$   letter of the first logical drive (init to at least one space!)
  95. Drives%       number of logical drives available (0 if no CD-ROM is there)
  96.  
  97.  
  98. Name  : CheckDate            (Check Date validity)
  99. Class : Time
  100. Level : Any
  101.  
  102. This routine checks a date to see if it is valid.
  103.  
  104.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  105.  
  106. MonthNr%     month number (1-12)
  107. DayNr%       day number (1-31)
  108. YearNr%      year number (1900 on; years <100 assumed 1900s)
  109. -------
  110. ErrCode%     whether the date is valid (0 yes)
  111.  
  112.  
  113. Name  : CheckShare           (Check for SHARE)
  114. Class : Disk
  115. Level : DOS
  116.  
  117. The CheckShare routine determines whether SHARE.EXE is active.
  118. This is particularly helpful before using the BASIC OPEN
  119. statement, which will fail if you request file sharing when
  120. it's not available.  The PBClone file routines handle such
  121. situations automatically, so CheckShare is not needed for them.
  122.  
  123.    CheckShare ShareActive%
  124.  
  125. -------
  126. ShareActive%   whether SHARE is active (0 if no)
  127.  
  128.  
  129. Name  : CheckShare2%         (Check for SHARE)
  130. Class : Disk
  131. Level : DOS
  132.  
  133. The CheckShare2% function determines whether SHARE.EXE is active.  This is
  134. particularly helpful before using the BASIC OPEN statement, which will fail
  135. if you request file sharing when it's not available.  The PBClone file
  136. routines handle such situations automatically, so CheckShare2% is not needed
  137. for them.
  138.  
  139.    ShareActive% = CheckShare2%
  140.  
  141. -------
  142. ShareActive%   whether SHARE is active (0 if no)
  143.  
  144. Name  : Cipher               (Cipher)
  145. Class : String
  146. Level : Any
  147.  
  148. This is a very simple text encryption routine.  It isn't
  149. particularly hard to crack, but will provide a basic level of
  150. security for undemanding applications.  The same routine can be
  151. used either to encrypt or decrypt text.  The original text may
  152. contain any character; likewise, the resulting text.  This is
  153. not well suited for use with sequential files-- if such is
  154. required, see CipherP.
  155.  
  156. I'd suggest using a long password composed of an unlikely
  157. string of characters, e.g. "#*@@!A^%x{.'".
  158.  
  159.    Cipher St$, Password$
  160.  
  161. St$        string to encrypt or decrypt
  162. Password$  password
  163. -------
  164. St$        encrypted or decrypted string
  165.  
  166.  
  167. Name  : CipherP              (Cipher Printable)
  168. Class : String
  169. Level : Any
  170.  
  171. This is a very simple text encryption routine.  It isn't
  172. particularly hard to crack, but will provide a basic level of
  173. security for undemanding applications.  The same routine can be
  174. used either to encrypt or decrypt text.  The original text may
  175. contain any character below CHR$(128), as may the password.
  176. The resulting text will be printable, if bizarre (all
  177. characters will be above CHR$(127)), and may be used with
  178. sequential files.
  179.  
  180. This routine is potentially less secure than the Cipher routine
  181. (see).
  182.  
  183. I'd suggest using a long password composed of an unlikely
  184. string of characters, e.g. "#*@@!A^%x{.'".
  185.  
  186.    CipherP St$, Password$
  187.  
  188. St$        string to encrypt or decrypt
  189. Password$  password
  190. -------
  191. St$        encrypted or decrypted string
  192.  
  193. Name  : DateA2R              (Date Actual to Relative)
  194. Class : Time
  195. Level : Any
  196.  
  197. This routine converts an actual date to a relative date,
  198. expressed as a number of days.  This allows you to compare
  199. dates, find out what the date will be in a given number of days
  200. (or what it was a given number of days ago), see how many days
  201. passed between two dates, and so forth.
  202.  
  203. I've frequently seen routines of this nature called "Julian
  204. date" routines. I'm not sure where that nomenclature
  205. originated, as it has nothing to do with the Julian calendar.
  206. Most of these routines rely on approximations through floating
  207. point math, and may or may not handle leap years and centuries
  208. appropriately.  The DateA2R routine takes no such shortcuts and
  209. may be relied upon to return accurate results.
  210.  
  211.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  212.  
  213. MonthNr%     month number (1-12)
  214. DayNr%       day number (1-31)
  215. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  216. -------
  217. RelDate&     relative date
  218.  
  219.  
  220. Name  : DateN2S              (Date Numbers to String)
  221. Class : Time
  222. Level : Any / DOS
  223.  
  224. Many of the PBClone routines return the date as a set of
  225. numbers.  This routine provides an easy way to convert those
  226. numbers into string form.  The date format used (year length
  227. and delimiter) will be based on the string which you pass to
  228. the routine.  For instance, "xx-xx-xxxx" will return a date
  229. like "11-26-1990", whereas "xx.xx.xxxx" would return
  230. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  231.  
  232. If you pass zeroes for the MonthNr%, Day%, and Year% values,
  233. the current date will be returned in the format that you
  234. specified.
  235.  
  236. The ProBas and PBClone versions of this routine do not work the
  237. same way in regards to the year.  ProBas assumed that any
  238. two-digit year was in the 1900s.  In contrast, PBClone assumes
  239. that years 80-99 should be converted to 1980-1999 and that 0-79
  240. should be converted to 2000-2079.
  241.  
  242.    DateSt$ = "xx-xx-xxxx"
  243.    DateN2S MonthNr%, Day%, Year%, DateSt$
  244.  
  245. MonthNr%  month
  246. Day%      day
  247. Year%     year
  248. -------
  249. DateSt$   date string.  Init to 8 or 10 chars (see above).
  250.  
  251.  
  252. Name  : DateR2A              (Date Relative to Actual)
  253. Class : Time
  254. Level : Any
  255.  
  256. This is the opposite of the DateA2R routine-- it takes a
  257. "relative" date and converts it back to the usual form.
  258.  
  259.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  260.  
  261. RelDate&     relative date
  262. -------
  263. MonthNr%     month number (1-12)
  264. DayNr%       day number (1-31)
  265. YearNr%      year number (1900 on)
  266.  
  267.  
  268. Name  : DateS2N              (Date String to Numbers)
  269. Class : Time
  270. Level : Any
  271.  
  272. Many of the PBClone routines need to be passed the date as a
  273. set of numbers. This routine provides an easy way to convert a
  274. date from string form into numbers.  You may use either
  275. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  276. length is important, but the delimiter and contents of the
  277. string are ignored).
  278.  
  279. The ProBas and PBClone versions of this routine do not work the
  280. same way in regards to the year.  ProBas assumed that any
  281. two-digit year was in the 1900s.  In contrast, PBClone assumes
  282. that years 80-99 should be converted to 1980-1999 and that 0-79
  283. should be converted to 2000-2079.
  284.  
  285.    DateS2N MonthNr%, Day%, Year%, DateSt$
  286.  
  287. DateSt$   date string.  Init to 8 or 10 characters (see above).
  288. -------
  289. MonthNr%  month
  290. Day%      day
  291. Year%     year
  292.  
  293.  
  294. Name  : DelFile
  295. Class : Disk
  296. Level : DOS
  297.  
  298. This works like the DOS DEL (or ERASE) command, although it does not allow
  299. wildcards.  The specified file is deleted.  Full path specifications are
  300. supported, including drive and subdirectory specs.
  301.  
  302.    DelFile FileName$, ErrCode%
  303.  
  304. FileName$   name of the file to delete
  305. -------
  306. ErrCode%    0 if no error, else DOS Error
  307.  
  308.  
  309. Name  : DriveSpace&
  310. Class : Disk
  311. Level : DOS
  312.  
  313. This routine tells you how many bytes are free on a specified disk drive.
  314.  
  315.    BytesFree& = DriveSpace&(Drive$)
  316.  
  317. Drive$      letter of the drive to examine
  318. -------
  319. BytesFree&  free bytes on the specified drive, or -1 if bad drive or disk error
  320.  
  321.  
  322. Name  : DrvType              (Drive Type)
  323. Class : Disk
  324. Level : DOS 3.1+
  325.  
  326. The DrvType routine tells you whether a specified drive is
  327. fixed or removeable, and whether it is local or remote (network
  328. drive).
  329.  
  330.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  331.  
  332. Drive$       letter of the drive to examine
  333. -------
  334. Removeable%  whether the disk can be removed (0 if no)
  335. Remote%      whether this is a remote drive (0 if no)
  336. ErrCode%     error code: 0 if none, else bad DOS version
  337.  
  338. Name  : Elapsed              (Elapsed time)
  339. Class : Time
  340. Level : Any
  341.  
  342. This routine tells you the amount of time elapsed between a
  343. given starting time and ending time.  The difference between
  344. the times must be less than 24 hours for the results to be
  345. meaningful.
  346.  
  347.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  348.  
  349. TimeStart$   starting time
  350. TimeStop$    ending time
  351. -------
  352. TimeDiff$    elapsed time
  353.  
  354. Name  : EMSBuffer
  355. Class : Memory
  356. Level : BIOS
  357.  
  358. EMSBuffer tells you how many bytes are needed to save the state of the EMS
  359. array routines.  Used in conjunction with EMSSave and EMSRest, it allows you
  360. to preserve EMS arrays across a CHAIN to another part of your program.
  361.  
  362.    EMSBuffer Bytes%
  363.    EMSState$ = SPACE$(Bytes%)
  364.    EMSSave EMSState$
  365.  
  366. -------
  367. Bytes%       bytes needed to save EMS array state
  368.  
  369. Name  : EMSClose
  370. Class : Memory
  371. Level : BIOS
  372.  
  373. The EMSClose routine is used when you are finished with an EMS array.  It
  374. frees the array handle and EMS memory for other uses.  If you don't close all
  375. EMS arrays before your program ends, the memory will be lost until the system
  376. is rebooted, so it is important to remember EMSClose.
  377.  
  378.    EMSClose ArrayHandle%
  379.  
  380. ArrayHandle%    handle of an EMS array
  381.  
  382.  
  383. Name  : EMSGet
  384. Class : Memory
  385. Level : BIOS
  386.  
  387. This routine gets an element from an EMS array created by EMSOpen.  Element
  388. numbers start at 0.  Be sure to use the right numeric type for the array--
  389. for instance, if you opened the array for SINGLE precision, use "Value!".
  390.  
  391.    EMSGet ArrayHandle%, ElementNr&, Value
  392.  
  393. ArrayHandle%    handle of an EMS array
  394. ElementNr&      element number to get
  395. -------
  396. Value           value to get element into (must be correct type for array)
  397.  
  398.  
  399. Name  : EMSOpen
  400. Class : Memory
  401. Level : BIOS
  402.  
  403. This routine allows you to open a block of EMS (expanded) memory which can
  404. then be accessed like a numeric array.  The array size is limited only by
  405. available EMS memory (use GetLIMM to find out how much is available).  You
  406. may specify any numeric type:
  407.  
  408.     1   INTEGER
  409.     2   LONG or SINGLE
  410.     3   DOUBLE
  411.  
  412. When the array is opened, you are returned an "array handle" which is used to
  413. access that array.  Access to the array is done via EMSGet and EMSPut.  When
  414. you are finished with the array, you must close it with EMSClose.
  415.  
  416. As many as 25 EMS arrays can be in use at one time, subject to limitations
  417. which may be imposed by your EMS driver (each array requires one EMS handle).
  418.  
  419.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  420.  
  421. Elements&       number of elements in array (like DIM size)
  422. ElementType%    numeric type of array (see above)
  423. -------
  424. ArrayHandle%    handle of an EMS array
  425. ErrCode%        whether an error occurred (0 no)
  426.  
  427.  
  428. Name  : EMSPut
  429. Class : Memory
  430. Level : BIOS
  431.  
  432. This routine puts an element into an EMS array created by EMSOpen.  Element
  433. numbers start at 0.  Be sure to use the right numeric type for the array--
  434. for instance, if you opened the array for SINGLE precision, use "Value!".
  435.  
  436.    EMSPut ArrayHandle%, ElementNr&, Value
  437.  
  438. ArrayHandle%    handle of an EMS array
  439. ElementNr&      element number to set
  440. Value           value to set element to (must be correct type for array)
  441.  
  442.  
  443. Name  : EMSRest
  444. Class : Memory
  445. Level : BIOS
  446.  
  447. This routine allows you to restore the state of the EMS array handler.  Used
  448. in conjunction with EMSBuffer and EMSSave, it allows you to preserve EMS
  449. arrays across a CHAIN to another part of your program.
  450.  
  451.    EMSRest EMSState$
  452.  
  453. EMSState$    saved EMS array state
  454.  
  455.  
  456. Name  : EMSSave
  457. Class : Memory
  458. Level : BIOS
  459.  
  460. This routine allows you to save the state of the EMS array handler.  Used in
  461. conjunction with EMSBuffer and EMSRest, it allows you to preserve EMS arrays
  462. across a CHAIN to another part of your program.
  463.  
  464.    EMSBuffer Bytes%
  465.    EMSState$ = SPACE$(Bytes%)
  466.    EMSSave EMSState$
  467.  
  468. -------
  469. EMSState$    saved EMS array state
  470.  
  471.  
  472. Name  : EnhKbd
  473. Class : Input
  474. Level : BIOS
  475.  
  476. By default, the PBClone routines assume an old-style keyboard is in use, for
  477. greatest compatibility.  EnhKbd allows you to turn on enhanced keyboard
  478. handling for the current generation of (usually) 101-key keyboards.  This
  479. allows access to the F11 and F12 function keys as well as codes for key
  480. combinations that used to be ignored, among other things.
  481.  
  482. The KbdType or KbdType2% routine can be used to determine if an enhanced
  483. keyboard is available (recommended).
  484.  
  485. Note that EnhKbd works by intercepting the BIOS keyboard handler.  All calls
  486. to the BIOS keyboard interrupt are converted from the old keyboard functions
  487. to the new ones.  YOU MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can
  488. restore the old setup.  Otherwise, the computer will most probably crash.
  489.  
  490.    EnhKbd Enable%
  491.  
  492. Enable%     turn on enhanced keyboard support (0 disable, else enable)
  493.  
  494.  
  495. Name  : EuropeDate           (European Date format)
  496. Class : Time
  497. Level : Any
  498.  
  499. This routine takes a date in one of the American formats
  500. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  501. convention ("DD.MM.YY" or "DD.MM.YYYY").  The date is formatted
  502. according to a format string which provides the desired
  503. delimiter and year length, e.g. "##-##-##" specifies a
  504. delimiter of "-" and a year length of two digits.
  505.  
  506. An error code is returned if the date is not valid.
  507.  
  508.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  509.  
  510. DateSt$     date to format (month, day, year order)
  511. Format$     format for the date
  512. -------
  513. Result$     resulting date (day, month, year order)
  514. ErrCode     whether the date is valid (0 ok)
  515.  
  516.  
  517. Name  : Exist2%              (file Existence)
  518. Class : Disk
  519. Level : DOS
  520.  
  521. Most versions of BASIC give you no way of seeing if a file
  522. exists before you try to OPEN it, so you end up taking your
  523. chances.  The Exist2% function allows you to test to see if the
  524. file exists beforehand.  It isn't really necessary for the
  525. PBClone file routines, which will return an appropriate error
  526. code, but it's an important safeguard when using the OPEN
  527. statement.
  528.  
  529. The Exist2% routine does not support wildcards.  If you need
  530. that feature, try the FindFirstFx and FindNextFx routines
  531. instead.
  532.  
  533.    Found% = Exist2%(FileName$)
  534.  
  535. FileName$   name of the file to look for
  536. -------
  537. Found%      whether the file was found (0 if no)
  538.  
  539.  
  540. Name  : FormatDate           (Format Date)
  541. Class : Time
  542. Level : Any
  543.  
  544. This is a highly flexible date formatting routine.  It accepts
  545. a date in one of the usual American formats ("03-22-1990",
  546. "03/22/90", or even "3/22/90") and converts it according to a
  547. format string.  This format string allows you to normalize the
  548. date, select a new delimiter, choose between two-digit and
  549. four-digit years, and even change the order from month/day/year
  550. to anything else.  An error code will be returned if the date
  551. is not valid.
  552.  
  553. The format string can be as simple as "##/##/##", which
  554. specifies that the usual month/day/year order be used, with a
  555. delimiter of "/" and a two-digit year.  If you want to change
  556. the date order, you would need a format like "DD.MM.YYYY"
  557. instead.  For sorting or storage, you might want to convert the
  558. date to a plain number, using a format string like "YYYYMMDD".
  559. The result could then be converted to a LONG with the BASIC VAL
  560. function.
  561.  
  562.    FormatDate DateSt$, Format$, Result$, ErrCode%
  563.  
  564. DateSt$     date to format (month, day, year order)
  565. Format$     format for the date
  566. -------
  567. Result$     resulting date
  568. ErrCode     whether the date is valid (0 ok)
  569.  
  570.  
  571. Name  : FindFirstF           (Find First File)
  572. Class : Disk
  573. Level : DOS
  574.  
  575. This is part of a set of routines included for compatibility
  576. with ADVBAS and ProBas.  A better solution may be found in
  577. FindFirstFx.
  578.  
  579. The FindFirstF routine is used to find the first file that
  580. matches search parameters which you specify.  Various
  581. information about the file that matches (if any) can be
  582. retrieved by other routines.  See also FindNextF.
  583.  
  584. The file name specified may contain a drive and subdirectory
  585. specification. Wildcards are also allowed.
  586.  
  587. Possible search attributes are as follows:
  588.  
  589.    Normal          0      (nothing special)
  590.    Hidden          2      file is "invisible"
  591.    System          4      special DOS system file
  592.    Subdirectory   16      subdirectory
  593.  
  594. You can combine the attributes by adding them together.  All
  595. searches will match if any of the specified attributes are
  596. found, so if you're looking only for a specific attribute, you
  597. will need to test the results using GetAttrF.
  598.  
  599.  
  600. Routines in this series include:
  601.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  602.    GetTimeF, GetSizeFL
  603.  
  604.    FindFirstF FileName$, Attr%, ErrCode%
  605.  
  606. FileName$   name of file(s) for which to search
  607. Attr%       file attribute(s) to seek
  608. -------
  609. ErrCode%    error code (0 if no error, else no matching files)
  610.  
  611.  
  612. Name  : FindNextF            (Find Next File)
  613. Class : Disk
  614. Level : DOS
  615.  
  616. This routine is for use after FindFirstF, to find any
  617. additional files which may match your search specifications.
  618. Routines in this series include:
  619.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  620.    GetTimeF, GetSizeFL
  621.  
  622.    FindNextF ErrCode%
  623.  
  624. -------
  625. ErrCode%    error code (0 if no error, else no matching files)
  626.  
  627. Name  : Get4DOSv             (Get 4DOS Version)
  628. Class : Equipment
  629. Level : DOS
  630.  
  631. The Get4DOSv routine returns the version of 4DOS being used.  It returns the
  632. results as two integers containing the major and minor version numbers. For
  633. instance, 4DOS 4.0 would return a major number of 4, minor 0.  If 4DOS is not
  634. installed, both version numbers will be zero.
  635. If you're not familiar with 4DOS, it's a terrific improved replacement for
  636. COMMAND.COM.  For more information, write JP Software Inc., P.O. Box 1470,
  637. Arlington MA 02174, or call your local BBS.
  638.  
  639.    Get4DOSv MajorV%, MinorV%
  640.  
  641. -------
  642. MajorV%   major part of the 4DOS version
  643. MinorV%   minor part of the 4DOS version
  644.  
  645. Name  : GetattrF             (Get Attribute of File)
  646. Class : Disk
  647. Level : DOS
  648.  
  649. The GetAttrF routine returns the attributes of a file matched
  650. by FindFirstF or FindNextF.
  651.    Normal          0      (nothing special)
  652.    Read Only       1      file can be read, but not written to
  653.    Hidden          2      file is "invisible"
  654.    System          4      special DOS system file
  655.    Subdirectory   16      subdirectory
  656.    Archive        32      (used by some backup utilities)
  657. You can see if a certain value is set using the AND operator:
  658.  
  659.    IF Attr% AND 16 THEN PRINT "Subdirectory"
  660.  
  661. Since the values are all powers of two, the AND operator makes
  662. for a convenient way of decoding the results.
  663. See also the ExplainFAttr$ function, which decodes the meanings
  664. of the attribute for you.
  665.  
  666. Routines in this series include:
  667.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  668.  
  669.    GetAttrF Attr%
  670.  
  671. -------
  672. Attr%   attributes that are set
  673.  
  674. Name  : GetDateF             (Get Date of File)
  675. Class : Disk / Time
  676. Level : DOS
  677. The GetDateF routine returns the date of a file matched by
  678. FindFirstF or FindNextF.
  679.  
  680. Routines in this series include:
  681.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  682.  
  683.    GetDateF MonthNr%, Day%, Year%
  684.  
  685. -------
  686. MonthNr%    month
  687. Day%        day
  688. Year%       year
  689.  
  690. Name  : GetDOSV                 (Called by DoorFrame - DON'T DELETE!)
  691. Class : Equipment
  692. Level : DOS
  693.  
  694. The GetDOSV routine tells you what version of DOS you're using.  It returns
  695. the results as two integers containing the major and minor version numbers.
  696. For instance, MS-DOS 2.11 would return a major number of 2, minor 11.
  697. The OS/2 compatibility box returns version numbers beginning at 10.00.  For
  698. instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0 returns 20.00.
  699.  
  700.    GetDOSV MajorV%, MinorV%
  701.  
  702. -------
  703. MajorV%   major part of the DOS version
  704. MinorV%   minor part of the DOS version
  705.  
  706. Name  : Getdrv               (Get default Drive)
  707. Class : Disk
  708. Level : DOS
  709.  
  710. This routine tells you the letter of the current default drive.
  711.  
  712.    Drive$ = "x"
  713.    GetDrv Drive$
  714.  
  715. -------
  716. Drive$    default drive letter.  Init to at least one character.
  717.  
  718. Name  : GetDView
  719. Class : Miscellaneous
  720. Level : DOS
  721. The GetDView routine tells you what version of DESQview is loaded.  It
  722. returns the results as two integers containing the major and minor version
  723. numbers.  For instance, DESQview 2.0 would return a major number of 2 and a
  724. minor number of 0.  If DESQview is not loaded, zeroes are returned.
  725.  
  726. See also GetTView, GetTVScreen, UpdTVScreen.
  727.  
  728.    GetDView MajorV%, MinorV%
  729.  
  730. -------
  731. MajorV%   major part of the DESQview version (0 if DESQview is not loaded)
  732. MinorV%   minor part of the DESQview version
  733.  
  734. Name  : GetexecPath          (Get Execution Path of program)
  735. Class : Disk
  736. Level : DOS 3.0+
  737. This routine returns the full path of your program, i.e., the
  738. drive, subdirectory, and name of the program.  It does not rely
  739. on the current drive and subdirectory settings or look at the
  740. PATH setting-- DOS tells it directly.  This makes it an
  741. excellent way to find the program's "home" directory, where
  742. (hopefully) any data files associated with the program will
  743. also be stored.
  744.  
  745.    SelfName$ = SPACE$(80)
  746.    GetExecPath SelfName$, SelfLen%
  747.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  748.  
  749. -------
  750. SelfName$   full path for current program.  Init to 80+ chars.
  751. SelfLen%    length of the full path spec.
  752.  
  753. Name  : GetKbd
  754. Class : Input
  755. Level : Clone
  756. The GetKbd routine allows you to get the state of the four keyboard toggles:
  757. Insert, Caps lock, Num lock, and Scroll Lock.
  758.  
  759.    GetKbd Insert%, Caps%, Num%, Scrl%
  760.  
  761. -------
  762. Insert%    whether "insert" mode is on (0 if no)
  763. Caps%      whether "caps lock" is on (0 if no)
  764. Num%       whether "num lock" is on (0 if no)
  765. Scrl%      whether "scroll lock" is on (0 if no)
  766.  
  767.  
  768. Name  : GetKbd1
  769. Class : Input
  770. Level : Clone
  771.  
  772. The GetKbd1 routine allows you to get the state of the four keyboard shift
  773. keys: Left shift, Right shift, Control and Alt.
  774.  
  775.    GetKbd1 LShift%, RShift%, Control%, Alt%
  776.  
  777. -------
  778. LShift%    whether the left shift key is depressed (0 if no)
  779. RShift%    whether the right shift key is depressed (0 if no)
  780. Control%   whether a control key is depressed (0 if no)
  781. Alt%       whether an alt key is depressed (0 if no)
  782.  
  783.  
  784. Name  : GetKbd2
  785. Class : Input
  786. Level : AT BIOS
  787.  
  788. The GetKbd2 routine allows you to get the state of the six keyboard shift
  789. keys on an "enhanced" keyboard: Left shift, Right shift, Left Control, Right
  790. Control, Left Alt and Right Alt.
  791.  
  792. Normally, the BIOS only lets you see one key at a time, which can be a
  793. barrier when you need more input.  This is a particular problem with action
  794. games and other real-time applications which have complex input requirements.
  795. Due to the special way the BIOS treats shift keys, GetKbd2 can tell if the
  796. the various shift keys are pressed simultaneously, allowing more flexibility.
  797.  
  798.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  799.  
  800. -------
  801. LShift%    whether the left shift key is depressed (0 if no)
  802. RShift%    whether the right shift key is depressed (0 if no)
  803. LCtrl%     whether the left control key is depressed (0 if no)
  804. RCtrl%     whether the right control key is depressed (0 if no)
  805. LAlt%      whether the left alt key is depressed (0 if no)
  806. RAlt%      whether the right alt key is depressed (0 if no)
  807.  
  808.  
  809. Name  : GetLIMHandles
  810. Class : Memory
  811. Level : DOS
  812.  
  813. Early Lotus/Intel/Microsoft expanded memory revisions provided a limited
  814. number of "handles" which could be used to access expanded memory-- often as
  815. few as 15 or so.  If your program uses expanded memory and the EMS driver is
  816. one of the older versions, you may want to make sure that enough handles are
  817. available.  This routine tells you how many handles are in use.
  818.  
  819. Note that this routine expects an EMS driver to be installed.  If you can't
  820. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  821.  
  822.    GetLIMHandles Handles%
  823.  
  824. -------
  825. Handles%  number of EMS handles in use
  826.  
  827.  
  828.  
  829. Name  : GetLIMM
  830. Class : Memory / Equipment
  831. Level : DOS
  832.  
  833. This routine tells you how much expanded memory is installed.  If there is
  834. none, or if the EMS driver hasn't been installed, it returns zeroes.  You
  835. should use this routine before any other of the PBClone routines that access
  836. expanded memory, since the other routines expect EMS to be available.
  837.  
  838. The results are returned in terms of EMS pages.  Each page is 16 kilobytes.
  839.  
  840.    GetLIMM TotalPages%, FreePages%
  841.  
  842. -------
  843. TotalPages%  number of EMS pages installed
  844. FreePages%   number of EMS pages available for use
  845.  
  846.  
  847. Name  : GetLIMV
  848. Class : Memory / Equipment
  849. Level : DOS
  850.  
  851. The GetLIMV routine tells you the version of EMS driver that is being used.
  852. The version number is separated into major and minor parts.  For example, an
  853. EMS 3.1 driver would return a major number of 3 and minor number of 1.
  854.  
  855. Note that this routine expects an EMS driver to be installed.  If you can't
  856. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  857.  
  858.    GetLIMV MajorVer%, MinorVer%
  859.  
  860. -------
  861. MajorVer%  major part of the EMS version number
  862. MinorVer%  minor part of the EMS version number
  863.  
  864.  
  865. Name  : GetNameF             (Get Name of File)
  866. Class : Disk
  867. Level : DOS
  868.  
  869. The GetNameF routine returns the name of a file matched by
  870. FindFirstF or FindNextF.  The name will not contain a drive or
  871. subdirectory specification.
  872.  
  873. Routines in this series include:
  874.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  875.    GetTimeF, GetSizeFL
  876.  
  877.    FileName$ = SPACE$(12)
  878.    GetNameF FileName$, NameLen%
  879.    FileName$ = LEFT$(FileName$, NameLen%)
  880.  
  881. -------
  882. FileName$   file name (init to at least 12 characters)
  883. NameLen%    length of file name
  884.  
  885.  
  886. Name  : GetsizeFL            (Get Size of File as Long)
  887. Class : Disk
  888. Level : DOS
  889.  
  890. The GetSizeFL routine returns the size of a file matched by
  891. FindFirstF or FindNextF.
  892.  
  893. Routines in this series include:
  894.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  895.    GetTimeF, GetSizeFL
  896.  
  897.    GetSizeFL FileSize&
  898.  
  899. -------
  900. FileSize&   file size
  901.  
  902.  
  903. Name  : Getsub               (Get default Subdirectory)
  904. Class : Disk
  905. Level : DOS
  906.  
  907. The GetSub routine gets the current subdirectory on the default
  908. drive.  It does not put a backslash at the start of the
  909. subdirectory, so you should add this yourself.
  910.  
  911. See also GetSub1, which is a more advanced version of this
  912. routine.
  913.  
  914.    SubDir$ = SPACE$(64)
  915.    GetSub SubDir$, SubLen%
  916.    SubDir$ = "\" + LEFT$(SubDir$, SubLen%)
  917.  
  918. -------
  919. SubDir$    name of the current subdirectory. Init to 64+ chars
  920. SubLen%    length of the subdirectory name
  921.  
  922.  
  923. Name  : GetSub1              (Get default Subdirectory)
  924. Class : Disk
  925. Level : DOS
  926.  
  927. The GetSub1 routine gets the current subdirectory on a
  928. specified drive. Unlike GetSub, it places a backslash at the
  929. start of the name.  It also returns an error code, which allows
  930. you to see if there was a disk error.
  931.  
  932.    SubDir$ = SPACE$(65)
  933.    GetSub1 Drive$, SubDir$, SubLen%, ErrCode%
  934.    SubDir$ = LEFT$(SubDir$, SubLen%)
  935.  
  936. Drive$     letter of the drive to check
  937. -------
  938. SubDir$    name of the current subdirectory. Init to 65+ chars
  939. SubLen%    length of the subdirectory name
  940. ErrCode%   error code: 0 if no error, else DOS Error
  941.  
  942.  
  943. Name  : GetTimeF             (Get Time of File)
  944. Class : Disk / Time
  945. Level : DOS
  946.  
  947. The GetTimeF routine returns the time of a file matched by
  948. FindFirstF or FindNextF.
  949.  
  950. Routines in this series include:
  951.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  952.  
  953.    GetTimeF Hour%, Minute%, Second%
  954.  
  955. -------
  956. Hour%      hour
  957. Minute%    minute
  958. Second%    second
  959.  
  960. Name  : GetTView             (Get TopView)
  961. Class : Miscellaneous
  962. Level : BIOS
  963.  
  964. This routine tells you whether TopView or a compatible multitasker (such as
  965. TaskView or DESQview) is loaded.
  966. See also GetDView, GetTVScreen, UpdTVScreen.
  967.  
  968.    GetTView Installed%
  969.  
  970. -------
  971. Installed%   whether a TopView-type multitasker is loaded (0 no)
  972.  
  973. Name  : GetTVScreen          (Get TopView Screen address)
  974. Class : Display / Miscellaneous
  975. Level : BIOS
  976.  
  977. GetTVScreen returns the address of the screen buffer used by a TopView-type
  978. multitasker.  This allows you to use direct screen access while remaining
  979. within the windows allocated to your program by the multitasker.
  980.  
  981. You must tell the multitasker the address of the screen you would be writing
  982. to if the multitasker was not installed.  Specify a segment of &HB000 if
  983. using an MDA or Hercules, or a segment of &HB800 for CGA, EGA, MCGA or VGA.
  984. The offset should always be 0.  This is for use in text modes.
  985.  
  986. The routine will return with the new segment and offset for you to use.
  987. These values can be used with any PBClone screen routine that accepts a
  988. segment and offset-- DQPrint and DXQPrint, for example.
  989.  
  990. Note that not all TopView-compatible multitaskers will automatically update
  991. the screen from the buffer.  The UpdTVScreen routine allows you to force a
  992. screen update.
  993. See also GetDView, GetTView, UpdTVScreen.
  994.  
  995.    GetTVScreen DSeg%, DOfs%
  996.  
  997. DSeg%       segment of desired screen
  998. DOfs%       offset of desired screen
  999. -------
  1000. DSeg%       segment of screen buffer
  1001. DOfs%       offset of screen buffer
  1002.  
  1003.  
  1004. Name  : KbdType
  1005. Class : Input / Equipment
  1006. Level : Clone
  1007.  
  1008. This routine tells you if an enhanced (101-key) keyboard is available.
  1009.  
  1010. KbdType differs from the ProBas routine of the same name in that it has
  1011. additional error checking.  If it is not entirely sure that an enhanced
  1012. keyboard is available, it plays safe and assumes there isn't one.  This
  1013. avoids possible disaster on older PCs.
  1014.  
  1015.    KbdType Enhanced%
  1016.  
  1017. -------
  1018. Enhanced%    whether keyboard is of the enhanced type (0 no)
  1019.  
  1020.  
  1021. Name  : LClose
  1022. Class : Memory
  1023. Level : BIOS
  1024.  
  1025. This routine closes a block of expanded memory that was opened for access by
  1026. LOpen.  It is important to close the block when you are finished with it, to
  1027. return it to the free memory pool.
  1028.  
  1029. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1030.  
  1031.    LClose EMSHandle%
  1032.  
  1033. EMSHandle%    handle of the expanded memory block
  1034.  
  1035.  
  1036. Name  : LGet
  1037. Class : Memory
  1038. Level : BIOS
  1039.  
  1040. This routine gets a block of data from expanded memory that was opened for
  1041. access by LOpen.  The amount of data is specified in words; one word is the
  1042. same as two bytes.  An integer takes up a word, long integers and single
  1043. precision numbers require two words, and double precision numbers take four.
  1044.  
  1045. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1046.  
  1047.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  1048.  
  1049. EMSHandle%    handle of the expanded memory block
  1050. DSeg%         segment of place to store data
  1051. DOfs%         offset of place to store data
  1052. Words%        words to get from expanded memory
  1053.  
  1054.  
  1055. Name  : LOpen
  1056. Class : Memory
  1057. Level : BIOS
  1058.  
  1059. This routine opens a block of expanded memory for access.  The size of the
  1060. block is specified in words; one word is the same as two bytes.  An integer
  1061. takes up a word, long integers and single precision numbers require two
  1062. words, and double precision numbers take four.  This allows you to store up
  1063. to 64K in each EMS block that you open.
  1064.  
  1065. Note that LOpen expects an EMS driver to be available.  If you are not
  1066. certain on this point, use GetLIMM beforehand to make sure.
  1067.  
  1068. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1069.  
  1070.    LOpen Words%, EMSHandle%, ErrCode%
  1071.  
  1072. Words%        size of expanded memory block to allocate
  1073. -------
  1074. EMSHandle%    handle of the expanded memory block
  1075. ErrCode%      error code (0 if no error)
  1076.  
  1077. Name  : LPut
  1078. Class : Memory
  1079. Level : BIOS
  1080.  
  1081. This routine puts a block of data into expanded memory that was opened for
  1082. access by LOpen.  The amount of data is specified in words; one word is the
  1083. same as two bytes.  An integer takes up a word, long integers and single
  1084. precision numbers require two words, and double precision numbers take four.
  1085.  
  1086. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1087.  
  1088.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  1089.  
  1090. EMSHandle%    handle of the expanded memory block
  1091. DSeg%         segment of place from which to get data
  1092. DOfs%         offset of place from which to get data
  1093. Words%        words to put into expanded memory
  1094.  
  1095. Name  : LRotate
  1096. Class : String
  1097. Level : Any
  1098.  
  1099. Many years ago, I wrote one of the first terminal programs for the PC.  It
  1100. died a horrible death when Qmodem came out... sigh.  This routine comes from
  1101. that experience.  It rotates the characters in a string left once (e.g.,
  1102. "ABCDE" becomes "BCDEA").  I used this in my routine to dial a list of BBSes,
  1103. skipping to the next one if the current one was busy.
  1104.  
  1105. LRotate can also be handy for things like scrolling a long message across the
  1106. screen (you just PRINT LEFT$(Message$, 80); then delay a bit, LRotate and do
  1107. it again).
  1108.  
  1109.    LRotate St$
  1110.  
  1111. St$     string to be rotated left once
  1112. -------
  1113. St$     string after being rotated left once
  1114.  
  1115.  
  1116. Name  : NameCase                (Called by DoorFrame - DON'T DELETE!)
  1117. Class : String
  1118. Level : Any
  1119.  
  1120. This routine provides a specialized uppercase/lowercase converter designed
  1121. especially for names.  It converts the first letter in each word in a string
  1122. to uppercase, with the rest of the word being converted to lowercase.
  1123.  
  1124. See also NameCase2, the FUNCTION version of this routine.
  1125.  
  1126.    NameCase St$
  1127.  
  1128. St$         string to process
  1129. -------
  1130. St$         processed string
  1131.  
  1132.  
  1133. Name  : NameCase2$           (Name Case)
  1134. Class : String
  1135. Level : Any
  1136.  
  1137. This routine provides a specialized uppercase/lowercase
  1138. converter designed especially for names.  It converts the first
  1139. letter in each word in a string to uppercase, with the rest of
  1140. the word being converted to lowercase.
  1141.  
  1142. See also NameCase, the SUB version of this routine.
  1143.  
  1144.    Result$ = NameCase2$(St$)
  1145.  
  1146. St$         string to process
  1147. -------
  1148. Result$     processed string
  1149.  
  1150.  
  1151. Name  : Processor
  1152. Class : Equipment
  1153. Level : Any
  1154.  
  1155. Processor returns the type of processor (CPU) installed.
  1156.  
  1157. Results are returned as follows:
  1158.  
  1159.    0    NEC V20
  1160.    1    8088 or 8086
  1161.    2    80186
  1162.    3    80286
  1163.    4    80386 or 80486
  1164.  
  1165.    Processor ProcType%
  1166.  
  1167. -------
  1168. ProcType%    type of CPU (see above)
  1169.  
  1170. Name  : Retries
  1171. Class : Disk
  1172. Level : DOS 3.1+
  1173. This routine allows you to adjust the handling of file-sharing errors.  When
  1174. such an error occurs, DOS normally retries 3 times, with a wait of 1 between
  1175. tries.  This allows temporary conditions, such as someone else using the file
  1176. you want to access, to clear up.  In many cases, though, you may want to
  1177. change this delay.  A shorter delay will improve response time, allowing your
  1178. program to handle the error more quickly.  A longer delay may be more suited
  1179. for a busy network, allowing the request to proceed after a reasonable
  1180. waiting period.
  1181.  
  1182. The delay period between each retry is unfortunately machine-dependent, i.e.,
  1183. you will need larger delays on faster machines to achieve the same effect.
  1184. This can only be considered a flaw in DOS.
  1185.  
  1186. Note that shorter waiting periods will improve response time for your
  1187. program, but may adversely affect the network.  Normally, you should use the
  1188. longest waiting period with which you feel comfortable.
  1189.  
  1190.    Retries Times%, WaitTime%
  1191.  
  1192. Times%     number of times to retry if a file-sharing violation occurs
  1193. WaitTime%  amount of time to delay between retries
  1194.  
  1195. Name  : Reverse              (Reverse)
  1196. Class : String
  1197. Level : Any
  1198. This little fellow reverses the order of the characters in a
  1199. string.  It is one of the vital components of RInstr, but other
  1200. than that I see no real use for it.  On the other hand, George
  1201. Boole thought that Boolean logic was of solely theoretical
  1202. interest, and yet without it there would be no computers. I
  1203. leave it to you to find the earth-shattering possibilities of
  1204. Reverse!
  1205.  
  1206.    Reverse St$
  1207.  
  1208. St$      string to be reversed
  1209. -------
  1210. St$      reversed string
  1211.  
  1212. Name  : RInstr               (Reverse INSTR)
  1213. Class : String
  1214. Level : Any
  1215.  
  1216. Like INSTR, this routine tells you the position of a substring
  1217. within a string.  A "reverse" search is used, however-- whereas
  1218. INSTR tells you the first match, RInstr tells you the last
  1219. match.  Similarly, whereas INSTR will tell you that a null
  1220. search string matches the main string at the first position,
  1221. RInstr will match on the last position.  Of course, most of the
  1222. time you won't be searching for a null string!
  1223.  
  1224.    RInstr MainSt$, SeekSt$, Posn%
  1225.  
  1226. MainSt$    string to search
  1227. SeekSt$    string for which to search
  1228. -------
  1229. Posn%      position of substring within main string (0 no match)
  1230.  
  1231.  
  1232. Name  : Sec2Time$            (Seconds to Time)
  1233. Class : Time
  1234. Level : Any
  1235. This routine converts the number of seconds past midnight into
  1236. a time string.
  1237.  
  1238.    TimeSt$ = Sec2Time$(Seconds&)
  1239.  
  1240. Seconds&   number of seconds past midnight
  1241. -------
  1242. TimeSt$    time string (TIME$ format)
  1243.  
  1244. Name  : SetError
  1245. Class : Miscellaneous
  1246. Level : DOS
  1247.  
  1248. The SetError routine allows you to set the "error level" to be returned by
  1249. DOS when your program ends.  This is particularly handy for returning
  1250. information to batch files.
  1251. Note that SetError is best used just before your program ENDs, to avoid
  1252. complications.
  1253.  
  1254.    SetError ErrorLevel%
  1255.  
  1256. ErrorLevel%   exit code to be returned by your program
  1257.  
  1258. Name  : SetKbd
  1259. Class : Input
  1260. Level : Clone
  1261. The SetKbd routine allows you to set the state of any of the four keyboard
  1262. toggles: Insert, Caps lock, Num lock, and Scroll Lock.  You can give your
  1263. input routines a professional touch by setting this toggles instead of making
  1264. the user remember to do so.
  1265.  
  1266. It's considered proper to restore the original keyboard toggles before your
  1267. program exits, unless of course the purpose of the program is to leave the
  1268. toggles in a particular state!  The GetKbd routine can be used in conjunction
  1269. with SetKbd to do this.
  1270.  
  1271.    SetKbd Insert%, Caps%, Num%, Scrl%
  1272.  
  1273. Insert%    whether to turn on "insert" mode (0 if no)
  1274. Caps%      whether to turn on "caps lock" (0 if no)
  1275. Num%       whether to put the keypad into numeric mode (0 if no)
  1276. Scrl%      whether to turn on "scroll lock" (0 if no)
  1277.  
  1278. Name  : Subexist             (Subdirectory Existence)
  1279. Class : Disk
  1280. Level : DOS
  1281. This routine lets you see if a given subdirectory actually
  1282. exists.  This isn't really necessary for the PBClone file
  1283. routines, which will return an appropriate error code, but it's
  1284. a valuable safeguard when using the BASIC OPEN statement.
  1285.  
  1286.    SubExist SubDir$, Found%
  1287.  
  1288. SubDir$   name of the subdirectory to look for
  1289. -------
  1290. Found%    whether the subdirectory was found (0 if no)
  1291.  
  1292. Name  : Time2Sec&            (Time to Seconds)
  1293. Class : Time
  1294. Level : Any
  1295.  
  1296. This routine converts a time string into the number of seconds
  1297. past midnight. This is convenient if you want to find the
  1298. difference between two times or to calculate what time it will
  1299. be after a given interval.
  1300.  
  1301.    Seconds& = Time2Sec&(TimeSt$)
  1302.  
  1303. TimeSt$    time string (TIME$ format)
  1304. -------
  1305. Seconds&   number of seconds past midnight
  1306.  
  1307. Name  : TInstr               (Typed INSTR)
  1308. Class : String
  1309. Level : Any
  1310.  
  1311. As you might guess from the "Instr" part of the name, this
  1312. routine searches a string.  Instead of searching for a specific
  1313. character or substring, though, it looks for a specific type of
  1314. character-- letters, numbers, control codes, or whatever.  You
  1315. can search for the first of a combination of types, too, which
  1316. also allows searching for "anything but" a specific type.
  1317.  
  1318. The character type code is specified by adding any of the
  1319. following:
  1320.  
  1321.     1    alphabetic
  1322.     2    numeric
  1323.     4    symbolic
  1324.     8    control
  1325.    16    graphics
  1326.    32    space
  1327. The TInstr routine is handy for parsing and cleaning up user
  1328. input, among other uses.
  1329.  
  1330.    TInstr St$, ChrType%, Place%
  1331.  
  1332. St$          string to search
  1333. ChrType%     type of character(s) to search for
  1334. -------
  1335. Place%       position of first char of desired type, or 0
  1336.  
  1337.  
  1338. Name  : UnCalcAttr           (Undo Calculated Attribute)
  1339. Class : Display
  1340. Level : Any
  1341.  
  1342. Many of the display routines in this library require an
  1343. "attribute" rather than foreground and background colors.  An
  1344. attribute is a combination of the foreground and background
  1345. colors in a format which is used by all types of displays when
  1346. in text mode.  The UnCalcAttr routine allows you to decode the
  1347. original colors given the attribute.
  1348.  
  1349. Foreground colors are usually specified as 0-31, with
  1350. backgrounds as 0-7.
  1351.  
  1352.    UnCalcAttr Foreground%, Background%, Attr%
  1353.  
  1354. Attr%         color "attribute"
  1355. -------
  1356. Foreground%   foreground color
  1357. Background%   background color
  1358.  
  1359. Name  : UpdTVScreen          (Update TopView Screen)
  1360. Class : Display
  1361. Level : BIOS
  1362.  
  1363. UpdTVScreen tells a TopView-compatible multitasker to update the screen using
  1364. a specified screen buffer (use GetTVScreen to get the buffer location).  Some
  1365. multitaskers will do this automatically, but some won't.  It's safe to use
  1366. this routine either way.
  1367.  
  1368. See also GetDView, GetTView, GetTVScreen.
  1369.  
  1370.    UpdTVScreen DSeg%, DOfs%
  1371.  
  1372. DSeg%       segment of screen buffer
  1373. DOfs%       offset of screen buffer
  1374.  
  1375.  
  1376. Name  : WinCheck             (Windows Check)
  1377. Class : Equipment
  1378. Level : BIOS
  1379.  
  1380. The WinCheck routine tells you what version of Microsoft Windows is in use,
  1381. if any.  It returns the results as two integers containing the major and
  1382. minor version numbers.  For instance, Windows 3.0 would return a major number
  1383. of 3, minor 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  1384. not running, 0.0 will be returned.  NOTE that this routine is not able to
  1385. detect Windows 1.x versions!
  1386.  
  1387.    WinCheck MajorV%, MinorV%
  1388.  
  1389. -------
  1390. MajorV%   major part of the Windows version
  1391. MinorV%   minor part of the Windows version
  1392.  
  1393.