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

  1. Name  : Get4DOSv             (Get 4DOS Version)
  2. Class : Equipment
  3. Level : DOS
  4.  
  5. The Get4DOSv routine returns the version of 4DOS being used.  It returns the
  6. results as two integers containing the major and minor version numbers. For
  7. instance, 4DOS 4.0 would return a major number of 4, minor 0.  If 4DOS is not
  8. installed, both version numbers will be zero.
  9.  
  10. If you're not familiar with 4DOS, it's a terrific improved replacement for
  11. COMMAND.COM.  For more information, write JP Software Inc., P.O. Box 1470,
  12. Arlington MA 02174, or call your local BBS.
  13.  
  14.    Get4DOSv MajorV%, MinorV%
  15.  
  16. -------
  17. MajorV%   major part of the 4DOS version
  18. MinorV%   minor part of the 4DOS version
  19.  
  20. Name  : GetAttrF             (Get Attribute of File)
  21. Class : Disk
  22. Level : DOS
  23.  
  24. The GetAttrF routine returns the attributes of a file matched by FindFirstF
  25. or FindNextF.
  26.  
  27.    Normal          0      (nothing special)
  28.    Read Only       1      file can be read, but not written to
  29.    Hidden          2      file is "invisible"
  30.    System          4      special DOS system file
  31.    Subdirectory   16      subdirectory
  32.    Archive        32      (used by some backup utilities)
  33.  
  34. You can see if a certain value is set by using the AND operator:
  35.  
  36.    IF Attr% AND 16 THEN PRINT "Subdirectory"
  37.  
  38. Since the values are all powers of two, the AND operator makes for a
  39. convenient way of decoding the results.
  40.  
  41. Routines in this series include:
  42.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  43.  
  44.    GetAttrF Attr%
  45.  
  46. -------
  47. Attr%   attributes that are set
  48.  
  49. Name  : GetAttrFx%           (Get Attribute of File, Extended)
  50. Class : Disk
  51. Level : DOS
  52.  
  53. The GetAttrFx% function returns the attributes of a file matched by
  54. FindFirstFx or FindNextFx.
  55.  
  56.    Normal          0      (nothing special)
  57.    Read Only       1      file can be read, but not written to
  58.    Hidden          2      file is "invisible"
  59.    System          4      special DOS system file
  60.    Subdirectory   16      subdirectory
  61.    Archive        32      (used by some backup utilities)
  62.  
  63. You can see if a certain value is set by using the AND operator:
  64.  
  65.    IF Attr% AND 16 THEN PRINT "Subdirectory"
  66.  
  67. Since the values are all powers of two, the AND operator makes for a
  68. convenient way of decoding the results.
  69.  
  70. Routines in this series include:
  71.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$, GetTimeFx$,
  72.    GetSizeFx&
  73.  
  74.    Attr% = GetAttrFx%(Buffer$)
  75.  
  76. Buffer$   buffer used in search
  77. -------
  78. Attr%     file attributes
  79.  
  80. Name  : GetColor             (Get Color)
  81. Class : Display
  82. Level : Clone
  83.  
  84. This routine tells you the current default foreground and background colors
  85. being used by BASIC.  It should be used only in text modes.
  86.  
  87.    GetColor Foreground%, Background%
  88.  
  89. -------
  90. Foreground%   foreground color
  91. Background%   background color
  92.  
  93. Name  : GetCommAddr          (Get Comm Address)
  94. Class : Serial
  95. Level : Clone
  96.  
  97. This routine allows you to determine the base port address of a serial port.
  98. You tell it the COM port number (1-4) and it returns the port address.  If
  99. there is no port installed, zero will be returned.
  100.  
  101. Note that ports are "supposed" to be assigned sequentially-- in other words,
  102. if you find a "zero" port address, there will be no ports after that.  This
  103. is not necessarily the case, however.  Some semi-standard machines may have a
  104. COM2 without a COM1, for instance.  QuickBASIC gets confused in that case,
  105. but it's no problem with my PBClone or BasWiz libraries.
  106.  
  107. Aside from purely informational purposes, this routine can be useful in
  108. conjunction with SetCommAddr in manipulating the serial ports.
  109.  
  110.    GetCommAddr PortNr%, PortAddr%
  111.  
  112. PortNr%     COM port number (1-4)
  113. -------
  114. PortAddr%   port address
  115.  
  116. Name  : GetCRCA              (Get CRC of Archive file)
  117. Class : Disk / Time
  118. Level : DOS
  119.  
  120. GetCRCA returns the 16-bit CRC of an archived file matched by the FindFirstA
  121. or FindNextA routines.  Since some archives use 32-bit CRCs, you may wish to
  122. use the more generic version of this routine, GetCRCAL.
  123.  
  124. Routines in this series include:
  125.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  126.    GetSizeAL, GetStoreA
  127.  
  128.    GetCRCA CRC16%
  129.  
  130. -------
  131. CRC16%     16-bit CRC
  132.  
  133. Name  : GetCRCAL             (Get CRC of Archive file as Long integer)
  134. Class : Disk / Time
  135. Level : DOS
  136.  
  137. GetCRCAL returns the 32-bit CRC of an archived file matched by the FindFirstA
  138. or FindNextA routines.  If the archive only has a 16-bit CRC, the result is
  139. converted to 32 bits, so this routine works with all archives.
  140.  
  141. Routines in this series include:
  142.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  143.    GetSizeAL, GetStoreA
  144.  
  145.    GetCRCAL CRC32%
  146.  
  147. -------
  148. CRC32%     32-bit CRC
  149.  
  150. Name  : GetCRT               (Get CRT)
  151. Class : Display / Equipment
  152. Level : Clone
  153.  
  154. The GetCRT routine simply tells you whether the current display is capable of
  155. handling colors or not.  An unsophisticated routine, GetCRT assumes that if
  156. the display is an MDA/Hercules, it can't do color, but otherwise it can.
  157.  
  158. See also GetEGA, GetHGA and GetVGA.
  159.  
  160.    GetCRT Colour%
  161.  
  162. -------
  163. Colour%   whether the display is color (0 if no)
  164.  
  165. Name  : GetCRT2%             (Get CRT)
  166. Class : Display / Equipment
  167. Level : Clone
  168.  
  169. The GetCRT2 routine simply tells you whether the current display is capable
  170. of handling colors or not.  An unsophisticated routine, GetCRT2 assumes that
  171. if the display is an MDA/Hercules, it can't do color, but otherwise it can.
  172.  
  173. See also GetEGA, GetHGA and GetVGA.
  174.  
  175.    Colour% = GetCRT%
  176.  
  177. -------
  178. Colour%   whether the display is color (0 if no)
  179.  
  180. Name  : GetDateA             (Get Date of Archive file)
  181. Class : Disk / Time
  182. Level : DOS
  183.  
  184. GetDateA returns the date of a archived file matched by the FindFirstA or
  185. FindNextA routines.
  186.  
  187. Routines in this series include:
  188.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  189.    GetSizeAL, GetStoreA
  190.  
  191.    GetDateA MonthNr%, Day%, Year%
  192.  
  193. -------
  194. MonthNr%    month
  195. Day%        day
  196. Year%       year
  197.  
  198. Name  : GetDateAT            (Get Date from AT clock)
  199. Class : Time
  200. Level : BIOS (AT)
  201.  
  202. This routine gets the date from the hardware real-time clock in AT-class
  203. computers.  Depending on the DOS version, this date may be partially or
  204. completely independent of the date kept by DOS in software.  DOS always reads
  205. the date from the hardware clock when it starts up.  However, use of the DATE
  206. command in DOS (and the DATE$ function in QuickBASIC) may relate only to the
  207. software copy of the date, which is not always guaranteed to be the same as
  208. the date in the hardware clock due to certain discrepancies in DOS.
  209.  
  210.    GetDateAT MonthNr%, Day%, Year%, ErrCode%
  211.  
  212. -------
  213. MonthNr%     month number (1-12)
  214. Day%         day (1-31)
  215. Year%        year (1980-2079)
  216. ErrCode%     error code: 0 if no error, else the clock has stopped
  217.  
  218. Name  : GetDateF             (Get Date of File)
  219. Class : Disk / Time
  220. Level : DOS
  221.  
  222. The GetDateF routine returns the date of a file matched by FindFirstF or
  223. FindNextF.
  224.  
  225. Routines in this series include:
  226.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  227.  
  228.    GetDateF MonthNr%, Day%, Year%
  229.  
  230. -------
  231. MonthNr%    month
  232. Day%        day
  233. Year%       year
  234.  
  235. Name  : GetDateFx$           (Get Date of File, Extended)
  236. Class : Disk / Time
  237. Level : DOS
  238.  
  239. The GetDateFx$ function returns the date of a file matched by FindFirstFx or
  240. FindNextFx.
  241.  
  242. Routines in this series include:
  243.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$, GetTimeFx$,
  244.    GetSizeFx&
  245.  
  246.    FileDate$ = GetDateFx$(Buffer$)
  247.  
  248. Buffer$     buffer used in search
  249. -------
  250. FileDate$   date of file (e.g., "02-28-1991")
  251.  
  252. Name  : GetDOSv              (Get DOS Version)
  253. Class : Equipment
  254. Level : DOS
  255.  
  256. The GetDOSv routine tells you what version of DOS you're using.  It returns
  257. the results as two integers containing the major and minor version numbers.
  258. For instance, MS-DOS 2.11 would return a major number of 2, minor 11.
  259.  
  260. The OS/2 compatibility box returns version numbers beginning at 10.00.  For
  261. instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0 returns 20.00.
  262.  
  263.    GetDOSv MajorV%, MinorV%
  264.  
  265. -------
  266. MajorV%   major part of the DOS version
  267. MinorV%   minor part of the DOS version
  268.  
  269. Name  : GetDrive$            (Get default Drive)
  270. Class : Disk
  271. Level : DOS
  272.  
  273. This routine tells you the letter of the current default drive.
  274.  
  275. See also GetDrv, the SUB version of this routine.
  276.  
  277.    Drive$ = GetDrive$
  278.  
  279. -------
  280. Drive$    default drive letter.
  281.  
  282. Name  : GetDrv               (Get default Drive)
  283. Class : Disk
  284. Level : DOS
  285.  
  286. This routine tells you the letter of the current default drive.
  287.  
  288. See also GetDrive, the FUNCTION version of this routine.
  289.  
  290.    Drive$ = "x"
  291.    GetDrv Drive$
  292.  
  293. -------
  294. Drive$    default drive letter.  Init to at least one character.
  295.  
  296. Name  : GetDView             (Get DESQview version)
  297. Class : Miscellaneous
  298. Level : DOS
  299.  
  300. The GetDView routine tells you what version of DESQview is loaded.  It
  301. returns the results as two integers containing the major and minor version
  302. numbers.  For instance, DESQview 2.0 would return a major number of 2 and a
  303. minor number of 0.  If DESQview is not loaded, zeroes are returned.
  304.  
  305. See also GetTView, GetTVScreen, UpdTVScreen.
  306.  
  307.    GetDView MajorV%, MinorV%
  308.  
  309. -------
  310. MajorV%   major part of the DESQview version (0 if DESQview is not loaded)
  311. MinorV%   minor part of the DESQview version
  312.  
  313. Name  : GetEGA               (Get EGA information)
  314. Class : Display / Equipment
  315. Level : BIOS
  316.  
  317. This routine tells you whether an EGA (or VGA) is available, and if so, what
  318. kind.  It tells you whether the attached display is monochrome or color, and
  319. how many kilobytes of RAM are installed in the adapter.
  320.  
  321. Many early EGAs had only 64K of RAM.  Current adapters have 256K or more.
  322. Since there are some limitations attached to having only 64K, it's a good
  323. idea to see if this is the case-- most PBClone EGA routines won't work
  324. properly on such adapters.
  325.  
  326. See also GetCRT, GetHGA and GetVGA.
  327.  
  328. See also GetEGA2, the FUNCTION version of this routine.
  329.  
  330.    GetEGA Display%, KBytes%
  331.  
  332. -------
  333. Display%  EGA display type: 0 if not EGA, 1 if EGA color, 2 if EGA mono
  334. KBytes%   kilobytes of display memory
  335.  
  336. Name  : GetEGA2%             (Get EGA information)
  337. Class : Display / Equipment
  338. Level : BIOS
  339.  
  340. This routine tells you whether an EGA (or VGA) is available.
  341.  
  342. See also GetCRT2, GetHGA and GetVGA2.
  343.  
  344. See also GetEGA, the SUB version of this routine.  It returns additional
  345. information.
  346.  
  347.    IsEGA% = GetEGA2%
  348.  
  349. -------
  350. IsEGA%    whether the display is an EGA (0 if no)
  351.  
  352. Name  : GetError             (Get Error code from DOS)
  353. Class : Miscellaneous
  354. Level : Clone
  355.  
  356. The GetError routine is used in conjunction with CatchError.  It lets you get
  357. the exit code (error level) returned by a program to which you have SHELLed.
  358. Since CatchError hooks an interrupt to do its work, you must always make sure
  359. to use GetError afterwards to "clean up".  See also CatchError.
  360.  
  361. Note that differences in DOS mean that this routine will not always work.  In
  362. some versions of DOS, you can only get the error level if a batch file was
  363. executed; in others, you can't get the error level from a batch file at all.
  364. Sorry about that.  I don't know of any way to work around it.
  365.  
  366.    CatchError
  367.    SHELL ProgramName$
  368.    GetError ExitCode%
  369.  
  370. -------
  371. ExitCode%   exit code / error level returned by the SHELLed-to program (0-255)
  372.  
  373. Name  : GetExecPath          (Get Execution Path of program)
  374. Class : Disk
  375. Level : DOS 3.0+
  376.  
  377. This routine returns the full path of your program, i.e., the drive,
  378. subdirectory, and name of the program.  It does not rely on the current drive
  379. and subdirectory settings or look at the PATH setting-- DOS tells it
  380. directly.  This makes it an excellent way to find the program's "home"
  381. directory, where (hopefully) any data files associated with the program will
  382. also be stored.
  383.  
  384.    SelfName$ = SPACE$(80)
  385.    GetExecPath SelfName$, SelfLen%
  386.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  387.  
  388. -------
  389. SelfName$   full path spec for current program.  Init to at least 80 chars.
  390. SelfLen%    length of the full path spec.
  391.  
  392. Name  : GetExtM              (Get Extended Memory)
  393. Class : Memory / Equipment
  394. Level : BIOS (AT)
  395.  
  396. This routine allows you to find out how much extended memory is available.
  397. It should only be used on AT-class computers, since older PCs do not support
  398. extended memory.  Note that some of the very early AT machines will return
  399. erroneous results.
  400.  
  401. The amount of memory returned may be either the total amount of extended
  402. memory installed or just the amount available at this time, depending on how
  403. previously-installed programs (if any) make use of extended memory.
  404. Unfortunately, there is no standard which defines how a program should use
  405. extended memory as there is with EMS (expanded memory), so there is no way
  406. for a program to determine whether or how another program is using extended
  407. memory.  Microsoft is trying to clear up this situation with its HIMEM driver
  408. (available at your local BBS, or [last I looked] free from Microsoft), but
  409. this approach hasn't really become standard yet.
  410.  
  411.    GetExtM KBytes%
  412.  
  413. -------
  414. KBytes%    the number of kilobytes of extended memory
  415.  
  416. Name  : GetFAttr             (Get File Attribute)
  417. Class : Disk
  418. Level : DOS
  419.  
  420. This routine lets you read the attributes of a file or subdirectory.  The
  421. attributes may contain a combination of any of the following:
  422.  
  423.    Normal          0      (nothing special)
  424.    Read Only       1      file can be read, but not written to
  425.    Hidden          2      file is "invisible"
  426.    System          4      special DOS system file
  427.    Subdirectory   16      subdirectory
  428.    Archive        32      (used by some backup utilities)
  429.  
  430. You can see if a certain value is set by using the AND operator:
  431.  
  432.    IF Attr% AND 2 THEN PRINT "Hidden file"
  433.  
  434. Since the values are all powers of two, the AND operator makes for a
  435. convenient way of decoding the results.
  436.  
  437.    GetFAttr FileName$, Attr%
  438.  
  439. FileName$   name of the file (or subdirectory) to examine
  440. -------
  441. Attr%       attributes that are set
  442.  
  443. Name  : GetFDate             (Get File Date)
  444. Class : Disk / Time
  445. Level : DOS
  446.  
  447. This routine gets the date of a file.
  448.  
  449.    GetFDate FileName$, MonthNr%, Day%, Year%
  450.  
  451. FileName$   name of the file to examine
  452. -------
  453. MonthNr%    month
  454. Day%        day
  455. Year%       year
  456.  
  457. Name  : GetFTime             (Get File Time)
  458. Class : Disk / Time
  459. Level : DOS
  460.  
  461. This routine gets the time of a file.
  462.  
  463.    GetFTime FileName$, Hour%, Minute%, Second%
  464.  
  465. FileName$   name of the file to examine
  466. -------
  467. Hour%       hour
  468. Minute%     minute
  469. Second%     second (always even, due to DOS storage techniques)
  470.  
  471. Name  : GetHGA%              (Get Hercules Graphics Adapter information)
  472. Class : Display / Equipment
  473. Level : Clone
  474.  
  475. This routine tells you whether a Hercules mono adapter is in use.
  476.  
  477. See also GetCRT2, GetEGA and GetVGA2.
  478.  
  479.    IsHGA% = GetHGA%
  480.  
  481. -------
  482. IsHGA%    whether the display is Hercules mono graphics (0 if no)
  483.  
  484. Name  : GetKbd               (Get Keyboard toggles)
  485. Class : Input
  486. Level : Clone
  487.  
  488. The GetKbd routine allows you to get the state of the four keyboard toggles:
  489. Insert, Caps lock, Num lock, and Scroll Lock.
  490.  
  491.    GetKbd Insert%, Caps%, Num%, Scrl%
  492.  
  493. -------
  494. Insert%    whether "insert" mode is on (0 if no)
  495. Caps%      whether "caps lock" is on (0 if no)
  496. Num%       whether "num lock" is on (0 if no)
  497. Scrl%      whether "scroll lock" is on (0 if no)
  498.  
  499. Name  : GetKbd1              (Get Keyboard Shifts)
  500. Class : Input
  501. Level : Clone
  502.  
  503. The GetKbd1 routine allows you to get the state of the four keyboard shift
  504. keys: Left shift, Right shift, Control and Alt.
  505.  
  506.    GetKbd1 LShift%, RShift%, Control%, Alt%
  507.  
  508. -------
  509. LShift%    whether the left shift key is depressed (0 if no)
  510. RShift%    whether the right shift key is depressed (0 if no)
  511. Control%   whether a control key is depressed (0 if no)
  512. Alt%       whether an alt key is depressed (0 if no)
  513.  
  514. Name  : GetKbd2              (Get Keyboard Shifts)
  515. Class : Input
  516. Level : AT BIOS
  517.  
  518. The GetKbd2 routine allows you to get the state of the six keyboard shift
  519. keys on an "enhanced" keyboard: Left shift, Right shift, Left Control, Right
  520. Control, Left Alt and Right Alt.
  521.  
  522. Normally, the BIOS only lets you see one key at a time, which can be a
  523. barrier when you need more input.  This is a particular problem with action
  524. games and other real-time applications which have complex input requirements.
  525. Due to the special way the BIOS treats shift keys, GetKbd2 can tell if the
  526. the various shift keys are pressed simultaneously, allowing more flexibility.
  527.  
  528.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  529.  
  530. -------
  531. LShift%    whether the left shift key is depressed (0 if no)
  532. RShift%    whether the right shift key is depressed (0 if no)
  533. LCtrl%     whether the left control key is depressed (0 if no)
  534. RCtrl%     whether the right control key is depressed (0 if no)
  535. LAlt%      whether the left alt key is depressed (0 if no)
  536. RAlt%      whether the right alt key is depressed (0 if no)
  537.  
  538. Name  : GetKey               (Get Key or mouse)
  539. Class : Input, Mouse
  540. Level : BIOS
  541.  
  542. This routine is kind of an extended version of INPUT$.  It waits until a key
  543. is available at the keyboard and returns the key pressed.  At your option, it
  544. can also return if a mouse button is pressed.
  545.  
  546.    GetKey Mouse%, ASCIIcode%, ScanCode%, LeftButton%, RightButton%
  547.  
  548. Mouse%        whether to check the mouse (0: no)
  549. -------
  550. ASCIIcode%    ASCII code of the key pressed
  551. ScanCode%     scan code of the key pressed (0 if none)
  552. LeftButton%   whether the left  mouse button was pressed
  553. RightButton%  whether the right mouse button was pressed
  554.  
  555. Name  : GetKey3              (Get Key or 3-button mouse)
  556. Class : Input, Mouse
  557. Level : BIOS
  558.  
  559. This routine is kind of an extended version of INPUT$.  It waits until a key
  560. is available at the keyboard and returns the key pressed.  At your option, it
  561. can also return if a mouse button is pressed.
  562.  
  563.    GetKey3 Mouse%, ASCIIcode%, ScanCode%, LeftButton%, MidBttn%, RightButton%
  564.  
  565. Mouse%        whether to check the mouse (0: no)
  566. -------
  567. ASCIIcode%    ASCII code of the key pressed
  568. ScanCode%     scan code of the key pressed (0 if none)
  569. LeftButton%   whether the left   mouse button is pressed
  570. MidBttn%      whether the middle mouse button is pressed
  571. RightButton%  whether the right  mouse button is pressed
  572.  
  573. Name  : GetLabel             (Get disk volume Label)
  574. Class : Disk
  575. Level : DOS
  576.  
  577. This routine gets the volume label from a specified drive.  See also
  578. GetLabel2$.
  579.  
  580.    Label$ = SPACE$(11)
  581.    GetLabel Drive$, Label$, LabelLen%, ErrCode%
  582.    Label$ = LEFT$(Label$, LabelLen%)
  583.  
  584. Drive$     letter of the drive to examine
  585. -------
  586. Label$     volume label of the specified drive.  Init to at least 11 chars.
  587. LabelLen%  length of the volume label
  588. ErrCode%   error code: 0 if no error, else DOS Error
  589.  
  590. Name  : GetLabel2$           (Get disk volume Label)
  591. Class : Disk
  592. Level : DOS
  593.  
  594. This routine gets the volume label from a specified drive.  See also
  595. GetLabel, a subprogram version of this routine.  The GetLabel subprogram is
  596. preferable in that it returns an error code, but you may find the function
  597. version more convenient if error checking is not desired.
  598.  
  599.    Label$ = GetLabel2$(Drive$)
  600.  
  601. Drive$     letter of the drive to examine
  602. -------
  603. Label$     volume label of the specified drive.
  604.  
  605. Name  : GetLIMHandles        (Get L/I/M expanded memory Handles)
  606. Class : Memory
  607. Level : DOS
  608.  
  609. Early Lotus/Intel/Microsoft expanded memory revisions provided a limited
  610. number of "handles" which could be used to access expanded memory-- often as
  611. few as 15 or so.  If your program uses expanded memory and the EMS driver is
  612. one of the older versions, you may want to make sure that enough handles are
  613. available.  This routine tells you how many handles are in use.
  614.  
  615. Note that this routine expects an EMS driver to be installed.  If you can't
  616. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  617.  
  618.    GetLIMHandles Handles%
  619.  
  620. -------
  621. Handles%  number of EMS handles in use
  622.  
  623. Name  : GetLIMM              (Get L/I/M expanded Memory)
  624. Class : Memory / Equipment
  625. Level : DOS
  626.  
  627. This routine tells you how much expanded memory is installed.  If there is
  628. none, or if the EMS driver hasn't been installed, it returns zeroes.  You
  629. should use this routine before any other of the PBClone routines that access
  630. expanded memory, since the other routines expect EMS to be available.
  631.  
  632. The results are returned in terms of EMS pages.  Each page is 16 kilobytes.
  633.  
  634.    GetLIMM TotalPages%, FreePages%
  635.  
  636. -------
  637. TotalPages%  number of EMS pages installed
  638. FreePages%   number of EMS pages available for use
  639.  
  640. Name  : GetLIMV              (Get L/I/M expanded memory Version)
  641. Class : Memory / Equipment
  642. Level : DOS
  643.  
  644. The GetLIMV routine tells you the version of EMS driver that is being used.
  645. The version number is separated into major and minor parts.  For example, an
  646. EMS 3.1 driver would return a major number of 3 and minor number of 1.
  647.  
  648. Note that this routine expects an EMS driver to be installed.  If you can't
  649. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  650.  
  651.    GetLIMV MajorVer%, MinorVer%
  652.  
  653. -------
  654. MajorVer%  major part of the EMS version number
  655. MinorVer%  minor part of the EMS version number
  656.  
  657. Name  : GetLine              (Get Line of text)
  658. Class : Display
  659. Level : Any
  660.  
  661. This routine retrieves a row of text from a saved (or virtual) screen.
  662.  
  663. You can use GetLine with a saved screen of any size.  The St$ parameter must
  664. be initialized to the width of the saved screen (in columns).
  665.  
  666.    St$ = SPACE$(ScrWidth)
  667.    GetLine DSeg%, DOfs%, Row%, St$, SLen%
  668.    St$ = LEFT$(St$, SLen%)
  669.  
  670. DSeg%      segment of saved screen
  671. DOfs%      offset of saved screen
  672. Row%       row of saved screen (starting at 1)
  673. -------
  674. St$        text at the specified row (init to width of saved screen)
  675. SLen       logical length of text
  676.  
  677. Name  : GetMouseLoc          (Get Mouse Location)
  678. Class : Mouse
  679. Level : BIOS
  680.  
  681. This routine allows you to get the current location of the mouse cursor.  It
  682. doesn't matter if the cursor is visible or invisible.  GetMouseLoc is only
  683. for use in text mode.
  684.  
  685. This routine will not work properly if there is no mouse available.  Use the
  686. MMCheck routine if you are not sure.
  687.  
  688. See also MMGetLoc, which returns the coordinates for graphics mode.
  689.  
  690.    GetMouseLoc Row%, Column%
  691.  
  692. -------
  693. Row%       mouse cursor row
  694. Column%    mouse cursor column
  695.  
  696. Name  : GetNameA             (Get Name of file in Archive)
  697. Class : Disk
  698. Level : DOS
  699.  
  700. GetNameA returns the name of an archived file matched by the FindFirstA or
  701. FindNextA routines.  Since some archives may include subdirectory specs along
  702. with the file name, it is recommended that you initialize the return string
  703. to 80 characters (at least 12 are required).
  704.  
  705. Routines in this series include:
  706.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  707.    GetSizeAL, GetStoreA
  708.  
  709.    FileName$ = SPACE$(80)
  710.    GetNameA FileName$, NameLen%
  711.    FileName$ = LEFT$(FileName$, NameLen%)
  712.  
  713. -------
  714. FileName$   file name (init to at least 12 characters, preferably 80)
  715. NameLen%    length of file name
  716.  
  717. Name  : GetNameF             (Get Name of File)
  718. Class : Disk
  719. Level : DOS
  720.  
  721. The GetNameF routine returns the name of a file matched by FindFirstF or
  722. FindNextF.  The name will not contain a drive or subdirectory specification.
  723.  
  724. Routines in this series include:
  725.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  726.  
  727.    FileName$ = SPACE$(12)
  728.    GetNameF FileName$, NameLen%
  729.    FileName$ = LEFT$(FileName$, NameLen%)
  730.  
  731. -------
  732. FileName$   file name (init to at least 12 characters)
  733. NameLen%    length of file name
  734.  
  735. Name  : GetNameFx$           (Get Name of File, Extended)
  736. Class : Disk
  737. Level : DOS
  738.  
  739. The GetNameFx$ function returns the name of a file matched by FindFirstFx or
  740. FindNextFx.  The name will not contain a drive or subdirectory specification.
  741.  
  742. Routines in this series include:
  743.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$, GetTimeFx$,
  744.    GetSizeFx&
  745.  
  746.    FileName$ = GetNameFx$(Buffer$)
  747.  
  748. Buffer$       buffer used in search
  749. -------
  750. FileName$     file name
  751.  
  752. Name  : GetPrtAddr           (Get Printer Address)
  753. Class : Printer
  754. Level : Clone
  755.  
  756. This routine allows you to determine the base port address of a parallel
  757. port.  You tell it the LPT port number (1-4) and it returns the port address.
  758. If there is no port installed, zero will be returned.
  759.  
  760. Note that up to four printer ports are (theoretically) supported on most
  761. machines.  On PS/2 computers, only three ports are allowed, and the fourth
  762. port data area is used for other purposes.  So, it would probably be a good
  763. idea to restrict your program to ports 1-3.
  764.  
  765. Aside from purely informational purposes, this routine can be useful in
  766. conjunction with SetPrtAddr in manipulating the parallel ports.
  767.  
  768.    GetPrtAddr PortNr%, PortAddr%
  769.  
  770. PortNr%     LPT port number (1-4 or 1-3 [see above])
  771. -------
  772. PortAddr%   port address
  773.  
  774. Name  : GetRows              (Get Rows on screen)
  775. Class : Display
  776. Level : Clone
  777.  
  778. This routine tells you how many rows are on the display.  This is normally
  779. 25, but it may be greater on an EGA or VGA.  Only text modes are supported.
  780.  
  781.    GetRows Rows%
  782.  
  783. -------
  784. Rows%    text rows on the display
  785.  
  786. Name  : GetRows2%            (Get Rows on screen)
  787. Class : Display
  788. Level : Clone
  789.  
  790. This routine tells you how many rows are on the display.  This is normally
  791. 25, but it may be greater on an EGA or VGA.  Only text modes are supported.
  792.  
  793.    Rows% = GetRows2%
  794.  
  795. -------
  796. Rows%    text rows on the display
  797.  
  798. Name  : GetScreen            (Get Screen)
  799. Class : Display
  800. Level : Clone
  801.  
  802. This routine saves any portion of the display to an array.  Only text modes
  803. are supported.  If your program uses multiple display pages, you can get an
  804. image from any of those pages.  A special "slow" mode is supported for the
  805. CGA, to prevent flickering (a problem only with some CGAs).
  806.  
  807. The size of the integer array needed to store a specific area of the screen
  808. can be calculated using the CalcSize routine (see).
  809.  
  810. If you wish to save the entire screen, you may find ScrSave easier (see).
  811.  
  812.    GetScreen Array%(), TopRow%, LeftCol%, BotRow%, RightCol%, Page%, Fast%
  813.  
  814. TopRow%    top row of the desired screen area
  815. LeftCol%   left column of the desired screen area
  816. BotRow%    bottom row of the desired screen area
  817. RightCol%  right column of the desired screen area
  818. Page%      page from which to get the display area
  819. Fast%      whether to use fast mode (nonzero if so; else slow, for some CGAs)
  820. -------
  821. Array%()   stored image of the selected area of the screen
  822.  
  823. Name  : GetSerial$           (Get disk Serial number)
  824. Class : Disk
  825. Level : DOS 4.0+
  826.  
  827. The GetSerial function returns the serial number of the specified disk.  If
  828. there is no serial number, it returns "0000-0000".
  829.  
  830.    SerialNr$ = GetSerial$(Drive$)
  831.  
  832. Drive$       drive to get serial number from ("" for current drive)
  833. -------
  834. SerialNr$    serial number of the specified drive
  835.  
  836. Name  : GetSizeAL            (Get Size of file in Archive as Long integer)
  837. Class : Disk
  838. Level : DOS
  839.  
  840. GetSizeAL returns the size of an archived file matched by the FindFirstA or
  841. FindNextA routines.
  842.  
  843. Routines in this series include:
  844.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  845.    GetSizeAL, GetStoreA
  846.  
  847.    GetSizeAL OrigSize&, CurrSize&
  848.  
  849. -------
  850. OrigSize&    original (uncompressed) file size
  851. CurrSize&    current (compressed) file size
  852.  
  853. Name  : GetSizeFL            (Get Size of File as Long integer)
  854. Class : Disk
  855. Level : DOS
  856.  
  857. The GetSizeFL routine returns the size of a file matched by FindFirstF or
  858. FindNextF.
  859.  
  860. Routines in this series include:
  861.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  862.  
  863.    GetSizeFL FileSize&
  864.  
  865. -------
  866. FileSize&   file size
  867.  
  868. Name  : GetSizeFx&           (Get Size of File, Extended)
  869. Class : Disk
  870. Level : DOS
  871.  
  872. The GetSizeFx& function returns the size of a file matched by FindFirstFx or
  873. FindNextFx.
  874.  
  875. Routines in this series include:
  876.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$, GetTimeFx$,
  877.    GetSizeFx&
  878.  
  879.    FileSize& = GetSizeFx&(Buffer$)
  880.  
  881. Buffer$     buffer used in search
  882. -------
  883. FileSize&   file size
  884.  
  885. Name  : GetStoreA            (Get Storage method of file in Archive)
  886. Class : Disk / Time
  887. Level : DOS
  888.  
  889. GetStoreA returns the method used to compress an archived file matched by the
  890. FindFirstA or FindNextA routines.
  891.  
  892. Routines in this series include:
  893.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  894.    GetSizeAL, GetStoreA
  895.  
  896.    Storage$ = SPACE$(8)
  897.    GetStoreA Storage$
  898.  
  899. -------
  900. Storage$    storage method (init to 8 characters)
  901.  
  902. Name  : GetSub               (Get default Subdirectory)
  903. Class : Disk
  904. Level : DOS
  905.  
  906. The GetSub routine gets the current subdirectory on the default drive.  It
  907. does not put a backslash at the start of the subdirectory, so you should add
  908. this yourself.
  909.  
  910. See also GetSub1, which is a more advanced version of this routine.
  911.  
  912.    SubDir$ = SPACE$(64)
  913.    GetSub SubDir$, SubLen%
  914.    SubDir$ = "\" + LEFT$(SubDir$, SubLen%)
  915.  
  916. -------
  917. SubDir$    name of the current subdirectory.  Initialize to at least 64 chars.
  918. SubLen%    length of the subdirectory name
  919.  
  920. Name  : GetSub1              (Get default Subdirectory)
  921. Class : Disk
  922. Level : DOS
  923.  
  924. The GetSub1 routine gets the current subdirectory on a specified drive.
  925. Unlike GetSub, it places a backslash at the start of the name.  It also
  926. returns an error code, which allows you to see if there was a disk error.
  927.  
  928. If you don't care about the error code, you may prefer GetSub2, the FUNCTION
  929. version of this routine.
  930.  
  931.    SubDir$ = SPACE$(65)
  932.    GetSub1 Drive$, SubDir$, SubLen%, ErrCode%
  933.    SubDir$ = LEFT$(SubDir$, SubLen%)
  934.  
  935. Drive$     letter of the drive for which to obtain the default subdirectory
  936. -------
  937. SubDir$    name of the current subdirectory.  Initialize to at least 65 chars.
  938. SubLen%    length of the subdirectory name
  939. ErrCode%   error code: 0 if no error, else DOS Error
  940.  
  941. Name  : GetSub2$             (Get default Subdirectory)
  942. Class : Disk
  943. Level : DOS
  944.  
  945. The GetSub2 routine gets the current subdirectory on a specified drive.
  946. Unlike GetSub, it places a backslash at the start of the name.
  947.  
  948. See also GetSub1, the SUB version of this routine.  It returns an error code.
  949.  
  950. If you just want the subdirectory of the current drive, you can use a null
  951. string ("") as the drive letter.
  952.  
  953.    SubDir$ = GetSub2$(Drive$)
  954.  
  955. Drive$     letter of the drive for which to obtain the default subdirectory
  956. -------
  957. SubDir$    name of the current subdirectory.  Initialize to at least 65 chars.
  958.  
  959. Name  : GetSwitch            (Get Switch character)
  960. Class : Miscellaneous
  961. Level : DOS
  962.  
  963. An undocumented capability in many DOS versions allows you to set the DOS
  964. "switch character", which is the delimiter used to identify a switch on the
  965. DOS command line.  This is normally a slash, as in "DIR /W".  However, many
  966. people prefer to change it to a "-", which is the switch character used by
  967. Unix.
  968.  
  969. With the normal "/" delimiter, a backslash "\" is used in subdirectory
  970. specifications.  DOS itself will recognize either one as a subdirectory
  971. delimiter, but the command line won't unless the switch char was changed.
  972.  
  973. The upshot of all this is, whereas you might normally use a command like:
  974.    DIR /W C:\GAMES
  975.  
  976. Someone with a different switch character might use something like this:
  977.    DIR -W C:/GAMES
  978.  
  979. This is exactly the sort of syntax that Unix commands use.
  980.  
  981. If you design your program to recognize the different delimiters, you will
  982. make some people very happy!  The GetSwitch routine will detect changed
  983. delimiters on those versions of DOS which support it, and will return an
  984. ordinary "/" on those versions of DOS which don't.
  985.  
  986.    Switch$ = "x"
  987.    GetSwitch Switch$
  988.  
  989. -------
  990. Switch$    the DOS switch character.  Initialize to one character.
  991.  
  992. Name  : GetSwitch2$          (Get Switch character)
  993. Class : Miscellaneous
  994. Level : DOS
  995.  
  996. This does exactly the same thing as the GetSwitch routine, but it is a
  997. FUNCTION rather than a SUB.  For more information, see GetSwitch.
  998.  
  999.    Switch$ = GetSwitch2$
  1000.  
  1001. -------
  1002. Switch$    the DOS switch character
  1003.  
  1004. Name  : GetTime              (Get Time)
  1005. Class : Time
  1006. Level : DOS
  1007.  
  1008. This routine tells you the time according to DOS.
  1009.  
  1010. The main difference between getting the time from BASIC and getting it from
  1011. DOS is the "hundredths of seconds" value.  However, this value is not
  1012. available on some machines, in which case it will be set to zero.  It is not
  1013. accurate on most machines, being calculated instead using a semi-random
  1014. approach; it is more of a novelty than a useful value.
  1015.  
  1016.    GetTime Hour%, Minute%, Second%, Hundredth%
  1017.  
  1018. -------
  1019. Hour%       hour (0-23)
  1020. Minute%     minute
  1021. Second%     second
  1022. Hundredth%  hundredth of a second.  See remarks, above.
  1023.  
  1024. Name  : GetTimeA             (Get Time of file in Archive)
  1025. Class : Disk / Time
  1026. Level : DOS
  1027.  
  1028. GetTimeA returns the time of an archived file matched by the FindFirstA or
  1029. FindNextA routines.
  1030.  
  1031. Routines in this series include:
  1032.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL, GetDateA, GetTimeA,
  1033.    GetSizeAL, GetStoreA
  1034.  
  1035.    GetTimeA Hour%, Minute%, Second%
  1036.  
  1037. -------
  1038. Hour%      hour
  1039. Minute%    minute
  1040. Second%    second
  1041.  
  1042. Name  : GetTimeAT            (Get Time from AT clock)
  1043. Class : Time
  1044. Level : BIOS (AT)
  1045.  
  1046. This routine gets the time from the hardware real-time clock in AT-class
  1047. computers.  Depending on the DOS version, this time may be partially or
  1048. completely independent of the time kept by DOS in software.  DOS always reads
  1049. the time from the hardware clock when it starts up.  However, use of the TIME
  1050. command in DOS (and the TIME$ function in QuickBASIC) may relate only to the
  1051. software copy of the time, which is not always guaranteed to be the same as
  1052. the time in the hardware clock due to certain discrepancies in DOS.
  1053.  
  1054.    GetTimeAT Hour%, Minute%, Second%, ErrCode%
  1055.  
  1056. -------
  1057. Hour%        hour (0-23)
  1058. Minute%      minute
  1059. Second%      second
  1060. ErrCode%     error code: 0 if no error, else the clock has stopped
  1061.  
  1062. Name  : GetTimeF             (Get Time of File)
  1063. Class : Disk / Time
  1064. Level : DOS
  1065.  
  1066. The GetTimeF routine returns the time of a file matched by FindFirstF or
  1067. FindNextF.
  1068.  
  1069. Routines in this series include:
  1070.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF, GetTimeF, GetSizeFL
  1071.  
  1072.    GetTimeF Hour%, Minute%, Second%
  1073.  
  1074. -------
  1075. Hour%      hour
  1076. Minute%    minute
  1077. Second%    second
  1078.  
  1079. Name  : GetTimeFx$           (Get Time of File, Extended)
  1080. Class : Disk / Time
  1081. Level : DOS
  1082.  
  1083. The GetTimeFx$ function returns the time of a file matched by FindFirstFx or
  1084. FindNextFx.
  1085.  
  1086. Routines in this series include:
  1087.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$, GetTimeFx$,
  1088.    GetSizeFx&
  1089.  
  1090.    FileTime$ = GetTimeFx$(Buffer$)
  1091.  
  1092. Buffer$      buffer used in search
  1093. -------
  1094. FileTime$    file time (e.g., "17:53:20")
  1095.  
  1096. Name  : GetTView             (Get TopView)
  1097. Class : Miscellaneous
  1098. Level : BIOS
  1099.  
  1100. This routine tells you whether TopView or a compatible multitasker (such as
  1101. TaskView or DESQview) is loaded.
  1102.  
  1103. See also GetDView, GetTVScreen, UpdTVScreen.
  1104.  
  1105.    GetTView Installed%
  1106.  
  1107. -------
  1108. Installed%   whether a TopView-type multitasker is loaded (0 no)
  1109.  
  1110. Name  : GetTVScreen          (Get TopView Screen address)
  1111. Class : Display / Miscellaneous
  1112. Level : BIOS
  1113.  
  1114. GetTVScreen returns the address of the screen buffer used by a TopView-type
  1115. multitasker.  This allows you to use direct screen access while remaining
  1116. within the windows allocated to your program by the multitasker.
  1117.  
  1118. You must tell the multitasker the address of the screen you would be writing
  1119. to if the multitasker was not installed.  Specify a segment of &HB000 if
  1120. using an MDA or Hercules, or a segment of &HB800 for CGA, EGA, MCGA or VGA.
  1121. The offset should always be 0.  This is for use in text modes.
  1122.  
  1123. The routine will return with the new segment and offset for you to use.
  1124. These values can be used with any PBClone screen routine that accepts a
  1125. segment and offset-- DQPrint and DXQPrint, for example.
  1126.  
  1127. Note that not all TopView-compatible multitaskers will automatically update
  1128. the screen from the buffer.  The UpdTVScreen routine allows you to force a
  1129. screen update.
  1130.  
  1131. See also GetDView, GetTView, UpdTVScreen.
  1132.  
  1133.    GetTVScreen DSeg%, DOfs%
  1134.  
  1135. DSeg%       segment of desired screen
  1136. DOfs%       offset of desired screen
  1137. -------
  1138. DSeg%       segment of screen buffer
  1139. DOfs%       offset of screen buffer
  1140.  
  1141. Name  : GetValidKey          (Get Valid Key)
  1142. Class : Input
  1143. Level : DOS
  1144.  
  1145. This one is useful for getting one of a list of keys from the keyboard.  You
  1146. give it a list of keys (letters should be uppercase) to accept.  It will wait
  1147. until one of the listed keys is pressed; for letters, it will accept either
  1148. lowercase or uppercase keys, but will convert the letter to uppercase before
  1149. it returns to you.  If you pass it a blank list, it will accept any key.
  1150.  
  1151. This routine is handy for when you want to allow one of a list of choices
  1152. from a menu, for instance.
  1153.  
  1154.    GetValidKey GoodList$, Result$
  1155.  
  1156. GoodList$    list of acceptable keys.  See above for remarks.
  1157. -------
  1158. Result$      the key that was accepted.  If a letter, it will be capitalized.
  1159.  
  1160. Name  : GetVerify            (Get Verify setting)
  1161. Class : Disk
  1162. Level : DOS
  1163.  
  1164. The GetVerify routine tells you the state of the DOS VERIFY flag.  When
  1165. VERIFY is on, some checking is done to make sure that writing to the disk
  1166. works as requested.  The checks are not very good, however, and VERIFY slows
  1167. down disk handling, so it is usually better to have VERIFY off.
  1168.  
  1169. You can change the state of VERIFY by using the DOS VERIFY command or with
  1170. the SetVerify routine in PBClone.
  1171.  
  1172.    GetVerify VerifyOn%
  1173.  
  1174. -------
  1175. VerifyOn%   whether VERIFY is on (0 if no)
  1176.  
  1177. Name  : GetVGA               (Get VGA information)
  1178. Class : Display / Equipment
  1179. Level : BIOS
  1180.  
  1181. This routine tells you whether a VGA is available.
  1182.  
  1183. See also GetCRT, GetEGA and GetHGA.
  1184.  
  1185.    GetVGA IsVGA%
  1186.  
  1187. -------
  1188. IsVGA%    whether a VGA is installed (0 if no)
  1189.  
  1190. Name  : GetVGA2%             (Get VGA information)
  1191. Class : Display / Equipment
  1192. Level : BIOS
  1193.  
  1194. This routine tells you whether a VGA is available.
  1195.  
  1196. See also GetCRT, GetEGA and GetHGA.
  1197.  
  1198.    IsVGA% = GetVGA2%
  1199.  
  1200. -------
  1201. IsVGA%    whether a VGA is installed (0 if no)
  1202.  
  1203. Name  : GetVGAPalette        (Get VGA Palette)
  1204. Class : Display
  1205. Level : BIOS
  1206.  
  1207. This routine allows you to get any number of the VGA palette settings into a
  1208. TYPEd array.  The TYPE for the array should be defined like this:
  1209.  
  1210.    TYPE Palet
  1211.       IRed AS STRING * 1
  1212.       IBlue AS STRING * 1
  1213.       IGreen AS STRING * 1
  1214.    END TYPE
  1215.  
  1216. This type holds a CHR$-encoded representation of the intensity of each
  1217. component of the color.  The values range from 0-63.
  1218.  
  1219.    GetVGAPalette DSeg%, DOfs%, Start%, Colors%
  1220.  
  1221. DSeg%      segment of the palette array
  1222. DOfs%      offset of the palette array
  1223. Start%     color number to start with
  1224. Colors%    number of colors to get
  1225.  
  1226. Name  : GetVidMode           (Get Video Mode)
  1227. Class : Display
  1228. Level : BIOS
  1229.  
  1230. The GetVidMode routine tells you about the current display status from the
  1231. BIOS' point of view.  Note that the BIOS display mode is not the same as the
  1232. BASIC SCREEN mode (a direct translation between the two is messy, because
  1233. BASIC conglomerates several BIOS modes into a single SCREEN mode in several
  1234. instances).
  1235.  
  1236.    GetVidMode BIOSMode%, ScreenWidth%, ActivePage%
  1237.  
  1238. -------
  1239. BIOSMode%     BIOS video mode
  1240. ScreenWidth%  number of columns per row
  1241. ActivePage%   active (visible) display page
  1242.  
  1243. Name  : GetXMSm              (Get XMS Memory)
  1244. Class : Memory / Equipment
  1245. Level : DOS
  1246.  
  1247. This routine tells you how much XMS memory is available.  If there is
  1248. none, or if the XMS driver hasn't been installed, it returns zeroes.  Memory
  1249. is returned kilobytes.
  1250.  
  1251.    GetXMSm LargestFree&, TotalFree&
  1252.  
  1253. -------
  1254. LargestFree&  largest free block of XMS memory
  1255. TotalFree&    total free XMS memory
  1256.  
  1257. Name  : GetXMSv              (Get XMS Version)
  1258. Class : Memory / Equipment
  1259. Level : BIOS
  1260.  
  1261. The GetXMSv routine tells you the version of XMS driver that is being used.
  1262. The version number is separated into major and minor parts.  For example, an
  1263. XMS 2.0 driver would return a major number of 2 and minor number of 0.
  1264.  
  1265.    GetXMSv MajorVer%, MinorVer%
  1266.  
  1267. -------
  1268. MajorVer%  major part of the XMS version number
  1269. MinorVer%  minor part of the XMS version number
  1270.  
  1271. Name  : GLoad                (Graphics Load)
  1272. Class : Disk
  1273. Level : DOS
  1274.  
  1275. A replacement for the BASIC BLOAD statement, this routine loads a binary
  1276. memory image from a file into the area of memory it formerly occupied.  This
  1277. is most often used to restore a screen display from a file, although PBClone
  1278. offers more flexible alternatives.
  1279.  
  1280.    GLoad FileName$
  1281.  
  1282. FileName$    name of the file to load into memory
  1283.  
  1284. Name  : GQPrint              (Graphics Quick Print)
  1285. Class : Display
  1286. Level : Clone
  1287.  
  1288. This is a simple high-speed replacement for the PRINT statement which works
  1289. in CGA graphics mode (SCREEN 2).  It does not interpret control codes,
  1290. support graphics characters (ASCII 128-255), or update the cursor position,
  1291. in return for which it is much faster than PRINT.
  1292.  
  1293. The Fast% parameter is ignored at the moment-- top speed is always used,
  1294. which may cause flickering on some CGAs.
  1295.  
  1296.    GQPrint St$, Row%, Column%, Fast%
  1297.  
  1298. St$      string to display
  1299. Row%     row (1-25)
  1300. Column%  column (1-80)
  1301. Fast%    not used
  1302.  
  1303. Name  : GrafPrint            (Graphics Print)
  1304. Class : Display
  1305. Level : Clone
  1306.  
  1307. This is a flexible replacement for the PRINT statement which operates in
  1308. graphics mode.  It allows you to display text at graphics coordinates instead
  1309. of text coordinates for better alignment with graphs and so forth.  It also
  1310. lets you specify the size of the font-- you can stretch it in either vertical
  1311. or horizontal directions, or both, using a font multiplier value.
  1312.  
  1313. The disadvantages of this routine are that it is slower than an ordinary
  1314. PRINT, only does foreground printing (if you need a background color, you
  1315. need to fill that in yourself beforehand), won't do automatic wrap or scroll,
  1316. and won't handle control codes or graphics characters (ASCII 0-31, 127-255).
  1317. The font is based on the normal CGA graphics font, which uses an 8x8 grid for
  1318. each character.
  1319.  
  1320. GrafPrint will work in any graphics mode.
  1321.  
  1322.    GrafPrint St$, X%, Y%, High%, Wide%
  1323.  
  1324. St$      string to display
  1325. X%       graphics column to start at
  1326. Y%       graphics row to start at
  1327. High%    font height multiplier
  1328. Wide%    font width multiplier
  1329.  
  1330. Name  : GrafRest             (Graphics Restore)
  1331. Class : Display
  1332. Level : Clone
  1333.  
  1334. This routine allows you to restore a SCREEN 1 (CGA, 320x200, 4 color) or
  1335. SCREEN 2 (CGA, 640x200, 2 color) display that was saved using GrafSave (see).
  1336.  
  1337.    GrafRest DSeg%, DOfs%
  1338.  
  1339. DSeg%      segment of storage array, returned by VARSEG
  1340. DOfs%      offset  of storage array, returned by VARPTR
  1341.  
  1342. Name  : GrafSave             (Graphics Save)
  1343. Class : Display
  1344. Level : Clone
  1345.  
  1346. This routine allows you to save a SCREEN 1 (CGA, 320x200, 4 color) or SCREEN
  1347. 2 (CGA, 640x200, 2 color) display that can be restored using GrafRest (see).
  1348.  
  1349. The array used to hold the screen must contain 16,000 bytes.  For an integer
  1350. array, this means that you must create the array by DIM Array%(1 TO 8000).
  1351.  
  1352.    GrafSave DSeg%, DOfs%
  1353.  
  1354. DSeg%      segment of storage array, returned by VARSEG
  1355. DOfs%      offset  of storage array, returned by VARPTR
  1356.  
  1357. Name  : GXQPrint             (Graphics Extended Quick Print)
  1358. Class : Display
  1359. Level : Clone
  1360.  
  1361. This is a simple high-speed replacement for the PRINT statement which works
  1362. in CGA graphics mode (SCREEN 1).  It does not interpret control codes,
  1363. support graphics characters (ASCII 128-255), or update the cursor position,
  1364. in return for which it is much faster than PRINT.
  1365.  
  1366. This routine can also be used in SCREEN 2, where it will display the string
  1367. in shades instead of in color (using 40 columns/row).
  1368.  
  1369. The Fast% parameter is ignored at the moment-- top speed is always used,
  1370. which may cause flickering on some CGAs.
  1371.  
  1372.    GXQPrint St$, Row%, Column%, Fore%, Fast%
  1373.  
  1374. St$      string to display
  1375. Row%     row (1-25)
  1376. Column%  column (1-40)
  1377. Fore%    foreground color (0-3)
  1378. Fast%    not used
  1379.  
  1380. Name  : GXQPrint1            (Graphics Extended Quick Print)
  1381. Class : Display
  1382. Level : Clone
  1383.  
  1384. This is a high-speed replacement for the PRINT statement which works in CGA
  1385. graphics mode (SCREEN 1).  It does not interpret control codes or update the
  1386. cursor position, in return for which it is much faster than PRINT.
  1387.  
  1388. This routine can also be used in SCREEN 2, where it will display the string
  1389. in shades instead of in color (using 40 columns/row).
  1390.  
  1391. The Fast% parameter is ignored at the moment-- top speed is always used,
  1392. which may cause flickering on some CGAs.
  1393.  
  1394.    GXQPrint1 St$, Row%, Column%, Fore%, Back%, Fast%
  1395.  
  1396. St$      string to display
  1397. Row%     row (1-25)
  1398. Column%  column (1-40)
  1399. Fore%    foreground color (0-3)
  1400. Back%    background color (0-3)
  1401. Fast%    not used
  1402.  
  1403. Name  : HandleInfo           (Handle Information)
  1404. Class : Miscellaneous
  1405. Level : DOS
  1406.  
  1407. HandleInfo tells you whether a file handle refers to a file or to a device.
  1408. If the handle does not exist, an error code will be returned.
  1409.  
  1410. This is for file handles as returned by FOpen and FCreate.  It can also be
  1411. used with file numbers associated with OPEN, via a BASIC function that was
  1412. introduced with QuickBASIC 4.0:
  1413.  
  1414.    Handle% = FILEATTR(FileNumber%, 2)
  1415.  
  1416. See FClose for a list of predefined handles.
  1417.  
  1418.    HandleInfo Handle%, Device%, ErrCode%
  1419.  
  1420. Handle%    file handle
  1421. -------
  1422. Device%    whether the handle refers to a device (0 no)
  1423. ErrCode%   whether there was an error (0 no)
  1424.  
  1425. Name  : HCls                 (Hercules CLS)
  1426. Class : Display
  1427. Level : Clone
  1428.  
  1429. This routine clears a Hercules graphics screen to the specified color.
  1430.  
  1431. Routines in this series are:
  1432.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  1433.  
  1434.    HCls Colour%
  1435.  
  1436. Colour%    color (0-1)
  1437.  
  1438. Name  : HLine                (Hercules LINE)
  1439. Class : Display
  1440. Level : Clone
  1441.  
  1442. This routine draws a line on a Hercules graphics screen.
  1443.  
  1444. Routines in this series are:
  1445.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  1446.  
  1447.    HLine X1%, Y1%, X2%, Y2%, Colour%
  1448.  
  1449. X1%        starting graphics column (0-719)
  1450. Y1%        starting graphics row (0-347)
  1451. X2%        ending graphics column (0-719)
  1452. Y2%        ending graphics row (0-347)
  1453. Colour%    color (0-1)
  1454.  
  1455. Name  : HMode                (Hercules Mode)
  1456. Class : Display
  1457. Level : Clone
  1458.  
  1459. This routine switches between text mode and Hercules graphics mode.  Use
  1460. HInit first to initialize the graphics mode appropriately.
  1461.  
  1462. HMode will clear page 0 when graphics mode is entered.  Page 1, if it exists,
  1463. is not cleared.  PBClone does not support page 1 in any respect.
  1464.  
  1465. Routines in this series are:
  1466.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  1467.  
  1468.    HMode Graphics%
  1469.  
  1470. Graphics%    display mode to set (0 text, else graphics)
  1471.  
  1472. Name  : HPrint               (Hercules Print)
  1473. Class : Display
  1474. Level : Clone
  1475.  
  1476. This routine displays text in Hercules graphics mode.   It uses the full
  1477. resolution of the screen, so text is 90 columns by 43 rows.  This gives you
  1478. more space than even the largest EGA text mode, which is only 80x43.
  1479.  
  1480. Routines in this series are:
  1481.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  1482.  
  1483.    HPrint St$, Row%, Column%
  1484.  
  1485. St$        text to display
  1486. Row%       row (1-43)
  1487. Column%    column (1-90)
  1488.  
  1489. Name  : HSetPixel            (Hercules Set Pixel)
  1490. Class : Display
  1491. Level : Clone
  1492.  
  1493. This routine draws a dot on a Hercules graphics screen.
  1494.  
  1495. Routines in this series are:
  1496.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  1497.  
  1498.    HSetPixel X%, Y%, Colour%
  1499.  
  1500. X%         graphics column (0-719)
  1501. Y%         graphics row (0-347)
  1502. Colour%    color (0-1)
  1503.  
  1504. Name  : HTestPixel           (Hercules Test Pixel)
  1505. Class : Display
  1506. Level : Clone
  1507.  
  1508. This routine returns the color of a dot on a Hercules graphics screen.
  1509.  
  1510. Routines in this series are:
  1511.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  1512.  
  1513.    Colour% = HTestPixel%(X%, Y%)
  1514.  
  1515. X%         graphics column (0-719)
  1516. Y%         graphics row (0-347)
  1517. -------
  1518. Colour%    color (0-1)
  1519.  
  1520. Name  : IdentifyFile         (Identify File)
  1521. Class : Disk
  1522. Level : DOS
  1523.  
  1524. Given a file name, this routine attempts to identify what kind of file it is.
  1525. Most information is derived from the file extension, but some files are
  1526. processed more deeply.  For instance, a file named "UNKNOWN.BAS" will be
  1527. checked to see if it is source code (tokenized GWBASIC format, tokenized
  1528. QuickBASIC format, or plain ASCII text) or a binary BSAVE/BLOAD image (which
  1529. is further categorized as to whether it is a screen image, and if so, for
  1530. what kind of display).
  1531.  
  1532.    Descript$ = SPACE$(80)
  1533.    IdentifyFile FileName$, Descript$, DescrLen%
  1534.    Descript$ = LEFT$(Descript$, DescrLen%)
  1535.  
  1536. FileName$    name of the file to identify
  1537. -------
  1538. Descript$    description of the file (init to at least 80 chars)
  1539. DescrLen%    length of the description
  1540.  
  1541. Name  : InitPtr              (Initialize Pointers)
  1542. Class : Array management
  1543. Level : Any
  1544.  
  1545. This routine initializes an array of pointers for use with the pointer sort
  1546. routines (PSortD, et al).  It may also be useful for other purposes.  Each
  1547. element of the array is set equal to its index (the first element is set to
  1548. 1, the second to 2, and so forth).  Arrays are expected to begin at element
  1549. 1.  You may specify the last element to initialize, allowing you to use only
  1550. part of an array.
  1551.  
  1552.    InitPtr Ptr%(), Elements%
  1553.  
  1554. Ptr%()      array to initialize
  1555. Elements%   number of elements to initialize
  1556. -------
  1557. Ptr%()      initialized array
  1558.  
  1559. Name  : InsChr               (Insert Character)
  1560. Class : Display
  1561. Level : Clone
  1562.  
  1563. The InsChr routine inserts a space at the specified screen location.
  1564.  
  1565.    InsChr Row%, Column%
  1566.  
  1567. Row%      row of character
  1568. Column%   column of character
  1569.  
  1570. Name  : InsLine              (Insert Line)
  1571. Class : Display
  1572. Level : BIOS
  1573.  
  1574. This routine inserts a blank line at the specified row of the screen.
  1575.  
  1576.    InsLine Row%, Attr%
  1577.  
  1578. Row%      row to insert
  1579. Attr%     color/attribute to use on new row (see CalcAttr)
  1580.  
  1581. Name  : IntVector            (Interrupt Vector)
  1582. Class : Miscellaneous
  1583. Level : DOS
  1584.  
  1585. The IntVector routine retrieves the address of a specified interrupt handler.
  1586. If there is no interrupt handler, the results will normally be zero, although
  1587. earlier DOS versions did not always have the sense to initialize unused
  1588. vectors that way.
  1589.  
  1590.    IntVector DSeg%, DOfs%, Interrupt%
  1591.  
  1592. Interrupt%   interrupt number to examine
  1593. -------
  1594. DSeg%        segment of the interrupt handler
  1595. DOfs%        offset of the interrupt handler
  1596.  
  1597. Name  : Int2Date             (Integer to Date)
  1598. Class : Time
  1599. Level : Any
  1600.  
  1601. This routine undoes the results of the Date2Int routine.  It expands a
  1602. single integer into month, day, and year values.
  1603.  
  1604.    Int2Date MonthNr%, Day%, Year%, IntDate%
  1605.  
  1606. IntDate%     date compressed into an integer
  1607. -------
  1608. MonthNr%     month number (1-12)
  1609. Day%         day (1-31)
  1610. Year%        year (1980-2079; see above for two-digit year handling)
  1611.  
  1612. Name  : Int2Time             (Integer to Time)
  1613. Class : Time
  1614. Level : Any
  1615.  
  1616. This routine undoes the results of the Time2Int routine.  It expands a
  1617. single integer into hour, minute, and second values.
  1618.  
  1619. Note that the seconds will always be even, due to the storage format.
  1620.  
  1621.    Int2Time Hour%, Minute%, Second%, IntTime%
  1622.  
  1623. IntTime%     time compressed into an integer
  1624. -------
  1625. Hour%        hour (0-23)
  1626. Minute%      minute
  1627. Second%      second
  1628.  
  1629. Name  : IStr$                (Integer STR$)
  1630. Class : String
  1631. Level : Any
  1632.  
  1633. This routine is identical to the BASIC function STR$, but is somewhat
  1634. smaller.  It is only for integer values.
  1635.  
  1636.    St$ = IStr$(Number%)
  1637.  
  1638. Number%   integer to convert
  1639. -------
  1640. St$       string form of the number
  1641.  
  1642. Name  : IVal%                (Integer VAL)
  1643. Class : Numeric
  1644. Level : Any
  1645.  
  1646. This routine is similar to the BASIC function VAL, but is much faster.  If
  1647. you are not using floating point numbers, this routine may also decrease the
  1648. size of your program significantly, since it won't cause BASIC to pull in its
  1649. floating point routines as VAL does.
  1650.  
  1651. Unlike VAL, this routine only converts strings to integer values.  It will
  1652. not handle hex or octal strings.  It will not notify you if there is an
  1653. overflow error.  Finally, although IVal% will ignore leading blanks, it
  1654. assumes that a number may not contain blanks, whereas VAL will ignore blanks
  1655. in the middle of a number:
  1656.  
  1657.      VAL("  12 34") returns 1234
  1658.    IVal%("  12 34") returns 12
  1659.  
  1660. Note that, like VAL (but unlike the IVal% function in ProBas), multiple
  1661. negation is considered illegal.  For example, IVal%("--1") returns zero.
  1662.  
  1663.    Number% = IVal%(St$)
  1664.  
  1665. St$       string to convert
  1666. -------
  1667. Number%   integer form of string (0 if there isn't one)
  1668.  
  1669. Name  : KbdType              (Keyboard Type)
  1670. Class : Input / Equipment
  1671. Level : Clone
  1672.  
  1673. This routine tells you if an enhanced (101-key) keyboard is available.
  1674.  
  1675. If KbdType is not entirely sure that an enhanced keyboard is available, it
  1676. plays safe and assumes there isn't one.  This avoids possible disaster on
  1677. older PCs.
  1678.  
  1679.    KbdType Enhanced%
  1680.  
  1681. -------
  1682. Enhanced%    whether keyboard is of the enhanced type (0 no)
  1683.  
  1684. Name  : KbdType2%            (Keyboard Type)
  1685. Class : Input / Equipment
  1686. Level : Clone
  1687.  
  1688. This routine tells you if an enhanced (101-key) keyboard is available.
  1689.  
  1690. If KbdType2% is not entirely sure that an enhanced keyboard is available, it
  1691. plays safe and assumes there isn't one.  This avoids possible disaster on
  1692. older PCs.
  1693.  
  1694.    Enhanced% = KbdType2%
  1695.  
  1696. -------
  1697. Enhanced%    whether keyboard is of the enhanced type (0 no)
  1698.  
  1699. Name  : KeyPress             (detect Key Press)
  1700. Class : Input
  1701. Level : DOS
  1702.  
  1703. This routine works like the Turbo/Power BASIC function INSTAT.  It tells you
  1704. whether there is a key waiting to be processed.
  1705.  
  1706.    KeyPress KeyHit%
  1707.  
  1708. -------
  1709. KeyHit%   whether a key is waiting (0 if no)
  1710.  
  1711. Name  : KVal&                (Kilobyte VAL)
  1712. Class : Numeric
  1713. Level : Any
  1714.  
  1715. This routine is similar to the BASIC function VAL, but is much faster.  The
  1716. number returned is divided by 1024, which is useful if you're dealing in
  1717. terms of kilobytes.  If you are not using floating point numbers, this
  1718. routine may decrease the size of your program significantly, since it won't
  1719. cause BASIC to pull in its floating point routines as VAL does.
  1720.  
  1721. Unlike VAL, this routine only converts strings to long integer values.  It
  1722. will not handle hex or octal strings.  It will not notify you if there is an
  1723. overflow error.  Finally, although KVal& will ignore leading blanks, it
  1724. assumes that a number may not contain blanks, whereas VAL will ignore blanks
  1725. in the middle of a number.
  1726.  
  1727. Note that, like VAL (but unlike the KVal& function in ProBas), multiple
  1728. negation is considered illegal.  For example, KVal&("--10000") returns zero.
  1729.  
  1730.    Number& = KVal&(St$)
  1731.  
  1732. St$       string to convert
  1733. -------
  1734. Number&   long integer form of string, divided by 1024 (0 if no valid number)
  1735.  
  1736. Name  : Locase               (Lowercase)
  1737. Class : String
  1738. Level : Any
  1739.  
  1740. This routine, like BASIC's LCASE$ function, converts a string to lowercase.
  1741. Since it doesn't have to create a new return string (a fairly slow process),
  1742. it's faster than the BASIC equivalent.
  1743.  
  1744. See also Locase1.
  1745.  
  1746.    Locase St$
  1747.  
  1748. St$     string to be put into lowercase
  1749. -------
  1750. St$     lowercase string
  1751.  
  1752. Name  : Locase1              (Lowercase)
  1753. Class : String
  1754. Level : Any
  1755.  
  1756. This routine, like BASIC's LCASE$ function, converts a string to lowercase.
  1757. It converts letters in the extended character set as well as the usual
  1758. letters, making it well suited for text which may not be in English.
  1759.  
  1760. See also Locase.
  1761.  
  1762.    Locase1 St$
  1763.  
  1764. St$     string to be put into lowercase
  1765. -------
  1766. St$     lowercase string
  1767.  
  1768. Name  : LClose               (L/I/M Close)
  1769. Class : Memory
  1770. Level : BIOS
  1771.  
  1772. This routine closes a block of expanded memory that was opened for access by
  1773. LOpen.  It is important to close the block when you are finished with it, to
  1774. return it to the free memory pool.
  1775.  
  1776. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1777.  
  1778.    LClose EMSHandle%
  1779.  
  1780. EMSHandle%    handle of the expanded memory block
  1781.  
  1782. Name  : LGet                 (L/I/M Get)
  1783. Class : Memory
  1784. Level : BIOS
  1785.  
  1786. This routine gets a block of data from expanded memory that was opened for
  1787. access by LOpen.  The amount of data is specified in words; one word is the
  1788. same as two bytes.  An integer takes up a word, long integers and single
  1789. precision numbers require two words, and double precision numbers take four.
  1790.  
  1791. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1792.  
  1793.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  1794.  
  1795. EMSHandle%    handle of the expanded memory block
  1796. DSeg%         segment of place to store data
  1797. DOfs%         offset of place to store data
  1798. Words%        words to get from expanded memory
  1799.  
  1800. Name  : LOpen                (L/I/M Open)
  1801. Class : Memory
  1802. Level : BIOS
  1803.  
  1804. This routine opens a block of expanded memory for access.  The size of the
  1805. block is specified in words; one word is the same as two bytes.  An integer
  1806. takes up a word, long integers and single precision numbers require two
  1807. words, and double precision numbers take four.  This allows you to store up
  1808. to 64K in each EMS block that you open.
  1809.  
  1810. Note that LOpen expects an EMS driver to be available.  If you are not
  1811. certain on this point, use GetLIMM beforehand to make sure.
  1812.  
  1813. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1814.  
  1815.    LOpen Words%, EMSHandle%, ErrCode%
  1816.  
  1817. Words%        size of expanded memory block to allocate
  1818. -------
  1819. EMSHandle%    handle of the expanded memory block
  1820. ErrCode%      error code (0 if no error)
  1821.  
  1822. Name  : LPut                 (L/I/M Put)
  1823. Class : Memory
  1824. Level : BIOS
  1825.  
  1826. This routine puts a block of data into expanded memory that was opened for
  1827. access by LOpen.  The amount of data is specified in words; one word is the
  1828. same as two bytes.  An integer takes up a word, long integers and single
  1829. precision numbers require two words, and double precision numbers take four.
  1830.  
  1831. Routines in this suite include: LOpen, LGet, LPut, LClose.
  1832.  
  1833.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  1834.  
  1835. EMSHandle%    handle of the expanded memory block
  1836. DSeg%         segment of place from which to get data
  1837. DOfs%         offset of place from which to get data
  1838. Words%        words to put into expanded memory
  1839.  
  1840. Name  : LRotate              (Left Rotate)
  1841. Class : String
  1842. Level : Any
  1843.  
  1844. Many years ago, I wrote one of the first terminal programs for the PC.  It
  1845. died a horrible death when Qmodem came out... sigh.  This routine comes from
  1846. that experience.  It rotates the characters in a string left once (e.g.,
  1847. "ABCDE" becomes "BCDEA").  I used this in my routine to dial a list of BBSes,
  1848. skipping to the next one if the current one was busy.
  1849.  
  1850. LRotate can also be handy for things like scrolling a long message across the
  1851. screen (you just PRINT LEFT$(Message$, 80); then delay a bit, LRotate and do
  1852. it again).
  1853.  
  1854. See also RRotate.
  1855.  
  1856.    LRotate St$
  1857.  
  1858. St$     string to be rotated left once
  1859. -------
  1860. St$     string after being rotated left once
  1861.  
  1862. Name  : LScroll              (Left Scroll)
  1863. Class : Display
  1864. Level : Clone
  1865.  
  1866. This routine scrolls any selected part of the display left.  You may scroll
  1867. as many times as you like, or scroll "zero" times to totally clear the
  1868. selected part of the display.
  1869.  
  1870.    LScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  1871.  
  1872. TopRow%      top row of the area to scroll
  1873. LeftCol%     left column of the area to scroll
  1874. BottomRow%   top row of the area to scroll
  1875. RightCol%    left column of the area to scroll
  1876. Times%       number of times (or rows) to scroll
  1877.  
  1878. Name  : LVal&                (Long integer VAL)
  1879. Class : Numeric
  1880. Level : Any
  1881.  
  1882. This routine is similar to the BASIC function VAL, but is much faster.  If
  1883. you are not using floating point numbers, this routine may also decrease the
  1884. size of your program significantly, since it won't cause BASIC to pull in its
  1885. floating point routines as VAL does.
  1886.  
  1887. Unlike VAL, this routine only converts strings to long integer values.  It
  1888. will not handle hex or octal strings.  It will not notify you if there is an
  1889. overflow error.  Finally, although LVal& will ignore leading blanks, it
  1890. assumes that a number may not contain blanks, whereas VAL will ignore blanks
  1891. in the middle of a number:
  1892.  
  1893.      VAL("  12 34") returns 1234
  1894.    LVal&("  12 34") returns 12
  1895.  
  1896. Note that, like VAL (but unlike the LVal& function in ProBas), multiple
  1897. negation is considered illegal.  For example, LVal&("--1") returns zero.
  1898.  
  1899.    Number& = LVal&(St$)
  1900.  
  1901. St$       string to convert
  1902. -------
  1903. Number&   long integer form of string (0 if there isn't one)
  1904.  
  1905. Name  : MakeSub              (Make Subdirectory)
  1906. Class : Disk
  1907. Level : DOS
  1908.  
  1909. Like the DOS MD (or MKDIR) command, this routine creates a new subdirectory.
  1910.  
  1911.    MakeSub SubDir$, ErrCode%
  1912.  
  1913. SubDir$    name of new subdirectory
  1914. -------
  1915. ErrCode%   error code: 0 if none, else DOS Error
  1916.  
  1917. Name  : MatchFile            (Match File)
  1918. Class : Disk / String
  1919. Level : Any
  1920.  
  1921. The MatchFile routine tells you whether a given filename matches a file
  1922. specification which may contain wildcards.  The filename itself should not
  1923. contain wildcards.  Neither the filename nor filespec should include drive or
  1924. subdirectory specifications.
  1925.  
  1926. One way of using this is in processing file exclusion lists.  The FindFirstF
  1927. routine allows you to find files that match a given filespec; to this, you
  1928. could add a MatchFile-based routine which would screen out files that match a
  1929. different filespec.  Such a routine would allow you to create utilities to do
  1930. things like "DIR *.* /EXCEPT=*.BAS".
  1931.  
  1932.    MatchFile FileSpec$, FileName$, IsMatch%
  1933.  
  1934. FileSpec$   master file pattern (may contain wildcards)
  1935. FileName$   name of file to test against the master pattern
  1936. -------
  1937. IsMatch%    0 if the filename doesn't match the filespec
  1938.  
  1939. Name  : Max%                 (Maximum)
  1940. Class : Numeric
  1941. Level : Any
  1942.  
  1943. This function returns the larger of two integers.  It can be handy in
  1944. sorting routines or for keeping a value within a desired range.
  1945.  
  1946.    Larger% = Max%(First%, Second%)
  1947.  
  1948. First%     one integer
  1949. Second%    another integer
  1950. -------
  1951. Larger%    larger of the two integers
  1952.  
  1953. Name  : MaxD#                (Maximum Double precision)
  1954. Class : Numeric
  1955. Level : Any
  1956.  
  1957. This function returns the larger of two double-precision numbers.  It can be
  1958. handy in sorting routines or for keeping a value within a desired range.
  1959.  
  1960.    Larger# = MaxD#(First#, Second#)
  1961.  
  1962. First#     one number
  1963. Second#    another number
  1964. -------
  1965. Larger#    larger of the two numbers
  1966.  
  1967. Name  : MaxL&                (Maximum Long integer)
  1968. Class : Numeric
  1969. Level : Any
  1970.  
  1971. This function returns the larger of two long integers.  It can be handy in
  1972. sorting routines or for keeping a value within a desired range.
  1973.  
  1974.    Larger& = MaxL&(First&, Second&)
  1975.  
  1976. First&     one long integer
  1977. Second&    another long integer
  1978. -------
  1979. Larger&    larger of the two long integers
  1980.  
  1981. Name  : MaxS!                (Maximum Single precision)
  1982. Class : Numeric
  1983. Level : Any
  1984.  
  1985. This function returns the larger of two single-precision numbers.  It can be
  1986. handy in sorting routines or for keeping a value within a desired range.
  1987.  
  1988.    Larger! = MaxS!(First!, Second!)
  1989.  
  1990. First!     one number
  1991. Second!    another number
  1992. -------
  1993. Larger!    larger of the two numbers
  1994.  
  1995. Name  : MeanAverageD         (Mean Average Double precision)
  1996. Class : Array management
  1997. Level : Any
  1998.  
  1999. This routine averages the specified range of elements in an array of double
  2000. precision numbers.  The form of averaging used is called the "mean", which is
  2001. the sum of all of the elements divided by the number of elements involved.
  2002. This is the most common method of averaging a list of numbers.
  2003.  
  2004.    MeanAverageD Array#(), First%, Last%, Average#, ErrCode%
  2005.  
  2006. Array#()    array to be averaged
  2007. First%      array element to start with
  2008. Last%       array element to end with
  2009. -------
  2010. Average#    average value of the specified elements
  2011. ErrCode%    0 if there was no error, else an overflow or (First% > Last%)
  2012.  
  2013. Name  : MeanAverageI         (Mean Average Integer)
  2014. Class : Array management
  2015. Level : Any
  2016.  
  2017. This routine averages the specified range of elements in an array of integer
  2018. numbers.  The form of averaging used is called the "mean", which is the sum
  2019. of all of the elements divided by the number of elements involved. This is
  2020. the most common method of averaging a list of numbers.
  2021.  
  2022.    MeanAverageI Array%(), First%, Last%, Average%, ErrCode%
  2023.  
  2024. Array()     array to be averaged
  2025. First%      array element to start with
  2026. Last%       array element to end with
  2027. -------
  2028. Average%    average value of the specified elements
  2029. ErrCode%    0 if there was no error, else an overflow or (First% > Last%)
  2030.  
  2031. Name  : MeanAverageL         (Mean Average Long integer)
  2032. Class : Array management
  2033. Level : Any
  2034.  
  2035. This routine averages the specified range of elements in an array of long
  2036. integer numbers.  The form of averaging used is called the "mean", which is
  2037. the sum of all of the elements divided by the number of elements involved.
  2038. This is the most common method of averaging a list of numbers.
  2039.  
  2040.    MeanAverageL Array&(), First%, Last%, Average&, ErrCode%
  2041.  
  2042. Array&()    array to be averaged
  2043. First%      array element to start with
  2044. Last%       array element to end with
  2045. -------
  2046. Average&    average value of the specified elements
  2047. ErrCode%    0 if there was no error, else an overflow or (First% > Last%)
  2048.  
  2049. Name  : MeanAverageS         (Mean Average Single precision)
  2050. Class : Array management
  2051. Level : Any
  2052.  
  2053. This routine averages the specified range of elements in an array of single
  2054. precision numbers.  The form of averaging used is called the "mean", which is
  2055. the sum of all of the elements divided by the number of elements involved.
  2056. This is the most common method of averaging a list of numbers.
  2057.  
  2058.    MeanAverageS Array!(), First%, Last%, Average!, ErrCode%
  2059.  
  2060. Array!()    array to be averaged
  2061. First%      array element to start with
  2062. Last%       array element to end with
  2063. -------
  2064. Average!    average value of the specified elements
  2065. ErrCode%    0 if there was no error, else an overflow or (First% > Last%)
  2066.  
  2067. Name  : MemSwap              (Memory Swap)
  2068. Class : Memory
  2069. Level : Any
  2070.  
  2071. MemSwap swaps the contents of one area of memory with another.  This can be
  2072. used for a variety of things, from swapping a saved screen with the actual
  2073. screen to exchanging the contents of two arrays.
  2074.  
  2075.    MemSwap DSeg1%, DOfs1%, DSeg2%, DOfs2%, Bytes%
  2076.  
  2077. DSeg1%     segment of first memory area
  2078. DOfs1%     offset of first memory area
  2079. DSeg2%     segment of second memory area
  2080. DOfs2%     offset of second memory area
  2081. Bytes%     bytes to swap
  2082.  
  2083. Name  : Min%                 (Minimum)
  2084. Class : Numeric
  2085. Level : Any
  2086.  
  2087. This function returns the smaller of two integers.  It can be handy in
  2088. sorting routines or for keeping a value within a desired range.
  2089.  
  2090.    Smaller% = Min%(First%, Second%)
  2091.  
  2092. First%     one integer
  2093. Second%    another integer
  2094. -------
  2095. Smaller%   smaller of the two integers
  2096.  
  2097. Name  : MinD#                (Minimum Double precision)
  2098. Class : Numeric
  2099. Level : Any
  2100.  
  2101. This function returns the smaller of two double-precision numbers.  It can be
  2102. handy in sorting routines or for keeping a value within a desired range.
  2103.  
  2104.    Smaller# = MinD#(First#, Second#)
  2105.  
  2106. First#     one number
  2107. Second#    another number
  2108. -------
  2109. Smaller#   smaller of the two numbers
  2110.  
  2111. Name  : MinL&                (Minimum Long integer)
  2112. Class : Numeric
  2113. Level : Any
  2114.  
  2115. This function returns the smaller of two long integers.  It can be handy in
  2116. sorting routines or for keeping a value within a desired range.
  2117.  
  2118.    Smaller& = MinL&(First&, Second&)
  2119.  
  2120. First&     one long integer
  2121. Second&    another long integer
  2122. -------
  2123. Smaller&   smaller of the two long integers
  2124.  
  2125. Name  : MinS!                (Minimum Single precision)
  2126. Class : Numeric
  2127. Level : Any
  2128.  
  2129. This function returns the smaller of two single-precision numbers.  It can be
  2130. handy in sorting routines or for keeping a value within a desired range.
  2131.  
  2132.    Smaller! = MinS!(First!, Second!)
  2133.  
  2134. First!     one number
  2135. Second!    another number
  2136. -------
  2137. Smaller!   smaller of the two numbers
  2138.  
  2139. Name  : MMButton             (Mouse Button)
  2140. Class : Mouse
  2141. Level : BIOS
  2142.  
  2143. The MMButton routine allows you to find out which mouse buttons are pressed.
  2144. Although it will work with any mouse, it is designed specifically for a mouse
  2145. with two buttons (see also MMButton3).  If you want to find out which buttons
  2146. were pressed in the past, rather than being pressed now, try MMClick instead.
  2147.  
  2148. This routine will not work properly if there is no mouse available.  Use the
  2149. MMCheck routine if you are not sure.
  2150.  
  2151.    MMButton LeftB%, RightB%
  2152.  
  2153. -------
  2154. LeftB%     whether the left button is pressed
  2155. RightB%    whether the right button is pressed
  2156.  
  2157. Name  : MMButton3            (Mouse Button for 3-button mouse)
  2158. Class : Mouse
  2159. Level : BIOS
  2160.  
  2161. The MMButton3 routine allows you to find out which mouse buttons are pressed.
  2162. Although it will work with any mouse, it is designed specifically for a mouse
  2163. with three buttons (see also MMButton).  If you want to find out which
  2164. buttons were pressed in the past, rather than being pressed now, try MMClick3
  2165. instead.
  2166.  
  2167. This routine will not work properly if there is no mouse available.  Use the
  2168. MMCheck routine if you are not sure.
  2169.  
  2170.    MMButton3 LeftB%, MiddleB%, RightB%
  2171.  
  2172. -------
  2173. LeftB%     whether the left button is pressed
  2174. MiddleB%   whether the middle button is pressed
  2175. RightB%    whether the right button is pressed
  2176.  
  2177. Name  : MMCheck              (Mouse Check and initialize)
  2178. Class : Mouse
  2179. Level : BIOS
  2180.  
  2181. This routine does a number of things.  Primarily, it is intended to let you
  2182. check to see if a mouse is available.  It returns a zero if there is no
  2183. mouse; if there is a mouse, the number of mouse buttons is returned.  The
  2184. mouse status is also initialized, so this is best used once at the beginning
  2185. of your program.
  2186.  
  2187. All of the other mouse routines assume that a mouse is available, so you
  2188. should definitely use MMCheck if you're not sure.  Otherwise, results will be
  2189. unusual at best, and the computer may even lock up under some DOS versions.
  2190.  
  2191.    MMCheck Buttons%
  2192.  
  2193. -------
  2194. Buttons%   number of mouse buttons (0 if no mouse is installed)
  2195.  
  2196. Name  : MMClick              (Mouse Click)
  2197. Class : Mouse
  2198. Level : BIOS
  2199.  
  2200. The MMClick routine allows you to find out which mouse buttons have been
  2201. pressed since you last checked, and how many times they were pressed.
  2202. Although it will work with any mouse, it is designed specifically for a mouse
  2203. with two buttons (see also MMClick3).  If you want to find out which buttons
  2204. are currently being pressed, try MMButton instead.
  2205.  
  2206. This routine will not work properly if there is no mouse available.  Use the
  2207. MMCheck routine if you are not sure.
  2208.  
  2209.    MMClick LeftB%, RightB%
  2210.  
  2211. -------
  2212. LeftB%     number of times the left button has been pressed since last check
  2213. RightB%    number of times the right button has been pressed since last check
  2214.  
  2215. Name  : MMClick3             (Mouse Click for 3-button mouse)
  2216. Class : Mouse
  2217. Level : BIOS
  2218.  
  2219. The MMClick3 routine allows you to find out which mouse buttons have been
  2220. pressed since you last checked, and how many times they were pressed.
  2221. Although it will work with any mouse, it is designed specifically for a mouse
  2222. with three buttons (see also MMClick).  If you want to find out which buttons
  2223. are currently being pressed, try MMButton3 instead.
  2224.  
  2225. This routine will not work properly if there is no mouse available.  Use the
  2226. MMCheck routine if you are not sure.
  2227.  
  2228.    MMClick3 LeftB%, MiddleB%, RightB%
  2229.  
  2230. -------
  2231. LeftB%     number of times the left button has been pressed since last check
  2232. MiddleB%   number of times the middle button has been pressed since last check
  2233. RightB%    number of times the right button has been pressed since last check
  2234.  
  2235. Name  : MMCursorOff          (Mouse Cursor Off)
  2236. Class : Mouse
  2237. Level : BIOS
  2238.  
  2239. This routine makes the mouse cursor invisible.  The mouse cursor will still
  2240. function as a location indicator, in the same way that the normal cursor
  2241. still functions when you make it invisible.
  2242.  
  2243. Note that the mouse cursor is somewhat bizarre in that an "invisibility
  2244. level" is kept.  Every time you use MMCursorOff, the invisibility depth is
  2245. increased; subsequent attempts to make the cursor visible will not actually
  2246. do so until the invisibility depth reaches zero.  In other words, if you call
  2247. MMCursorOff when the cursor is already invisible, the cursor will not
  2248. reappear until you've told it to reappear as many times as you told it to
  2249. disappear.  This is fairly demented, but that's the way Microsoft made it.
  2250.  
  2251. This routine will not work properly if no mouse is installed.  See MMCheck.
  2252.  
  2253.    MMCursorOff
  2254.  
  2255. Name  : MMCursorOn           (Mouse Cursor On)
  2256. Class : Mouse
  2257. Level : BIOS
  2258.  
  2259. This routine makes the mouse cursor visible, or tries to do so...
  2260.  
  2261. The mouse cursor is somewhat bizarre in that an "invisibility level" is
  2262. kept.  Every time you use MMCursorOff, the invisibility depth is increased;
  2263. subsequent attempts to make the cursor visible will not actually do so until
  2264. the invisibility depth reaches zero.  In other words, if you call MMCursorOff
  2265. when the cursor is already invisible, the cursor will not reappear until
  2266. you've told it to reappear (with MMCursorOn) as many times as you told it to
  2267. disappear.  This is fairly demented, but that's the way Microsoft made it.
  2268.  
  2269. This routine will not work properly if no mouse is installed.  See MMCheck.
  2270.  
  2271.    MMCursorOn
  2272.  
  2273. Name  : MMGetLoc             (Mouse Get Location)
  2274. Class : Mouse
  2275. Level : BIOS
  2276.  
  2277. This routine allows you to get the current location of the mouse cursor.  It
  2278. doesn't matter if the cursor is visible or invisible.
  2279.  
  2280. The mouse cursor location is somewhat perverse in CGA and text modes, due to
  2281. the sloppy design of Microsoft's original mouse driver.  In text modes and
  2282. both CGA graphics modes, the cursor is returned as if the screen is 640x200.
  2283. To correct this for SCREEN 1, divide the X coordinate by two.  To correct
  2284. this for text modes, divide each coordinate by eight.
  2285.  
  2286. This routine will not work properly if there is no mouse available.  Use the
  2287. MMCheck routine if you are not sure.
  2288.  
  2289. See also GetMouseLoc, which returns the appropriate coordinates for text mode.
  2290.  
  2291.    MMGetLoc X%, Y%
  2292.  
  2293. -------
  2294. X%         X coordinate ("column")
  2295. Y%         Y coordinate ("row")
  2296.  
  2297. Name  : MMSetLoc             (Mouse Set Location)
  2298. Class : Mouse
  2299. Level : BIOS
  2300.  
  2301. This routine allows you to set the current location of the mouse cursor.  It
  2302. doesn't matter if the cursor is visible or invisible.
  2303.  
  2304. The mouse cursor location is somewhat perverse in CGA and text modes, due to
  2305. the sloppy design of Microsoft's original mouse driver.  In text modes and
  2306. both CGA graphics modes, the cursor is returned as if the screen is 640x200.
  2307. To correct this for SCREEN 1, double the X coordinate.  To correct this for
  2308. text modes, multiply each coordinate by eight and add four.
  2309.  
  2310. This routine will not work properly if there is no mouse available.  Use the
  2311. MMCheck routine if you are not sure.
  2312.  
  2313. See also SetMouseLoc, which does the coordinate conversions for you in text
  2314. mode.
  2315.  
  2316.    MMSetLoc X%, Y%
  2317.  
  2318. X%         X coordinate ("column")
  2319. Y%         Y coordinate ("row")
  2320.  
  2321. Name  : MMSetRange           (Mouse Set Range)
  2322. Class : Mouse
  2323. Level : BIOS
  2324.  
  2325. This routine allows you to set the allowable range of mouse cursor locations.
  2326. The mouse cursor will not be permitted to go outside this range.  It doesn't
  2327. matter if the cursor is visible or invisible.
  2328.  
  2329. The mouse cursor location is somewhat perverse in CGA and text modes, due to
  2330. the sloppy design of Microsoft's original mouse driver.  In text modes and
  2331. both CGA graphics modes, the cursor is returned as if the screen is 640x200.
  2332. To correct this for SCREEN 1, double the X coordinate.  To correct this for
  2333. text modes, multiply each coordinate by eight and add four.
  2334.  
  2335. This routine will not work properly if there is no mouse available.  Use the
  2336. MMCheck routine if you are not sure.
  2337.  
  2338.    MMSetRange X1%, Y1%, X2%, Y2%
  2339.  
  2340. X1%       left   X coordinate (upper left "column")
  2341. Y1%       top    Y coordinate (upper left "row")
  2342. X2%       right  X coordinate (lower right "column")
  2343. Y2%       bottom Y coordinate (lower right "row")
  2344.  
  2345. Name  : Month                (Month)
  2346. Class : String / Time
  2347. Level : Any
  2348.  
  2349. Given a month number, this routine tells you the name of the month.
  2350.  
  2351. Note that QuickBASIC is apt to get confused if you use the same name for a
  2352. variable as for a routine.  Since this routine is named "Month", you should
  2353. avoid using a variable called "Month".
  2354.  
  2355.    MonthName$ = SPACE$(9)
  2356.    Month MonthName$, NameLen%, MonthNr%
  2357.    MonthName$ = LEFT$(MonthName$, NameLen)
  2358.  
  2359. MonthNr%    month number (1-12)
  2360. -------
  2361. MonthName$  name of the month.  Init to at least 9 characters.
  2362. NameLen%    length of the month name
  2363.  
  2364. Name  : MouseBuffer          (Mouse Buffer size)
  2365. Class : Mouse
  2366. Level : BIOS
  2367.  
  2368. This routine is used before MouseSave in order to find out how many bytes are
  2369. needed to save the mouse state.
  2370.  
  2371. This routine will not work properly if there is no mouse available.  Use the
  2372. MMCheck routine if you are not sure.
  2373.  
  2374.    MouseBuffer Bytes%
  2375.    St$ = SPACE$(Bytes%)
  2376.    MouseSave St$
  2377.  
  2378. -------
  2379. Bytes%     number of bytes needed to save the state of the mouse
  2380.  
  2381. Name  : MouseCursor          (Mouse Cursor type)
  2382. Class : Mouse
  2383. Level : BIOS
  2384.  
  2385. The MouseCursor routine allows you to select one of a number of graphics
  2386. mouse cursors.  The following types are supported:
  2387.  
  2388.     0   hourglass ("please wait" symbol)
  2389.     1   standard arrow pointer
  2390.     2   pointing hand
  2391.     3   crosshair
  2392.     4   target (box-in-a-box pointer)
  2393.     5   grabbing hand
  2394.  
  2395. If you'd like other shapes, please suggest a few!  I'll be glad to add them.
  2396.  
  2397.    MouseCursor CursorNr%
  2398.  
  2399. CursorNr%    type of mouse graphics cursor to use (see above)
  2400.  
  2401. Name  : MousePen             (Mouse light Pen emulation)
  2402. Class : Mouse
  2403. Level : BIOS
  2404.  
  2405. The mouse can be made to emulate a light pen, allowing you to use BASIC's
  2406. light pen routines to provide a certain minimal level of support for both
  2407. light pens and mice.  This emulation is on by default, but you can turn it
  2408. off in case there is an actual light pen attached.
  2409.  
  2410. This routine will not work properly if there is no mouse available.  Use the
  2411. MMCheck routine if you are not sure.
  2412.  
  2413.    MousePen EmulatePen%
  2414.  
  2415. EmulatePen%   whether to have the mouse emulate a light pen (0 if no)
  2416.  
  2417. Name  : MouseRest            (Mouse status Restore)
  2418. Class : Mouse
  2419. Level : BIOS
  2420.  
  2421. This routine is for use in conjunction with MouseSave.  It allows you to
  2422. restore the mouse settings to a state that was saved in the past.
  2423.  
  2424. This routine will not work properly if there is no mouse available.  Use the
  2425. MMCheck routine if you are not sure.
  2426.  
  2427.    MouseRest St$
  2428.  
  2429. St$        mouse state to restore
  2430.  
  2431. Name  : MouseSave            (Mouse status Save)
  2432. Class : Mouse
  2433. Level : BIOS
  2434.  
  2435. This one is handy for use in subprograms or when SHELLing to other programs
  2436. that may use the mouse.  It allows you to save the current mouse settings as
  2437. a string.  To find out how long the string should be, use MouseBuffer.
  2438.  
  2439. This routine will not work properly if there is no mouse available.  Use the
  2440. MMCheck routine if you are not sure.
  2441.  
  2442.    MouseBuffer Bytes%
  2443.    St$ = SPACE$(Bytes%)
  2444.    MouseSave St$
  2445.  
  2446. -------
  2447. St$        saved mouse state.  Init to the length specified by MouseBuffer.
  2448.  
  2449. Name  : MulMatI              (Multiply Matrix by Integer)
  2450. Class : Array management
  2451. Level : Any
  2452.  
  2453. This routine multiplies as many elements of an integer array as you like by a
  2454. given number, starting at a specified place in the array.  If there was a
  2455. numeric overflow at any point in the operation, an error code will be
  2456. returned.
  2457.  
  2458.    MulMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  2459.  
  2460. DSeg%      segment of the array element to start at, obtained by VARSEG
  2461. DOfs%      offset of the array element to start at, obtained by VARPTR
  2462. Elements%  number of array elements to process
  2463. Value%     value to multiply each array element by
  2464. -------
  2465. ErrCode%   error code: 0 if no error, else there was an overflow
  2466.  
  2467. Name  : MultiAND             (Multiple AND)
  2468. Class : String
  2469. Level : Any
  2470.  
  2471. The MultiAND routine performs an arithmetic "AND" operation on each character
  2472. in a string.
  2473.  
  2474. Among the varied uses for MultiAND is stripping the high bit from characters,
  2475. as you might want to do in telecommunications or in converting WordStar
  2476. files.  In that case, you would use a BitMask% of 127.
  2477.  
  2478.    MultiAND St$, BitMask%
  2479.  
  2480. St$        string to process
  2481. BitMask%   bit mask (0-255) with which to AND each character
  2482. -------
  2483. St$        processed string
  2484.  
  2485. Name  : MultiOR              (Multiple OR)
  2486. Class : String
  2487. Level : Any
  2488.  
  2489. The MultiOR routine performs an arithmetic "OR" operation on each character
  2490. in a string.
  2491.  
  2492.    MultiOR St$, BitMask%
  2493.  
  2494. St$        string to process
  2495. BitMask%   bit mask (0-255) with which to OR each character
  2496. -------
  2497. St$        processed string
  2498.  
  2499. Name  : MultiXOR             (Multiple XOR)
  2500. Class : String
  2501. Level : Any
  2502.  
  2503. The MultiXOR routine performs an arithmetic "XOR" operation on each character
  2504. in a string.
  2505.  
  2506.    MultiXOR St$, BitMask%
  2507.  
  2508. St$        string to process
  2509. BitMask%   bit mask (0-255) with which to XOR each character
  2510. -------
  2511. St$        processed string
  2512.  
  2513. Name  : NameCase             (Name Case)
  2514. Class : String
  2515. Level : Any
  2516.  
  2517. This routine provides a specialized uppercase/lowercase converter designed
  2518. especially for names.  It converts the first letter in each word in a string
  2519. to uppercase, with the rest of the word being converted to lowercase.
  2520.  
  2521. See also NameCase2, the FUNCTION version of this routine.
  2522.  
  2523.    NameCase St$
  2524.  
  2525. St$         string to process
  2526. -------
  2527. St$         processed string
  2528.  
  2529. Name  : NameCase2$           (Name Case)
  2530. Class : String
  2531. Level : Any
  2532.  
  2533. This routine provides a specialized uppercase/lowercase converter designed
  2534. especially for names.  It converts the first letter in each word in a string
  2535. to uppercase, with the rest of the word being converted to lowercase.
  2536.  
  2537. See also NameCase, the SUB version of this routine.
  2538.  
  2539.    Result$ = NameCase2$(St$)
  2540.  
  2541. St$         string to process
  2542. -------
  2543. Result$     processed string
  2544.  
  2545. Name  : NumFormat            (Number Format)
  2546. Class : Numeric
  2547. Level : DOS
  2548.  
  2549. This works just like PRINT USING, but returns the results in a string rather
  2550. than sending them to the display or a file.
  2551.  
  2552. Note that an interaction between QuickBASIC, DOS and some networks means that
  2553. this routine will briefly access the default drive.  Strange but true.
  2554.  
  2555.    NumFormat Format$, Number#, Result$
  2556.  
  2557. Format$     numeric format
  2558. Number#     number to format
  2559. -------
  2560. Result$     formatted number
  2561.  
  2562. Name  : NumProc              (Numeric Processor)
  2563. Class : Equipment
  2564. Level : Any
  2565.  
  2566. NumProc returns the type of numeric coprocessor installed.  I haven't tried
  2567. it with a 80486, but I would guess an 80486 always appears to have an 80387
  2568. (unless it's one of those brain-damaged 80486SX chips).
  2569.  
  2570. Results are returned as follows:
  2571.  
  2572.    0    no math chip
  2573.    1    8087
  2574.    2    80287
  2575.    3    80387
  2576.  
  2577. If anyone can tell me how to better handle a 486 here, I'd appreciate it.
  2578.  
  2579.    NumProc ProcType%
  2580.  
  2581. -------
  2582. ProcType%    type of numeric coprocessor (see above)
  2583.  
  2584. Name  : NumProc2%            (Numeric Processor)
  2585. Class : Equipment
  2586. Level : Any
  2587.  
  2588. NumProc2% returns the type of numeric coprocessor installed.  I haven't tried
  2589. it with a 80486, but I would guess an 80486 always appears to have an 80387
  2590. (unless it's one of those brain-damaged 80486SX chips).
  2591.  
  2592.  
  2593. Results are returned as follows:
  2594.  
  2595.    0    no math chip
  2596.    1    8087
  2597.    2    80287
  2598.    3    80387
  2599.  
  2600. If anyone can tell me how to better handle a 486 here, I'd appreciate it.
  2601.  
  2602.    ProcType% = NumProc2%
  2603.  
  2604. -------
  2605. ProcType%    type of numeric coprocessor (see above)
  2606.  
  2607. Name  : ObjScan              (Object file Scan)
  2608. Class : Disk
  2609. Level : DOS
  2610.  
  2611. This routine returns information about a specified .OBJ file.  It returns the
  2612. module name, public names, and external names.  The module name is generally
  2613. the name of the original file which was compiled to produce the .OBJ file.
  2614. Public names are the names of routines (and sometimes variables) that can be
  2615. accessed by outside programs.  External names are the names of routines (and
  2616. variables) that the .OBJ file expects to be provided by outside programs.
  2617.  
  2618. External names containing "$", starting with "_" or with lowercase characters
  2619. are screened out to avoid returning a huge list of BASIC internal routines.
  2620. For the same reason, routines ending with "QQ" will also be screened out, as
  2621. will STRINGADDRESS, STRINGASSIGN, STRINGLENGTH, and STRINGRELEASE.  Y'know,
  2622. it would be nice if Microsoft followed some sort of standard for its names.
  2623.  
  2624. The public and external names are returned in string arrays.  ObjScan will
  2625. fail with an error code if there is insufficient space, so be sure to allow
  2626. plenty of room.  If scanning subprograms, a DIM to 30 or 40 elements is
  2627. probably ample.  If scanning large programs, you may need to increase the
  2628. dimensions substantially.
  2629.  
  2630. The ObjScan routine can be used as the basis for a simple ".OBJ info" utility
  2631. or for more complex applications, such as library management.
  2632.  
  2633.    ObjScan ObjFile$, ModName$, Routine$(), External$(), ErrCode%
  2634.  
  2635. ObjFile$      name of .OBJ file
  2636. -------
  2637. ModName$      module name
  2638. Routine$()    public names
  2639. External$()   external names
  2640. ErrCode%      whether there was an error (0 no)
  2641.  
  2642. Name  : OrSt                 (OR String)
  2643. Class : String
  2644. Level : Any
  2645.  
  2646. This routine ORs each byte in one string with the corresponding byte in a
  2647. second string.  The strings must be the same length.
  2648.  
  2649.    OrSt St1$, St2$
  2650.  
  2651. St1$      string to OR
  2652. St2$      string to OR with
  2653. -------
  2654. St1$      result
  2655.  
  2656. Name  : ParseFSpec           (Parse File Specification)
  2657. Class : Disk
  2658. Level : Any
  2659.  
  2660. This routine splits a file specification into a drive, subdirectory, and
  2661. filename.  You are expected to initialize the return strings to reasonable
  2662. values beforehand (1 for drive, 64 for subdirectory, 12 for filename).  If
  2663. the filespec may be invalid, you may wish to leave additional space to avoid
  2664. potentially disastrous overflows.  An alternative would be to use ExtendFSpec
  2665. beforehand to check and complete the file specification.  This is likely to
  2666. be a good approach anyway-- these two routines complement each other nicely.
  2667.  
  2668.    Drive$ = SPACE$(1)
  2669.    Subdir$ = SPACE$(64)
  2670.    File$ = SPACE$(12)
  2671.    ParseFSpec FileSpec$, Drive$, DLen%, Subdir$, SLen%, File$, FLen%
  2672.    Drive$ = LEFT$(Drive$, DLen%)
  2673.    Subdir$ = LEFT$(Subdir$, SLen%)
  2674.    File$ = LEFT$(File$, FLen%)
  2675.  
  2676. FileSpec$   file specification
  2677. -------
  2678. Drive$      drive letter
  2679. DLen%       length of Drive$
  2680. SubDir$     subdirectory
  2681. SLen%       length of Subdir$
  2682. File$       file name
  2683. FLen%       length of File$
  2684.  
  2685. Name  : PatchDone            (Patch Done)
  2686. Class : Disk
  2687. Level : DOS
  2688.  
  2689. This routine closes the file opened by FindPatch.  You must use PatchDone
  2690. when you are finished patching the file.
  2691.  
  2692. Routines in this set include FindPatch, SetPatch, and PatchDone.
  2693.  
  2694.    PatchDone
  2695.  
  2696. Name  : PCDat$               (PC Date)
  2697. Class : Equipment
  2698. Level : Clone
  2699.  
  2700. The PCDat$ routine tells you the date of the BIOS ROM chip.  This date is not
  2701. always available on some (mostly older) clones, in which case "No Date" is
  2702. returned.
  2703.  
  2704.    ROMDate$ = PCDat$
  2705.  
  2706. -------
  2707. ROMDate$   date of the BIOS ROM (xx/xx/xx).
  2708.  
  2709. Name  : PCDate               (PC Date)
  2710. Class : Equipment
  2711. Level : Clone
  2712.  
  2713. The PCDate routine tells you the date of the BIOS ROM chip.  This date is not
  2714. always available on some (mostly older) clones, in which case "No Date " is
  2715. returned.  See also PCDat, a function version of this routine.
  2716.  
  2717.    ROMDate$ = SPACE$(8)
  2718.    PCDate ROMDate$
  2719.  
  2720. -------
  2721. ROMDate$   date of the BIOS ROM (xx/xx/xx).  Init to at least 8 chars.
  2722.  
  2723. Name  : PCType               (PC Type)
  2724. Class : Equipment
  2725. Level : Clone
  2726.  
  2727. This routine returns the machine I.D. code.  This code may not be one of the
  2728. listed values for some (mostly older) clones, but the following is usually
  2729. correct:
  2730.    I.D.  ....Machine....
  2731.    255   PC or XT
  2732.    254   XT
  2733.    253   PCjr
  2734.    252   PC AT
  2735.    251   XT
  2736.    250   PS/2 Model 30
  2737.    249   PC Convertible
  2738.    248   PS/2 Model 70 or 80
  2739.    154   Compaq Portable
  2740.     45   Compaq Portable
  2741.  
  2742. Note that, for identification purposes, a PC and XT are essentially the same.
  2743. The XT is simply a PC with an auto-boot hard drive.  New I.D. numbers come
  2744. out more or less at random from IBM, although they aren't as capricious about
  2745. it as they used to be.  It is useful to identify Compaq Portables as separate
  2746. from PCs because those machines had an unusual display, which acts like a CGA
  2747. but has the resolution (in text modes) of an MDA.  Hence, the cursor size of
  2748. a Compaq Portable is MDA-sized in text mode, but CGA-sized in graphics modes,
  2749. even though ordinary tests will tell your program that a CGA is attached.  If
  2750. you intend to alter the cursor size, this is an important distinction, since
  2751. the Compaq Portable was a great success and is still in wide use.  Current
  2752. Compaq machines, like most other clones, follow the standard IBM I.D. codes.
  2753.  
  2754. See also PCType2, a function version of this routine.
  2755.  
  2756.    PCType MachineID%
  2757.  
  2758. -------
  2759. MachineID%   type of computer
  2760.  
  2761. Name  : PCType2%             (PC Type)
  2762. Class : Equipment
  2763. Level : Clone
  2764.  
  2765. This routine returns the machine I.D. code.  This code may not be one of the
  2766. listed values for some (mostly older) clones, but the following is usually
  2767. correct:
  2768.    I.D.  ....Machine....
  2769.    255   PC or XT
  2770.    254   XT
  2771.    253   PCjr
  2772.    252   PC AT
  2773.    251   XT
  2774.    250   PS/2 Model 30
  2775.    249   PC Convertible
  2776.    248   PS/2 Model 70 or 80
  2777.    154   Compaq Portable
  2778.     45   Compaq Portable
  2779.  
  2780. Note that, for identification purposes, a PC and XT are essentially the same.
  2781. The XT is simply a PC with an auto-boot hard drive.  New I.D. numbers come
  2782. out more or less at random from IBM, although they aren't as capricious about
  2783. it as they used to be.  It is useful to identify Compaq Portables as separate
  2784. from PCs because those machines had an unusual display, which acts like a CGA
  2785. but has the resolution (in text modes) of an MDA.  Hence, the cursor size of
  2786. a Compaq Portable is MDA-sized in text mode, but CGA-sized in graphics modes,
  2787. even though ordinary tests will tell your program that a CGA is attached.  If
  2788. you intend to alter the cursor size, this is an important distinction, since
  2789. the Compaq Portable was a great success and is still in wide use.  Current
  2790. Compaq machines, like most other clones, follow the standard IBM I.D. codes.
  2791.  
  2792.    MachineID% = PCType2%
  2793.  
  2794. -------
  2795. MachineID%   type of computer
  2796.  
  2797. Name  : PrinterReady%        (Printer Ready)
  2798. Class : Printer
  2799. Level : BIOS
  2800.  
  2801. This function lets you know if a printer is ready.  It checks to make sure
  2802. that the specified port exists, then makes sure a printer is connected,
  2803. turned on, and has paper in it.
  2804.  
  2805. Note that this will not work on serial printers, even if the MODE command was
  2806. used to redirect the port.  It works at the BIOS level, so it doesn't know
  2807. about any fooling around DOS does.
  2808.  
  2809.    Ready% = PrinterReady%(Port%)
  2810.  
  2811. Port%         parallel port number (1-3)
  2812. -------
  2813. Ready%        whether there's a printer ready at that port (0 if not)
  2814.  
  2815. Name  : PrintFile            (Print File)
  2816. Class : Printer
  2817. Level : DOS
  2818.  
  2819. This routine sends a file to the printer.  It does not paginate, spool, or
  2820. anything else fancy.  The LPT1 or PRN device is used by default, although you
  2821. can change this using the PrtSwap routine.
  2822.  
  2823. The predefined device handle for stdprn is used, so don't use FClose to free
  2824. that handle if you expect to use this routine.  The results would be nasty.
  2825.  
  2826.    PrintFile FileName$, ErrCode%
  2827.  
  2828. FileName$     name of the file to print
  2829. -------
  2830. ErrCode%      whether there was an error (0 no, else DOS Error)
  2831.  
  2832. Name  : PrintScreen          (Print Screen)
  2833. Class : Display / Printer
  2834. Level : BIOS
  2835.  
  2836. Just like pressing the PrtSc/PrintScrn key on the keyboard, this routine
  2837. sends the contents of the display to the printer.  It is mostly designed for
  2838. text modes, but use of the GRAPHICS TSR provided with DOS will allow it to
  2839. print out CGA graphics displays as well.  For some reason, the GRAPHICS
  2840. utility does not handle Hercules, EGA or VGA displays; however, alternative
  2841. utilities which provide such features may be obtained from your local BBS.
  2842.  
  2843.    PrintScreen
  2844.  
  2845. Name  : Processor            (Processor)
  2846. Class : Equipment
  2847. Level : Any
  2848.  
  2849. Processor returns the type of processor (CPU) installed.
  2850.  
  2851. Results are returned as follows:
  2852.  
  2853.    0    NEC V20
  2854.    1    8088 or 8086
  2855.    2    80186
  2856.    3    80286
  2857.    4    80386 or 80486
  2858.  
  2859. If anyone can tell me how to better handle a 486 here, I'd appreciate it.
  2860.  
  2861. Note that, for most practical purposes, a NEC V20 works just like an 80186.
  2862.  
  2863.    Processor ProcType%
  2864.  
  2865. -------
  2866. ProcType%    type of CPU (see above)
  2867.  
  2868. Name  : Processor2%          (Processor)
  2869. Class : Equipment
  2870. Level : Any
  2871.  
  2872. Processor returns the type of processor (CPU) installed.
  2873.  
  2874. Results are returned as follows:
  2875.  
  2876.    0    NEC V20
  2877.    1    8088 or 8086
  2878.    2    80186
  2879.    3    80286
  2880.    4    80386 or 80486
  2881.  
  2882. If anyone can tell me how to better handle a 486 here, I'd appreciate it.
  2883.  
  2884.    ProcType% = Processor2%
  2885.  
  2886. -------
  2887. ProcType%    type of CPU (see above)
  2888.  
  2889. Name  : PrtSc                (Print Screen key)
  2890. Class : Input / Printer
  2891. Level : BIOS
  2892.  
  2893. This routine allows you to disable the "print screen" key.  This only affects
  2894. the keyboard, not the PrintScreen routine in PBClone.
  2895.  
  2896. If you disable the "print screen" key, be sure to enable it again before your
  2897. program ends.  Otherwise, the "print screen" key will be left in an undefined
  2898. state, probably causing the computer to crash when it is next pressed.
  2899.  
  2900.    PrtSc Enable%
  2901.  
  2902. Enable%   whether "print screen" should be enabled (0 no)
  2903.  
  2904. Name  : PrtSwap              (Printer Swap)
  2905. Class : Printer
  2906. Level : Clone
  2907.  
  2908. It's handy to use LPRINT, but it isn't always practical.  LPRINT only works
  2909. on the first printer available (PRN or LPT1).  With this routine, it doesn't
  2910. matter.  PrtSwap allows you to swap any two printer ports.
  2911.  
  2912. Note that it's a good idea to swap the ports back to their original locations
  2913. before exiting your program.  You could cause major confusion otherwise!
  2914.  
  2915.    PrtSwap Port1%, Port2%
  2916.  
  2917. Port1%    number of the first port (1-3)
  2918. Port2%    number of the second port (1-3)
  2919.  
  2920. Name  : PSortD               (Pointer Sort Double precision)
  2921. Class : Array management
  2922. Level : Any
  2923.  
  2924. This routine sorts the elements in a double precision array... well,
  2925. actually, it doesn't change the position of anything in the double precision
  2926. array.  It sorts the array using a set of pointers to the array.  You can
  2927. then use the pointers to refer to the array or to re-order the array yourself.
  2928.  
  2929. Why bother with pointers?  Well, it's a lot faster than sorting the numbers
  2930. directly, since less information has to be swapped.  It has another major
  2931. advantage, though-- it allows you to sort an array without losing track of
  2932. how it corresponds to any related arrays.
  2933.  
  2934. The array is assumed to start at element 1.  You may specify the last element
  2935. in the array, allowing you to sort only part of an array if you like.
  2936.  
  2937. The pointer array must be initialized so that each element is equal to its
  2938. index.  Either use InitPtr or do:
  2939.    FOR tmp% = 1 TO Elements%
  2940.       Ptr%(tmp%) = tmp%
  2941.    NEXT
  2942.  
  2943. After this routine, you can access the sorted array via the pointer array.
  2944. For instance, to print out a sorted double precision array, you'd use:
  2945.    FOR tmp% = 1 TO Elements%
  2946.       PRINT Array#(Ptr%(tmp%))
  2947.    NEXT
  2948.  
  2949. If you would like the results to be last-to-first, rather than first-to-last,
  2950. just call ReverseI to reverse the pointer array (after this routine).
  2951.  
  2952.    PSortD Ptr%(), Array#(), Elements%
  2953.  
  2954. Ptr%()      pointers to array to be sorted
  2955. Array#()    array to be sorted
  2956. Elements%   number of elements in array
  2957. -------
  2958. Ptr%()      pointers which allow you to access the array in sorted order
  2959.  
  2960. Name  : PSortI               (Pointer Sort Integer)
  2961. Class : Array management
  2962. Level : Any
  2963.  
  2964. This routine sorts the elements in an integer array... well, actually, it
  2965. doesn't change the position of anything in the integer array.  It sorts the
  2966. array using a set of pointers to the array.  You can then use the pointers to
  2967. refer to the array or to re-order the array yourself.
  2968.  
  2969. Why bother with pointers?  It has a major advantage-- it allows you to sort
  2970. an array without losing track of how it corresponds to any related arrays.
  2971.  
  2972. The array is assumed to start at element 1.  You may specify the last element
  2973. in the array, allowing you to sort only part of an array if you like.
  2974.  
  2975. The pointer array must be initialized so that each element is equal to its
  2976. index.  Either use InitPtr or do:
  2977.    FOR tmp% = 1 TO Elements%
  2978.       Ptr%(tmp%) = tmp%
  2979.    NEXT
  2980.  
  2981. After this routine, you can access the sorted array via the pointer array.
  2982. For instance, to print out a sorted integer array, you'd use:
  2983.    FOR tmp% = 1 TO Elements%
  2984.       PRINT Array%(Ptr%(tmp%))
  2985.    NEXT
  2986.  
  2987. If you would like the results to be last-to-first, rather than first-to-last,
  2988. just call ReverseI to reverse the pointer array (after this routine).
  2989.  
  2990.    PSortI Ptr%(), Array%(), Elements%
  2991.  
  2992. Ptr%()      pointers to array to be sorted
  2993. Array%()    array to be sorted
  2994. Elements%   number of elements in array
  2995. -------
  2996. Ptr%()      pointers which allow you to access the array in sorted order
  2997.  
  2998. Name  : PSortL               (Pointer Sort Long integer)
  2999. Class : Array management
  3000. Level : Any
  3001.  
  3002. This routine sorts the elements in a long integer array... well, actually, it
  3003. doesn't change the position of anything in the long integer array.  It sorts
  3004. the array using a set of pointers to the array.  You can then use the
  3005. pointers to refer to the array or to re-order the array yourself.
  3006.  
  3007. Why bother with pointers?  Well, it's a lot faster than sorting the numbers
  3008. directly, since less information has to be swapped.  It has another major
  3009. advantage, though-- it allows you to sort an array without losing track of
  3010. how it corresponds to any related arrays.
  3011.  
  3012. The array is assumed to start at element 1.  You may specify the last element
  3013. in the array, allowing you to sort only part of an array if you like.
  3014.  
  3015. The pointer array must be initialized so that each element is equal to its
  3016. index.  Either use InitPtr or do:
  3017.    FOR tmp% = 1 TO Elements%
  3018.       Ptr%(tmp%) = tmp%
  3019.    NEXT
  3020.  
  3021. After this routine, you can access the sorted array via the pointer array.
  3022. For instance, to print out a sorted long integer array, you'd use:
  3023.    FOR tmp% = 1 TO Elements%
  3024.       PRINT Array&(Ptr%(tmp%))
  3025.    NEXT
  3026.  
  3027. If you would like the results to be last-to-first, rather than first-to-last,
  3028. just call ReverseI to reverse the pointer array (after this routine).
  3029.  
  3030.    PSortL Ptr%(), Array&(), Elements%
  3031.  
  3032. Ptr%()      pointers to array to be sorted
  3033. Array&()    array to be sorted
  3034. Elements%   number of elements in array
  3035. -------
  3036. Ptr%()      pointers which allow you to access the array in sorted order
  3037.  
  3038. Name  : PSortS               (Pointer Sort Single precision)
  3039. Class : Array management
  3040. Level : Any
  3041.  
  3042. This routine sorts the elements in a single precision array... well,
  3043. actually, it doesn't change the position of anything in the single precision
  3044. array.  It sorts the array using a set of pointers to the array.  You can
  3045. then use the pointers to refer to the array or to re-order the array yourself.
  3046.  
  3047. Why bother with pointers?  Well, it's a lot faster than sorting the numbers
  3048. directly, since less information has to be swapped.  It has another major
  3049. advantage, though-- it allows you to sort an array without losing track of
  3050. how it corresponds to any related arrays.
  3051.  
  3052. The array is assumed to start at element 1.  You may specify the last element
  3053. in the array, allowing you to sort only part of an array if you like.
  3054.  
  3055. The pointer array must be initialized so that each element is equal to its
  3056. index.  Either use InitPtr or do:
  3057.    FOR tmp% = 1 TO Elements%
  3058.       Ptr%(tmp%) = tmp%
  3059.    NEXT
  3060.  
  3061. After this routine, you can access the sorted array via the pointer array.
  3062. For instance, to print out a sorted single precision array, you'd use:
  3063.    FOR tmp% = 1 TO Elements%
  3064.       PRINT Array!(Ptr%(tmp%))
  3065.    NEXT
  3066.  
  3067. If you would like the results to be last-to-first, rather than first-to-last,
  3068. just call ReverseI to reverse the pointer array (after this routine).
  3069.  
  3070.    PSortS Ptr%(), Array!(), Elements%
  3071.  
  3072. Ptr%()      pointers to array to be sorted
  3073. Array!()    array to be sorted
  3074. Elements%   number of elements in array
  3075. -------
  3076. Ptr%()      pointers which allow you to access the array in sorted order
  3077.  
  3078. Name  : PSortSt              (Pointer Sort String)
  3079. Class : Array management
  3080. Level : Any
  3081.  
  3082. This routine sorts the elements in a string array... well, actually, it
  3083. doesn't change the position of anything in the string array.  It sorts the
  3084. array using a set of pointers to the array.  You can then use the pointers to
  3085. refer to the array or to re-order the array yourself.
  3086.  
  3087. Why bother with pointers?  Well, it's a lot faster than sorting the strings
  3088. directly, since less information has to be swapped.  It has another major
  3089. advantage, though-- it allows you to sort an array without losing track of
  3090. how it corresponds to any related arrays.  For instance, if you have one
  3091. array holding names and another holding phone numbers, this allows you to
  3092. sort on names without losing track of which phone numbers are which.
  3093.  
  3094. The array is assumed to start at element 1.  You may specify the last element
  3095. in the array, allowing you to sort only part of an array if you like.  You
  3096. can also specify whether the capitalization of letters in a string should
  3097. matter for sorting purposes.
  3098.  
  3099. The pointer array must be initialized so that each element is equal to its
  3100. index.  Either use InitPtr or do:
  3101.    FOR tmp% = 1 TO Elements%
  3102.       Ptr%(tmp%) = tmp%
  3103.    NEXT
  3104.  
  3105. After this routine, you can access the sorted array via the pointer array.
  3106. For instance, to print out a sorted string array, you'd use:
  3107.    FOR tmp% = 1 TO Elements%
  3108.       PRINT Array$(Ptr%(tmp%))
  3109.    NEXT
  3110.  
  3111. If you would like the results to be last-to-first, rather than first-to-last,
  3112. just call ReverseI to reverse the pointer array (after this routine).
  3113.  
  3114.    PSortSt Ptr%(), Array$(), CapsCount%, Elements%
  3115.  
  3116. Ptr%()      pointers to array to be sorted
  3117. Array$()    array to be sorted
  3118. CapsCount%  use 0 if uppercase/lowercase distinctions don't matter
  3119. Elements%   number of elements in array
  3120. -------
  3121. Ptr%()      pointers which allow you to access the array in sorted order
  3122.  
  3123. Name  : PutScreen            (Put Screen)
  3124. Class : Display
  3125. Level : Clone
  3126.  
  3127. This routine restores a portion of the display (which was saved to an array
  3128. by DGetScreen or GetScreen) to the screen.  Only text modes are supported.
  3129. If your program uses multiple display pages, you can put the image onto any
  3130. of those pages.  A special "slow" mode is supported for the CGA, to prevent
  3131. flickering (a problem only with some CGAs).
  3132.  
  3133. If you wish to restore the entire screen, you may find ScrRest easier (see).
  3134.  
  3135.    PutScreen Array%(), TopRow%, LeftCol%, BotRow%, RightCol%, Page%, Fast%
  3136.  
  3137. Array%()   array from which to restore the image
  3138. TopRow%    top row of the desired screen area
  3139. LeftCol%   left column of the desired screen area
  3140. BotRow%    bottom row of the desired screen area
  3141. RightCol%  right column of the desired screen area
  3142. Page%      page on which to restore the display
  3143. Fast%      whether to use fast mode (nonzero if so; else slow, for some CGAs)
  3144.  
  3145. Name  : QPrint               (Quick Print)
  3146. Class : Display
  3147. Level : Clone
  3148.  
  3149. This is a replacement for the PRINT statement.  It is less flexible in that
  3150. it does not move the cursor or interpret control codes, and because it uses
  3151. the color that is already on the screen instead of a specified color value.
  3152. It also works only in text modes.
  3153.  
  3154. In exchange, QPrint gives you much faster display speeds.
  3155.  
  3156. See also XQPrint, which is a bit more flexible (and somewhat slower).
  3157.  
  3158.    QPrint St$, Row%, Column%, Page%, Fast%
  3159.  
  3160. St$        text to display
  3161. Row%       starting row
  3162. Column%    starting column
  3163. Page%      page on which to display
  3164. Fast%      whether to use fast mode (nonzero if so; else slow, for some CGAs)
  3165.  
  3166. Name  : Rand%                (Random number)
  3167. Class : Numeric
  3168. Level : Clone
  3169.  
  3170. This is a pseudo-random number function.  It returns a "random" number in a
  3171. range you specify (e.g., if you pass it 10, it will return 0-9).  The number
  3172. is less random than you'd get from the BASIC function RND, and you can't set
  3173. a random number seed a la RANDOMIZE.  There is one major advantage to Rand%,
  3174. however: it doesn't bring in BASIC's floating point support, which makes it
  3175. much faster than RND and may make your program much smaller.
  3176.  
  3177.    Number% = Rand%(Range%)
  3178.  
  3179. Range%      range of desired pseudo-random number
  3180. -------
  3181. Number%     pseudo-random number from 0 to Range% - 1
  3182.  
  3183. Name  : ReadBitF             (Read Bit Field)
  3184. Class : Numeric
  3185. Level : Any
  3186.  
  3187. This routine allows you to get an element of a virtual array.  The actual
  3188. array can be any numeric type, as it is just being used as a storage area.
  3189. The virtual array is composed of numbers of a bit length that you specify
  3190. (1-8).  This provides efficient storage for numbers which have a limited
  3191. range.
  3192.  
  3193. See also WriteBitF.
  3194.  
  3195.    ReadBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  3196.  
  3197. DSeg%        segment of actual array
  3198. DOfs%        offset of actual array
  3199. ElementNr&   virtual element number (starts at 0)
  3200. BitLen%      bits per virtual element (1-8)
  3201. -------
  3202. Value%       result (0-255 or less, depending on BitLen%)
  3203.  
  3204. Name  : Reboot               (Reboot)
  3205. Class : Miscellaneous
  3206. Level : Clone
  3207.  
  3208. This routine restarts the computer, just like typing Control-Alt-Del at the
  3209. keyboard.
  3210.  
  3211.    Reboot
  3212.  
  3213. Name  : Recolor              (Recolor)
  3214. Class : Display
  3215. Level : Clone
  3216.  
  3217. The Recolor routine changes all text in one color to another color.  It works
  3218. only in text modes.  The colors are specified as attributes (see CalcAttr).
  3219.  
  3220.    Recolor OldAttr%, NewAttr%
  3221.  
  3222. OldAttr%   color to be changed
  3223. NewAttr%   color to which to change
  3224.  
  3225. Name  : RecolorArea          (Recolor Area)
  3226. Class : Display
  3227. Level : Clone
  3228.  
  3229. The RecolorArea routine changes a specified area of the screen to a specified
  3230. color.  It works only in text modes.  The color is specified as an attribute
  3231. (see CalcAttr).
  3232.  
  3233. One of the more common applications for this routine is marking an area of
  3234. the screen, e.g. menu highlight bars.
  3235.  
  3236.    RecolorArea TopRow%, LeftCol%, BottomRow%, RightCol%, Attr%, Page%, Fast%
  3237.  
  3238. TopRow%     top row of area to recolor
  3239. LeftCol%    left column of area to recolor
  3240. BottomRow%  bottom row of area to recolor
  3241. RightCol%   right column of area to recolor
  3242. Attr%       desired color
  3243. Page%       display page (normally zero)
  3244. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  3245.  
  3246. Name  : RedirectIn%          (Redirect Input)
  3247. Class : Miscellaneous
  3248. Level : DOS
  3249.  
  3250. The RedirectIn% function allows you to determine whether input has been
  3251. redirected.  This lets you know whether input is coming from the keyboard or
  3252. from a file or device.
  3253.  
  3254. Input that is done by BIOS key routines (e.g., BIOSInkey) is not affected by
  3255. redirection, so if you want to support redirection it is best to avoid such
  3256. routines unless there is something that must come from the keyboard.
  3257.  
  3258.    Redir% = RedirectIn%
  3259.  
  3260. -------
  3261. Redir%     whether input has been redirected (0 no)
  3262.  
  3263. Name  : RedirectOut%         (Redirect Output)
  3264. Class : Miscellaneous
  3265. Level : DOS
  3266.  
  3267. The RedirectOut% function allows you to determine whether output has been
  3268. redirected.  This lets you know whether output is going to the display or to
  3269. a file or device.
  3270.  
  3271. Output that is done by direct screen writes (e.g., XQPrint) is not affected
  3272. by redirection, so if you want to allow redirection it is best to avoid such
  3273. routines unless there is something that must to go to the screen itself.
  3274.  
  3275.    Redir% = RedirectOut%
  3276.  
  3277. -------
  3278. Redir%     whether output has been redirected (0 no)
  3279.  
  3280. Name  : Rename               (Rename file)
  3281. Class : Disk
  3282. Level : DOS
  3283.  
  3284. This routine allows you to rename an ordinary file.  See also RenSub.
  3285.  
  3286.    Rename CurrentName$, NewName$, ErrCode%
  3287.  
  3288. CurrentName$   current name of the file
  3289. NewName$       desired name of the file
  3290. -------
  3291. ErrCode%       error code: 0 if no error, else DOS Error
  3292.  
  3293. Name  : RenSub               (Rename Subdirectory)
  3294. Class : Disk
  3295. Level : DOS
  3296.  
  3297. This routine provides a service that was inexplicably left out of the DOS
  3298. command shell.  It allows you to rename a subdirectory.
  3299.  
  3300. Note that renaming a subdirectory is only possible using old-style FCB file
  3301. handling.  This means that the subdirectory which you specify must be in the
  3302. current directory (the routine doesn't really understand subdirectories per
  3303. se, but treats them like any other file).  In this implementation, no drive
  3304. specification is allowed either.  Finally, if there is an error, the error
  3305. code may be a simple "255" instead of a useful disk error number.
  3306.  
  3307.    RenSub CurrentSub$, NewSub$, ErrCode%
  3308.  
  3309. CurrentSub$   current name of the subdirectory
  3310. NewSub$       desired name of the subdirectory
  3311. -------
  3312. ErrCode%      error code: 0 if no error, else DOS Error
  3313.  
  3314. Name  : Replace              (Replace character)
  3315. Class : String
  3316. Level : Any
  3317.  
  3318. This routine replaces all occurrences of a given character in a string with
  3319. another character.
  3320.  
  3321.    Replace St$, CurCh$, NewCh$
  3322.  
  3323. St$         string to process
  3324. CurCh$      character to be replaced
  3325. NewCh$      character to replace with
  3326. -------
  3327. St$         processed string
  3328.  
  3329. Name  : ReplaceString        (Replace String)
  3330. Class : String
  3331. Level : Any
  3332.  
  3333. This routine replaces all occurrences of a given substring within a string
  3334. with another substring.  The substrings may be of any length.
  3335.  
  3336. An error code will be returned if the string to search for is null.
  3337.  
  3338.    ReplaceString St$, Old$, New$, Found%, ErrCode%
  3339.  
  3340. St$         string to process
  3341. Old$        substring to be replaced
  3342. New$        substring to replace with
  3343. -------
  3344. Found%      whether a replacement was done (0 if no)
  3345. ErrCode%    whether there was an error (0 if no)
  3346.  
  3347. Name  : Retries              (Retries)
  3348. Class : Disk
  3349. Level : DOS 3.1+
  3350.  
  3351. This routine allows you to adjust the handling of file-sharing errors.  When
  3352. such an error occurs, DOS normally retries 3 times, with a wait of 1 between
  3353. tries.  This allows temporary conditions, such as someone else using the file
  3354. you want to access, to clear up.  In many cases, though, you may want to
  3355. change this delay.  A shorter delay will improve response time, allowing your
  3356. program to handle the error more quickly.  A longer delay may be more suited
  3357. for a busy network, allowing the request to proceed after a reasonable
  3358. waiting period.
  3359.  
  3360. The delay period between each retry is unfortunately machine-dependent, i.e.,
  3361. you will need larger delays on faster machines to achieve the same effect.
  3362. This can only be considered a flaw in DOS.
  3363.  
  3364. Note that shorter waiting periods will improve response time for your
  3365. program, but may adversely affect the network.  Normally, you should use the
  3366. longest waiting period with which you feel comfortable.
  3367.  
  3368.    Retries Times%, WaitTime%
  3369.  
  3370. Times%     number of times to retry if a file-sharing violation occurs
  3371. WaitTime%  amount of time to delay between retries
  3372.  
  3373. Name  : Reverse              (Reverse)
  3374. Class : String
  3375. Level : Any
  3376.  
  3377. This little fellow reverses the order of the characters in a string.  It is
  3378. one of the vital components of RInstr, but other than that I see no real use
  3379. for it.  On the other hand, George Boole thought that Boolean logic was of
  3380. solely theoretical interest, and yet without it there would be no computers.
  3381. I leave it to you to find the earth-shattering possibilities of Reverse!
  3382.  
  3383.    Reverse St$
  3384.  
  3385. St$      string to be reversed
  3386. -------
  3387. St$      reversed string
  3388.  
  3389. Name  : ReverseD             (Reverse Double precision array)
  3390. Class : Array management
  3391. Level : Any
  3392.  
  3393. This routine reverses the elements in an array of double-precision numbers.
  3394. This will probably be most useful for an array sorted by SortD, in case you
  3395. want the numbers to go from largest to smallest.
  3396.  
  3397. The array is assumed to start at element 1.  You may specify the last element
  3398. in the array, allowing you to reverse only part of an array if you like.
  3399.  
  3400.    ReverseD Array#(), Elements%
  3401.  
  3402. Array#()    array to be reversed
  3403. Elements%   number of elements in array
  3404. -------
  3405. Array#()    reversed array
  3406.  
  3407. Name  : ReverseI             (Reverse Integer array)
  3408. Class : Array management
  3409. Level : Any
  3410.  
  3411. This routine reverses the elements in an array of integers.  This will
  3412. probably be most useful for an array sorted by SortI, or a pointer array used
  3413. in PSortD, PSortI, PSortL, PSortS, or PSortSt, in case you want the values to
  3414. go from largest to smallest.
  3415.  
  3416. The array is assumed to start at element 1.  You may specify the last element
  3417. in the array, allowing you to reverse only part of an array if you like.
  3418.  
  3419.    ReverseI Array%(), Elements%
  3420.  
  3421. Array%()    array to be reversed
  3422. Elements%   number of elements in array
  3423. -------
  3424. Array%()    reversed array
  3425.  
  3426. Name  : ReverseL             (Reverse Long integer array)
  3427. Class : Array management
  3428. Level : Any
  3429.  
  3430. This routine reverses the elements in an array of long integers.  This will
  3431. probably be most useful for an array sorted by SortL, in case you want the
  3432. values to go from largest to smallest.
  3433.  
  3434. The array is assumed to start at element 1.  You may specify the last element
  3435. in the array, allowing you to reverse only part of an array if you like.
  3436.  
  3437.    ReverseL Array&(), Elements%
  3438.  
  3439. Array&()    array to be reversed
  3440. Elements%   number of elements in array
  3441. -------
  3442. Array&()    reversed array
  3443.  
  3444. Name  : ReverseS             (Reverse Single precision array)
  3445. Class : Array management
  3446. Level : Any
  3447.  
  3448. This routine reverses the elements in an array of single-precision numbers.
  3449. This will probably be most useful for an array sorted by SortS, in case you
  3450. want the numbers to go from largest to smallest.
  3451.  
  3452. The array is assumed to start at element 1.  You may specify the last element
  3453. in the array, allowing you to reverse only part of an array if you like.
  3454.  
  3455.    ReverseS Array!(), Elements%
  3456.  
  3457. Array!()    array to be reversed
  3458. Elements%   number of elements in array
  3459. -------
  3460. Array!()    reversed array
  3461.  
  3462. Name  : ReverseSt            (Reverse String array)
  3463. Class : Array management
  3464. Level : Any
  3465.  
  3466. This routine reverses the elements in a string array.  This will probably be
  3467. most useful for an array sorted by SortSt, in case you want the strings to be
  3468. in reverse-alphabetical order.
  3469.  
  3470. The array is assumed to start at element 1.  You may specify the last element
  3471. in the array, allowing you to reverse only part of an array if you like.
  3472.  
  3473.    ReverseSt Array$(), Elements%
  3474.  
  3475. Array$()    array to be reversed
  3476. Elements%   number of elements in array
  3477. -------
  3478. Array$()    reversed array
  3479.  
  3480. Name  : RInstr               (Reverse INSTR)
  3481. Class : String
  3482. Level : Any
  3483.  
  3484. Like INSTR, this routine tells you the position of a substring within a
  3485. string.  A "reverse" search is used, however-- whereas INSTR tells you the
  3486. first match, RInstr tells you the last match.  Similarly, whereas INSTR will
  3487. tell you that a null search string matches the main string at the first
  3488. position, RInstr will match on the last position.  Of course, most of the
  3489. time you won't be searching for a null string!
  3490.  
  3491.    RInstr MainSt$, SeekSt$, Posn%
  3492.  
  3493. MainSt$    string to search
  3494. SeekSt$    string for which to search
  3495. -------
  3496. Posn%      position of substring within main string (or 0 if no match)
  3497.  
  3498. Name  : RolSt                (Rotate Left String of bits)
  3499. Class : String
  3500. Level : Any
  3501.  
  3502. This routine rotates the bits in a string left by a desired amount.  This may
  3503. be helpful for manupulating strings containing bit flags, images, et al.
  3504.  
  3505.    RolSt St$, Count%
  3506.  
  3507. St$       string to rotate left
  3508. Count%    bits by which to rotate
  3509. -------
  3510. St$       rotated string
  3511.  
  3512. Name  : RorSt                (Rotate Right String of bits)
  3513. Class : String
  3514. Level : Any
  3515.  
  3516. This routine rotates the bits in a string right by a desired amount.  This
  3517. may be helpful for manupulating strings containing bit flags, images, et al.
  3518.  
  3519.    RorSt St$, Count%
  3520.  
  3521. St$       string to rotate right
  3522. Count%    bits by which to rotate
  3523. -------
  3524. St$       rotated string
  3525.  
  3526. Name  : RRotate              (Right Rotate String)
  3527. Class : String
  3528. Level : Any
  3529.  
  3530. This routine rotates the characters in a string right once.  I'll admit that
  3531. I haven't found a use for this myself, but people are always coming up with
  3532. new uses for things... and it complements the more useful LRotate routine.
  3533.  
  3534. See also LRotate.
  3535.  
  3536.    RRotate St$
  3537.  
  3538. St$      string to be rotated right once
  3539. -------
  3540. St$      string after being rotated right once
  3541.  
  3542. Name  : RScroll              (Right Scroll)
  3543. Class : Display
  3544. Level : Clone
  3545.  
  3546. This routine scrolls any selected part of the display right.  You may scroll
  3547. as many times as you like, or scroll "zero" times to totally clear the
  3548. selected part of the display.
  3549.  
  3550.    RScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  3551.  
  3552. TopRow%      top row of the area to scroll
  3553. LeftCol%     left column of the area to scroll
  3554. BottomRow%   top row of the area to scroll
  3555. RightCol%    left column of the area to scroll
  3556. Times%       number of times (or rows) to scroll
  3557.  
  3558. Name  : ScanKey              (Scan Keyboard)
  3559. Class : Input
  3560. Level : BIOS
  3561.  
  3562. This one's like INKEY$, but a little bit more subtle.  It will tell you if
  3563. there's a key waiting (and if so, what key it is) without actually getting
  3564. the key.  The key will remain available for later retrieval.
  3565.  
  3566. Among the more common uses for this routine is to handle keys like Control-S
  3567. (pause the display) and Control-C (abort).  You can see if these keys have
  3568. been pressed without disturbing anything else the user might have typed.  DOS
  3569. uses exactly this technique for handling these keys.  Since BASIC doesn't go
  3570. through DOS I/O, though, the only way for you to support such nice features
  3571. is to write them into your program with ScanKey.
  3572.  
  3573.    ScanKey CharCode%, CharType%
  3574.  
  3575. -------
  3576. CharType%   key type: 0 none, 1 normal (ASCII), 2 extended (scan code)
  3577. CharCode%   key ASCII or scan code
  3578.  
  3579. Name  : Scroll               (Scroll)
  3580. Class : Display
  3581. Level : BIOS
  3582.  
  3583. This routine scrolls any selected part of the display up.  You may scroll as
  3584. many times as you like, or scroll "zero" times to totally clear the selected
  3585. part of the display.
  3586.  
  3587. Note that BIOS-level scrolling can cause the screen to flicker on some CGAs
  3588. due to a combination of unfortunate design factors.
  3589.  
  3590.    Scroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  3591.  
  3592. TopRow      top row of the area to scroll
  3593. LeftCol%    left column of the area to scroll
  3594. BottomRow   top row of the area to scroll
  3595. RightCol%   left column of the area to scroll
  3596. Times%      number of times (or rows) to scroll
  3597.  
  3598. Name  : ScrRest              (Screen Restore)
  3599. Class : Display
  3600. Level : Clone
  3601.  
  3602. The ScrRest routine restores a display that was saved using ScrSave or a
  3603. similar routine.  It only works in text modes.
  3604.  
  3605.    ScrRest Array%(), Page%, Fast%
  3606.  
  3607. Array%()   array holding the display information
  3608. Page%      page on which to restore the display
  3609. Fast%      whether to use fast mode (nonzero if so; may cause snow on CGAs)
  3610.  
  3611. Name  : ScrSave              (Screen Save)
  3612. Class : Display
  3613. Level : Clone
  3614.  
  3615. The ScrSave routine saves the display to an integer array.  Only text modes
  3616. are supported.  For an 80x25 display, the array must hold 4,000 bytes, so you
  3617. would use DIM Array%(1 TO 2000).
  3618.  
  3619.    ScrSave Array%(), Page%, Fast%
  3620.  
  3621. Page%      display page to get
  3622. Fast%      whether to use fast mode (nonzero if so; may cause snow on CGAs)
  3623. -------
  3624. Array%()   saved display information
  3625.  
  3626. Name  : Scrunch              (Screen Crunch)
  3627. Class : Display
  3628. Level : Any
  3629.  
  3630. This routine is designed to be used in conjunction with ScrSave and the other
  3631. routines which store an entire 80x25 text screen in an array.  It performs a
  3632. "screen crunch", compressing the original data into a new array.  The average
  3633. result is about 8x smaller than the original screen, resulting in a vast
  3634. savings in memory (4,000 bytes vs 500 or so).  The compression algorithm is
  3635. very fast and will not take any noticeable amount of time for most purposes.
  3636.  
  3637. Besides saving main memory, this is great for storing screens as disk files!
  3638. The compression will not only make the file(s) smaller, but will make disk
  3639. access much faster since there is less information to transfer.
  3640.  
  3641.    Scrunch DSeg%, DOfs%, CSeg%, COfs%, Bytes%
  3642.  
  3643. DSeg%     segment of the original screen image
  3644. DOfs%     offset of the original screen image
  3645. CSeg%     segment of the array in which to store the compressed image
  3646. COfs%     offset of the array in which to store the compressed image
  3647. -------
  3648. Bytes%    number of bytes in the compressed image
  3649.  
  3650. Name  : Sec2Time$            (Seconds to Time)
  3651. Class : Time
  3652. Level : Any
  3653.  
  3654. This routine converts the number of seconds past midnight into a time string.
  3655.  
  3656.    TimeSt$ = Sec2Time$(Seconds&)
  3657.  
  3658. Seconds&   number of seconds past midnight
  3659. -------
  3660. TimeSt$    time string (TIME$ format)
  3661.  
  3662. Name  : SetBit               (Set Bit)
  3663. Class : Numeric
  3664. Level : Any
  3665.  
  3666. This routine sets a single bit "on" in an integer.  Bits are numbered 0-15,
  3667. with 0 being the least significant bit.
  3668.  
  3669.    SetBit Number%, BitNr%
  3670.  
  3671. Number%    number for which to set bit
  3672. BitNr%     bit number (0-15) to set
  3673. -------
  3674. Number%    number with the specified bit set
  3675.  
  3676. Name  : SetCGAColor          (Set CGA Color)
  3677. Class : Display
  3678. Level : Clone
  3679.  
  3680. This routine allows you to set certain aspects of CGA colors which aren't
  3681. available otherwise.  It is very CGA-specific, however, and may not work on
  3682. EGA or VGA systems.
  3683.  
  3684. The color specified has different meanings in different CGA modes.  In the
  3685. SCREEN 1 graphics mode, it changes the background and border color.  In
  3686. SCREEN 2, however, it allows you to change the foreground color.  While you
  3687. are still stuck with a single foreground color, you can choose what that
  3688. color will be.
  3689.  
  3690.    SetCGAColor Colour%
  3691.  
  3692. Colour%    color to set (see above)
  3693.  
  3694. Name  : SetComm              (Set Comm port)
  3695. Class : Serial
  3696. Level : DOS
  3697.  
  3698. Although QuickBASIC has a fair range of communications support, it doesn't do
  3699. the capabilities of the PC full justice.  It's also impossible to change the
  3700. serial parameters "on the fly" without risking disconnection, if BASIC alone
  3701. is used.  SetComm gets around those limitations.  It should be used -after-
  3702. the appropriate comm port is OPENed by BASIC.
  3703.  
  3704. Note that the true upper limits of the comm speed are determined by your
  3705. program and by the hardware being used.  Some PC/XTs may have trouble with
  3706. 9,600 bps, for instance.  The ability to set the serial port to a high speed
  3707. doesn't guarantee that the hardware can handle it!
  3708.  
  3709.    SetComm CommPort%, Bps%, Parity%, WordLength%, StopBits%
  3710.  
  3711. CommPort%    serial port number (1-4, although BASIC only uses 1-2)
  3712. Bps%         bits per second ("baud rate"):
  3713.                 0 for   300       5 for   9,600
  3714.                 1 for   600       6 for  19,200
  3715.                 2 for 1,200       7 for  38,400
  3716.                 3 for 2,400       8 for  57,600
  3717.                 4 for 4,800       9 for 115,200
  3718. Parity%      parity:
  3719.                 0  none
  3720.                 1  odd            3  mark  (always on)
  3721.                 2  even           4  space (always off)
  3722. WordLength%  word length (5-8)
  3723. StopBits%    stop bits (1-2; if WordLength=5, "2" actually means 1 1/2)
  3724.  
  3725. Name  : SetCommAddr          (Set Comm Address)
  3726. Class : Serial
  3727. Level : Clone
  3728.  
  3729. This routine allows you to set the base port address of a serial port.
  3730.  
  3731. One use for SetCommAddr is to give QuickBASIC access to the comm port on
  3732. those unusual machines which have a COM2 but no COM1.  Use GetCommAddr to get
  3733. the address of COM2, set the COM1 address accordingly, and tell QuickBASIC to
  3734. use COM1.
  3735.  
  3736. BASIC will normally handle COM1 and COM2, but not COM3 or COM4.  Although
  3737. there is no way to use more two ports at once, you can fool BASIC into using
  3738. COM3 by swapping it with COM1, or COM4 by swapping it with COM2.
  3739.  
  3740. Don't forget to set the ports back to their original values before your
  3741. program ends!
  3742.  
  3743.    SetCommAddr PortNr%, PortAddr%
  3744.  
  3745. PortNr%     COM port number (1-4)
  3746. PortAddr%   port address
  3747.  
  3748. Name  : SetDateAT            (Set Date of AT clock)
  3749. Class : Time
  3750. Level : BIOS (AT)
  3751.  
  3752. This routine sets the date of the hardware real-time clock in AT-class
  3753. computers.  Depending on the DOS version, this date may be partially or
  3754. completely independent of the date kept by DOS in software.  DOS always reads
  3755. the date from the hardware clock when it starts up.  However, use of the DATE
  3756. command in DOS (and the DATE$ function in QuickBASIC) may relate only to the
  3757. software copy of the date, which is not always guaranteed to be the same as
  3758. the date in the hardware clock due to certain discrepancies in DOS.
  3759.  
  3760. You may express the year as either a two-digit or four-digit number.
  3761.  
  3762. The ProBas and PBClone versions of this routine do not work the same way in
  3763. regards to the year.  ProBas assumed that any two-digit year was in the
  3764. 1900s.  In contrast, PBClone assumes that years 80-99 should be converted to
  3765. 1980-1999 and that 0-79 should be converted to 2000-2079.  I consider the
  3766. PBClone method more appropriate, with the turn of the century moving closer.
  3767. The date format used does not allow dates before 1980 anyway, so nothing is
  3768. being lost by this change.
  3769.  
  3770.    SetDateAT MonthNr%, Day%, Year%
  3771.  
  3772. MonthNr%    month number (1-12)
  3773. Day%        day (1-31)
  3774. Year%       year (1980-2079; see above for two-digit year handling)
  3775.  
  3776. Name  : SetDrv               (Set default Drive)
  3777. Class : Disk
  3778. Level : DOS
  3779.  
  3780. This routine sets the default disk drive.
  3781.  
  3782. If the specified drive does not exist, the current default drive will remain
  3783. the default.
  3784.  
  3785.    SetDrv Drive$
  3786.  
  3787. Drive$    drive letter
  3788.  
  3789. Name  : SetError             (Set Error code)
  3790. Class : Miscellaneous
  3791. Level : DOS
  3792.  
  3793. The SetError routine allows you to set the "error level" to be returned by
  3794. DOS when your program ends.  This is particularly handy for returning
  3795. information to batch files.
  3796.  
  3797. Note that SetError is best used just before your program ENDs, to avoid
  3798. complications.
  3799.  
  3800.    SetError ErrorLevel%
  3801.  
  3802. ErrorLevel%   exit code to be returned by your program
  3803.  
  3804. Name  : SetFAttr             (Set File Attribute)
  3805. Class : Disk
  3806. Level : DOS
  3807.  
  3808. This routine allows you to set the attribute of a file or subdirectory.  Any
  3809. combination of the following may be set:
  3810.  
  3811.    Normal          0      (nothing special)
  3812.    Read Only       1      file can be read, but not written to
  3813.    Hidden          2      file will be "invisible"
  3814.    System          4      (for special DOS files-- leave alone)
  3815.    Archive        32      (used by some backup utilities-- leave alone)
  3816.  
  3817. To set more than one attribute, just add the numbers for the desired
  3818. attributes together.  The attributes marked "leave alone" shouldn't be used
  3819. casually, but if you're sure you know what you're doing...
  3820.  
  3821.    SetFAttr FileName$, Attr%
  3822.  
  3823. FileName$   name of the file (or subdirectory) to manipulate
  3824. Attr%       attribute(s) to set
  3825.  
  3826. Name  : SetFTD               (Set File Time and Date)
  3827. Class : Disk
  3828. Level : DOS
  3829.  
  3830. This routine lets you set the time and date of a specified file.  You may
  3831. give the year either as two digits or four digits.
  3832.  
  3833. The ProBas and PBClone versions of this routine do not work the same way in
  3834. regards to the year.  ProBas assumed that any two-digit year was in the
  3835. 1900s.  In contrast, PBClone assumes that years 80-99 should be converted to
  3836. 1980-1999 and that 0-79 should be converted to 2000-2079.  I consider the
  3837. PBClone method more appropriate, with the turn of the century moving closer.
  3838. The DOS date format does not allow dates before 1980 anyway, so nothing is
  3839. being lost by this change.
  3840.  
  3841. Note that the Second% value, if odd, will be rounded down to an even number.
  3842. This is due to the way DOS compresses the time format, rather than any
  3843. limitation in this routine.
  3844.  
  3845.    SetFTD FileName$, MonthNr%, Day%, Year%, Hour%, Minute%, Second%
  3846.  
  3847. FileName$    name of file for which to set the time and date
  3848. MonthNr%     month number (1-12)
  3849. Day%         day (1-31)
  3850. Year%        year (1980-2079; see above for two-digit year handling)
  3851. Hour%        hour (0-23)
  3852. Minute%      minute (0-59)
  3853. Second%      second (0-59; if odd, will be rounded down to an even number)
  3854. -------
  3855. MonthNr%     -1 if there was an error, else unchanged
  3856.  
  3857. Name  : SetKbd               (Set Keyboard toggles)
  3858. Class : Input
  3859. Level : Clone
  3860.  
  3861. The SetKbd routine allows you to set the state of any of the four keyboard
  3862. toggles: Insert, Caps lock, Num lock, and Scroll Lock.  You can give your
  3863. input routines a professional touch by setting this toggles instead of making
  3864. the user remember to do so.
  3865.  
  3866. It's considered proper to restore the original keyboard toggles before your
  3867. program exits, unless of course the purpose of the program is to leave the
  3868. toggles in a particular state!  The GetKbd routine can be used in conjunction
  3869. with SetKbd to do this.
  3870.  
  3871.    SetKbd Insert%, Caps%, Num%, Scrl%
  3872.  
  3873. Insert%    whether to turn on "insert" mode (0 if no)
  3874. Caps%      whether to turn on "caps lock" (0 if no)
  3875. Num%       whether to put the keypad into numeric mode (0 if no)
  3876. Scrl%      whether to turn on "scroll lock" (0 if no)
  3877.  
  3878. Name  : SetLabel             (Set disk volume Label)
  3879. Class : Disk
  3880. Level : DOS
  3881.  
  3882. This routine creates, renames or deletes a disk volume label.
  3883.  
  3884. Note that a disk volume label is essentially a file name without an
  3885. extension.  It can contain any character that can normally be in a file name,
  3886. plus spaces and periods.
  3887.  
  3888.    SetLabel Drive$, Label$, ErrCode%
  3889.  
  3890. Drive$     drive to set label on (use "" for current drive)
  3891. Label$     label to install (use "" to delete current label)
  3892. -------
  3893. ErrCode%   whether there was an error (0 no)
  3894.  
  3895. Name  : SetMatI              (Set Matrix to Integer)
  3896. Class : Numeric
  3897. Level : Any
  3898.  
  3899. This routine sets as many elements of an integer array as you like, starting
  3900. at a specified place in the array.  A good use for it is to initialize an
  3901. array (or a portion of it) to a given value.
  3902.  
  3903.    SetMatI DSeg%, DOfs%, Elements%, Value%
  3904.  
  3905. DSeg%      segment of the first array element to add, obtained by VARSEG
  3906. DOfs%      offset of the first array element to add, obtained by VARPTR
  3907. Elements%  number of array elements to which to add
  3908. Value%     value to which to set each array element
  3909.  
  3910. Name  : SetMatL              (Set Matrix to Long)
  3911. Class : Numeric
  3912. Level : Any
  3913.  
  3914. This routine sets as many elements of an long integer array as you like,
  3915. starting at a specified place in the array.  A good use for it is to
  3916. initialize an array (or a portion of it) to a given value.
  3917.  
  3918.    SetMatL DSeg%, DOfs%, Elements%, Value&
  3919.  
  3920. DSeg%      segment of the first array element to add, obtained by VARSEG
  3921. DOfs%      offset of the first array element to add, obtained by VARPTR
  3922. Elements%  number of array elements to which to add
  3923. Value&     value to which to set each array element
  3924.  
  3925. Name  : SetMouseLoc          (Set Mouse Location)
  3926. Class : Mouse
  3927. Level : BIOS
  3928.  
  3929. This routine allows you to set the current location of the mouse cursor.  It
  3930. doesn't matter if the cursor is visible or invisible.  SetMouseLoc is only
  3931. for use in text mode.
  3932.  
  3933. This routine will not work properly if there is no mouse available.  Use the
  3934. MMCheck routine if you are not sure.
  3935.  
  3936. See also MMSetLoc, which is for use in graphics modes.
  3937.  
  3938.    SetMouseLoc Row%, Column%
  3939.  
  3940. Row%       mouse cursor row
  3941. Column%    mouse cursor column
  3942.  
  3943. Name  : SetPatch             (Set Patch information)
  3944. Class : Disk
  3945. Level : DOS
  3946.  
  3947. This routine is used after FindPatch.  The FindPatch routine finds the first
  3948. DATA statement to be patched.  SetPatch places new information in that DATA
  3949. statement and moves the file pointer to the position of the next DATA
  3950. statement.  Note that there must be only one item per DATA statement; this
  3951. item must be a quoted string.  The string in the DATA statement and the patch
  3952. string must be the same length.
  3953.  
  3954. If you need this routine to be able to handle variable-length strings, don't
  3955. fret!  Make the DATA string one character longer than the maximum you need,
  3956. and use the extra character to indicate the actual string length:
  3957.    SetPatch CHR$(LEN(St$)) + St$
  3958. Then when you READ St$, decode it like so:
  3959.    St$ = MID$(St$, 2, ASC(St$))
  3960.  
  3961. Routines in this set include FindPatch, SetPatch, and PatchDone.
  3962.  
  3963.    SetPatch St$
  3964.  
  3965. St$       string to patch into the current DATA statement
  3966.  
  3967. Name  : SetPrtAddr           (Set Printer Address)
  3968. Class : Printer
  3969. Level : Clone
  3970.  
  3971. This routine allows you to set the base port address of a parallel port.
  3972.  
  3973. One use for this routine is to fool BASIC into using a different port than
  3974. LPT1 for LPRINT.  See also PRTSWAP.
  3975.  
  3976. Note that PS/2 systems only have ports 1-3 available.  They use the fourth
  3977. port data area for holding other information.  It may be a good idea to
  3978. restrict yourself to ports 1-3 for compatibility purposes, although other
  3979. computers allow ports 1-4.
  3980.  
  3981. Don't forget to set the ports back to their original values before your
  3982. program ends!
  3983.  
  3984.    SetPrtAddr PortNr%, PortAddr%
  3985.  
  3986. PortNr%     LPT port number (1-4 or 1-3 [see above])
  3987. PortAddr%   port address
  3988.  
  3989. Name  : SetSub               (Set default Subdirectory)
  3990. Class : Disk
  3991. Level : DOS
  3992.  
  3993. Just like the DOS CD (or CHDIR) command, this routine allows you to change
  3994. the current subdirectory.  Unlike the corresponding DOS command, you may not
  3995. use a period or double period as shorthand for a directory.  However, you may
  3996. specify either an absolute or relative path, as usual, and can also use
  3997. either slashes or backslashes as delimiters.
  3998.  
  3999.    SetSub SubDir$, ErrCode%
  4000.  
  4001. SubDir$    subdirectory name
  4002. -------
  4003. ErrCode%   error code: 0 if no error, else a DOS Error number
  4004.  
  4005. Name  : SetTimeAT            (Set Time of AT clock)
  4006. Class : Time
  4007. Level : BIOS (AT)
  4008.  
  4009. This routine sets the time to the hardware real-time clock in AT-class
  4010. computers.  Depending on the DOS version, this time may be partially or
  4011. completely independent of the time kept by DOS in software.  DOS always reads
  4012. the time from the hardware clock when it starts up.  However, use of the TIME
  4013. command in DOS (and the TIME$ function in QuickBASIC) may relate only to the
  4014. software copy of the time, which is not always guaranteed to be the same as
  4015. the time in the hardware clock due to certain discrepancies in DOS.
  4016.  
  4017.    SetTimeAT Hour%, Minute%, Second%
  4018.  
  4019. Hour%      hour (0-23)
  4020. Minute%    minute
  4021. Second%    second
  4022.  
  4023. Name  : SetVerify            (Set Verify state)
  4024. Class : Disk
  4025. Level : DOS
  4026.  
  4027. The SetVerify routine allows you to set the state of the DOS VERIFY flag.
  4028. When VERIFY is on, some checking is done to make sure that writing to the
  4029. disk works as requested.  The checks are not very good, however, and VERIFY
  4030. slows down disk handling, so it is usually better to have VERIFY off.
  4031.  
  4032.    SetVerify VerifyOn%
  4033.  
  4034. VerifyOn%   whether to turn VERIFY on (0 if no)
  4035.  
  4036. Name  : SetVGAPalette        (Set VGA Palette)
  4037. Class : Display
  4038. Level : BIOS
  4039.  
  4040. This routine allows you to set any number of the VGA palette values from a
  4041. TYPEd array.  The TYPE for the array should be defined like this:
  4042.  
  4043.    TYPE Palet
  4044.       IRed AS STRING * 1
  4045.       IBlue AS STRING * 1
  4046.       IGreen AS STRING * 1
  4047.    END TYPE
  4048.  
  4049. This type holds a CHR$-encoded representation of the intensity of each
  4050. component of the color.  The values range from 0-63.
  4051.  
  4052. You can change many palette settings at a time, very quickly, with this
  4053. routine.  This routine is sufficiently faster than the BASIC PALETTE
  4054. statement as to make palette animation (and some stupendous special effects)
  4055. possible.  It may cause flickering on displays with less well-designed video
  4056. BIOS chips, however.
  4057.  
  4058.    SetVGAPalette DSeg%, DOfs%, Start%, Colors%
  4059.  
  4060. DSeg%      segment of the palette array
  4061. DOfs%      offset of the palette array
  4062. Start%     color number to start with
  4063. Colors%    number of colors to set
  4064.  
  4065. Name  : SFRead               (String File Read)
  4066. Class : Disk / String
  4067. Level : DOS
  4068.  
  4069. This routine reads a string from a file that was opened by FOpen or FCreate.
  4070. The length of the string you provide determines how many characters should be
  4071. read.  If it wasn't possible to read all the characters desired, an error
  4072. code will be returned and the BytesRead% value will tell you how many
  4073. characters were actually retrieved.
  4074.  
  4075.    St$ = SPACE$(BytesToRead%)
  4076.    SFRead Handle%, St$, BytesRead%, ErrCode%
  4077.  
  4078. Handle%     handle of the file from which to read
  4079. -------
  4080. St$         data read from the file.  Init to the number of chars desired.
  4081. BytesRead%  number of bytes actually read from the file (if error)
  4082. ErrCode%    error code: 0 if no error, else DOS Error
  4083.  
  4084. Name  : SFWrite              (String File Write)
  4085. Class : Disk / String
  4086. Level : DOS
  4087.  
  4088. This routine writes a string to a file that was opened by FOpen or FCreate.
  4089. The length of the string you provide determines how many characters will be
  4090. written.  If it wasn't possible to write the entire string to the file, an
  4091. error code will be returned and the BytesWrit% value will tell you how many
  4092. characters were actually written.
  4093.  
  4094.    SFWrite Handle%, St$, BytesWrit%, ErrCode%
  4095.  
  4096. Handle%     handle of the file to which to write
  4097. St$         data to write to the file.
  4098. -------
  4099. BytesWrit%  number of bytes actually written to the file (if error)
  4100. ErrCode%    error code: 0 if no error, else DOS Error
  4101.  
  4102. Name  : ShiftL               (Shift Left)
  4103. Class : Numeric
  4104. Level : Any
  4105.  
  4106. This routine shifts the bits in an integer left by a desired amount.  The
  4107. effect of this is similar to multiplying the number by a power of two, if the
  4108. number is positive, but is much faster.
  4109.  
  4110.    ShiftL Value%, Count%
  4111.  
  4112. Value%    number to shift left
  4113. Count%    bits by which to shift
  4114. -------
  4115. Value%    shifted number
  4116.  
  4117. Name  : ShiftLL              (Shift Left Long)
  4118. Class : Numeric
  4119. Level : Any
  4120.  
  4121. This routine shifts the bits in a long integer left by a desired amount.  The
  4122. effect of this is similar to multiplying the number by a power of two, if the
  4123. number is positive, but is much faster.
  4124.  
  4125.    ShiftLL Value&, Count%
  4126.  
  4127. Value&    number to shift left
  4128. Count%    bits by which to shift
  4129. -------
  4130. Value&    shifted number
  4131.  
  4132. Name  : ShiftR               (Shift Right)
  4133. Class : Numeric
  4134. Level : Any
  4135.  
  4136. This routine shifts the bits in an integer right by a desired amount.  The
  4137. effect of this is similar to dividing the number by a power of two, if the
  4138. number is positive, but is much faster.
  4139.  
  4140.    ShiftR Value%, Count%
  4141.  
  4142. Value%    number to shift right
  4143. Count%    bits by which to shift
  4144. -------
  4145. Value%    shifted number
  4146.  
  4147. Name  : ShiftRL              (Shift Right Long)
  4148. Class : Numeric
  4149. Level : Any
  4150.  
  4151. This routine shifts the bits in a long integer right by a desired amount.
  4152. The effect of this is similar to dividing the number by a power of two, if
  4153. the number is positive, but is much faster.
  4154.  
  4155.    ShiftRL Value&, Count%
  4156.  
  4157. Value&    number to shift right
  4158. Count%    bits by which to shift
  4159. -------
  4160. Value&    shifted number
  4161.  
  4162. Name  : ShlSt                (Shift Left String of bits)
  4163. Class : String
  4164. Level : Any
  4165.  
  4166. This routine shifts the bits in a string left by a desired amount.  This may
  4167. be helpful for manupulating strings containing bit flags, images, et al.
  4168.  
  4169.    ShlSt St$, Count%
  4170.  
  4171. St$       string to shift left
  4172. Count%    bits by which to shift
  4173. -------
  4174. St$       shifted string
  4175.  
  4176. Name  : ShrSt                (Shift Right String of bits)
  4177. Class : String
  4178. Level : Any
  4179.  
  4180. This routine shifts the bits in a string right by a desired amount.  This may
  4181. be helpful for manupulating strings containing bit flags, images, et al.
  4182.  
  4183.    ShrSt St$, Count%
  4184.  
  4185. St$       string to shift right
  4186. Count%    bits by which to shift
  4187. -------
  4188. St$       shifted string
  4189.  
  4190. Name  : SInput               (String Input)
  4191. Class : Input
  4192. Level : Clone
  4193.  
  4194. This is a flexible line input routine which supports WordStar and DOS-style
  4195. editing, default entries, key screening, and any number of other options.  To
  4196. keep SInput manageable, the less volatile parameters are set with separate
  4197. routines instead of being passed directly.
  4198.  
  4199. The St$ parameter must be set to the maximum desired input length.  It may
  4200. also contain a default entry, in which case SLen% should be set to the length
  4201. of the default entry (set SLen% to zero if there is no default entry).
  4202.  
  4203. Character screening is done through selection of valid character types.  This
  4204. may be any combination of the following (add the desired types together):
  4205.  
  4206.     1    letters
  4207.     2    digits
  4208.     4    symbols
  4209.    16    graphics (ASCII 128-255)
  4210.    32    spaces
  4211.  
  4212. You can use -1 to allow any character.  You can also make use of the NOT
  4213. operator, e.g. NOT 2 allows everything but digits.
  4214.  
  4215. The ExitCode% returns the key used to terminate input.  This will normally be
  4216. 13 (return) or 27 (esc), but other results may be returned depending on how
  4217. you use the various SInputSet routines.  Note that the cursor position is not
  4218. altered when SInput exits, to avoid accidentally scrolling your screen.  You
  4219. are left with full control over the cursor.
  4220.  
  4221. The SInput routine is designed with the idea of input forms and windows in
  4222. mind.  It is not capable of handling more than one line of text at a time.
  4223. It also doesn't know how to wrap at the edge of the screen.
  4224.  
  4225. Routines in this series include:
  4226.    SInput, SInputSet, SInputSet1, SInputSet2
  4227.  
  4228. Since everyone has their own ideas about the perfect input routine, I have
  4229. recoded SInput largely in BASIC to allow registered PBClone owners to modify
  4230. it easily.  I've gotten a huge number of requests for SInput modifications in
  4231. the past; hopefully this will be the best solution!
  4232.  
  4233.    SInput St$, SLen%, Valid%, MustFill%, Attr%, ExitCode%
  4234.  
  4235. St$         init to max length of desired input (may contain default entry)
  4236. SLen%       length of default entry (0 if none)
  4237. Valid%      valid character types (see above)
  4238. MustFill%   whether the input field must be totally filled (0 no)
  4239. Attr%       color/attribute for input (see CalcAttr)
  4240. -------
  4241. St$         entered string
  4242. SLen%       length of entered string
  4243. ExitCode%   key used to exit (normally 13 for <CR> or 27 for <ESC>)
  4244.  
  4245. Name  : SInputSet            (String Input Settings)
  4246. Class : Input
  4247. Level : Clone
  4248.  
  4249. This is one of a number of routines which allow you to modify the default
  4250. operation of SInput.
  4251.  
  4252. If you allow extended keys (like Alt keys and function keys) to exit SInput,
  4253. the ExitCode% parameter will return the negative scan code of the key.
  4254.  
  4255. Routines in this series include:
  4256.    SInput, SInputSet, SInputSet1, SInputSet2
  4257.  
  4258.    SInputSet FillCh$, ExtExit%, BadBeep%, FullBeep%, Fast%
  4259.  
  4260. FillCh$     character used to show field length (default "_")
  4261. ExtExit%    whether extended keys can be used to exit SInput (default 0, no)
  4262. BadBeep%    whether to beep on invalid keys (default 0, no)
  4263. FullBeep%   whether to beep when input field is full (default 0, no)
  4264. Fast%       whether to use fast displays that may make CGAs flicker (def 0, no)
  4265.  
  4266. Name  : SInputSet1           (String Input Settings)
  4267. Class : Input
  4268. Level : Clone
  4269.  
  4270. This is one of a number of routines which allow you to modify the default
  4271. operation of SInput.
  4272.  
  4273. If you give SInput a default entry, it will normally place the cursor at the
  4274. end of that entry when input begins.  The CurPosn% option here allows you to
  4275. place the cursor where you want it (1 - LEN(St$), or 0 for end of entry).
  4276.  
  4277. Routines in this series include:
  4278.    SInput, SInputSet, SInputSet1, SInputSet2
  4279.  
  4280.    SInputSet1 CurPosn%, FullExit%
  4281.  
  4282. CurPosn%    starting cursor position within the input field (default 0)
  4283. FullExit%   whether to exit automatically when input is full (default 0, no)
  4284.  
  4285. Name  : SInputSet2           (String Input Settings)
  4286. Class : Input
  4287. Level : Clone
  4288.  
  4289. This is one of a number of routines which allow you to modify the default
  4290. operation of SInput.
  4291.  
  4292. If you allow tabs to exit SInput, the ExitCode% may return an additional
  4293. value: 9 (tab).  A "back tab", by the way, can be retrieved if you use
  4294. SInputSet to allow extended keys to exit (back tab would return -15).
  4295.  
  4296. Routines in this series include:
  4297.    SInput, SInputSet, SInputSet1, SInputSet2
  4298.  
  4299.    SInputSet2 Capitalize%, TabExit%
  4300.  
  4301. Capitalize%   whether to capitalize letters (default 0, no)
  4302. TabExit%      whether the tab key can be used to exit (default 0, no)
  4303.  
  4304. Name  : SortD                (Sort Double precision)
  4305. Class : Array management
  4306. Level : Any
  4307.  
  4308. This routine sorts the elements in an array of double-precision numbers.
  4309.  
  4310. The array is assumed to start at element 1.  You may specify the last element
  4311. in the array, allowing you to sort only part of an array if you like.
  4312.  
  4313. If you would like the results to be largest-to-smallest, rather than
  4314. smallest-to-largest, just call ReverseD after this routine.
  4315.  
  4316.    SortD Array#(), Elements%
  4317.  
  4318. Array#()    array to be sorted
  4319. Elements%   number of elements in array
  4320. -------
  4321. Array#()    sorted array
  4322.  
  4323. Name  : SortI                (Sort Integer)
  4324. Class : Array management
  4325. Level : Any
  4326.  
  4327. This routine sorts the elements in an array of integers.
  4328.  
  4329. The array is assumed to start at element 1.  You may specify the last element
  4330. in the array, allowing you to sort only part of an array if you like.
  4331.  
  4332. If you would like the results to be largest-to-smallest, rather than
  4333. smallest-to-largest, just call ReverseI after this routine.
  4334.  
  4335.    SortI Array%(), Elements%
  4336.  
  4337. Array%()    array to be sorted
  4338. Elements%   number of elements in array
  4339. -------
  4340. Array%()    sorted array
  4341.  
  4342. Name  : SortL                (Sort Long integer)
  4343. Class : Array management
  4344. Level : Any
  4345.  
  4346. This routine sorts the elements in an array of long integers.
  4347.  
  4348. The array is assumed to start at element 1.  You may specify the last element
  4349. in the array, allowing you to sort only part of an array if you like.
  4350.  
  4351. If you would like the results to be largest-to-smallest, rather than
  4352. smallest-to-largest, just call ReverseL after this routine.
  4353.  
  4354.    SortL Array&(), Elements%
  4355.  
  4356. Array&()    array to be sorted
  4357. Elements%   number of elements in array
  4358. -------
  4359. Array&()    sorted array
  4360.  
  4361. Name  : SortS                (Sort Single precision)
  4362. Class : Array management
  4363. Level : Any
  4364.  
  4365. This routine sorts the elements in an array of single-precision numbers.
  4366.  
  4367. The array is assumed to start at element 1.  You may specify the last element
  4368. in the array, allowing you to sort only part of an array if you like.
  4369.  
  4370. If you would like the results to be largest-to-smallest, rather than
  4371. smallest-to-largest, just call ReverseS after this routine.
  4372.  
  4373.    SortS Array!(), Elements%
  4374.  
  4375. Array!()    array to be sorted
  4376. Elements%   number of elements in array
  4377. -------
  4378. Array!()    sorted array
  4379.  
  4380. Name  : SortSt               (Sort String)
  4381. Class : Array management
  4382. Level : Any
  4383.  
  4384. This routine sorts the elements in a string array.
  4385.  
  4386. The array is assumed to start at element 1.  You may specify the last element
  4387. in the array, allowing you to sort only part of an array if you like.  You
  4388. can also specify whether the capitalization of letters in a string should
  4389. matter for sorting purposes.
  4390.  
  4391. If you would like the results to be last-to-first, rather than first-to-last,
  4392. just call ReverseSt after this routine.
  4393.  
  4394.    SortSt Array$(), CapsCount%, Elements%
  4395.  
  4396. Array$()    array to be sorted
  4397. CapsCount%  use 0 if uppercase/lowercase distinctions don't matter
  4398. Elements%   number of elements in array
  4399. -------
  4400. Array$()    sorted array
  4401.  
  4402. Name  : Soundex              (Soundex code)
  4403. Class : String
  4404. Level : Any
  4405.  
  4406. This is a string comparison routine which returns a code that is loosely
  4407. based on the "sound" of a word.  It removes the vowels and repeated
  4408. characters from a word, then converts it into a numeric code.  Any words with
  4409. the same code are considered to sound alike.
  4410.  
  4411. While not perfect, this algorithm does a fast and reasonably good job.  It
  4412. can be helpful in applications like spelling checkers and phone books, where
  4413. a search based on exact text may not be appropriate.
  4414.  
  4415.    Code$ = St$
  4416.    Soundex St$, Code$, CodeLen%
  4417.    Code$ = LEFT$(St$, CodeLen%)
  4418.  
  4419. St$       string to be encoded
  4420. -------
  4421. Code$     result code.  Init to at least the length of the original string.
  4422. CodeLen%  length of the result code
  4423.  
  4424. Name  : SpeedKey             (Speed up Keyboard)
  4425. Class : Input
  4426. Level : BIOS (AT)
  4427.  
  4428. This routine provides control over the keyboard repeat rate for AT-class
  4429. machines.  Increasing the repeat rate can make the computer seem a lot more
  4430. responsive and pleasant to deal with.
  4431.  
  4432.   RepDelay%   Delay Time
  4433.      0        250 milliseconds
  4434.      1        500 ms
  4435.      2        750 ms
  4436.      3        1 second
  4437.  
  4438.   RepRate% is the key repeat rate, 0-31 (from around 30 cps to around 2 cps)
  4439.  
  4440.    SpeedKey RepDelay%, RepRate%
  4441.  
  4442. RepDelay%   delay before starting to repeat a key (0-3, default 1)
  4443. RepRate%    rate at which to repeat key (0-31, default 11)
  4444.  
  4445. Name  : Split                (Split screen image)
  4446. Class : Display
  4447. Level : Clone
  4448.  
  4449. This provides an elegant way to clear a text-mode screen.  It splits the
  4450. display into four parts, scrolling each part up or down until it slides off
  4451. the screen.
  4452.  
  4453.    Split
  4454.  
  4455. Name  : Spooler              (check for print Spooler)
  4456. Class : Printer
  4457. Level : DOS
  4458.  
  4459. The Spooler routine allows you to see whether the print spooler (installed by
  4460. the DOS PRINT utility) is available.
  4461.  
  4462.    Spooler Status%
  4463.  
  4464. -------
  4465. Status%   spooler status:
  4466.              -1   it's installed
  4467.               0   it isn't installed, but can be
  4468.               1   it isn't installed, and can't be
  4469.  
  4470. Name  : SSrch                (String Search)
  4471. Class : String
  4472. Level : Any
  4473.  
  4474. This is a string search routine which tells you whether one string can be
  4475. found inside another.  Uppercase/lowercase distinctions are ignored.  Leading
  4476. and trailing spaces in the string for which to search are also ignored.
  4477.  
  4478. Note that the positions of the main string and search string parameters are
  4479. in the reverse of the order you might expect.
  4480.  
  4481.    SSrch Search$, MainSt$, Found%
  4482.  
  4483. Search$   string for which to search
  4484. MainSt$   string to be searched
  4485. -------
  4486. Found%    whether a match was found (0 if no)
  4487.  
  4488. Name  : StrDel               (String Delete)
  4489. Class : String
  4490. Level : Any
  4491.  
  4492. StrDel deletes a character from a string.  Actually, it doesn't make the
  4493. string any shorter, but it acts like a delete.  The end of the string is
  4494. filled with a space.
  4495.  
  4496.    StrDel St$, Posn%
  4497.  
  4498. St$       string from which to delete a character
  4499. Posn%     position of the character to delete (1-LEN(St$))
  4500. -------
  4501. St$       processed string
  4502.  
  4503. Name  : StrIns               (String Insert)
  4504. Class : String
  4505. Level : Any
  4506.  
  4507. StrIns inserts a space into a string.  Actually, it doesn't make the string
  4508. any longer, but it acts like an insert.  The former end of the string is
  4509. discarded.
  4510.  
  4511.    StrIns St$, Posn%
  4512.  
  4513. St$       string in which to insert a space
  4514. Posn%     where to insert the space (1-LEN(St$))
  4515. -------
  4516. St$       processed string
  4517.  
  4518. Name  : Strip                (Strip spaces)
  4519. Class : String
  4520. Level : Any
  4521.  
  4522. This routine strips both leading and trailing white space from a string.
  4523. This includes control characters as well as blanks (anything below CHR$(33)).
  4524.  
  4525.    Strip St$
  4526.  
  4527. St$      string to process
  4528. -------
  4529. St$      processed string
  4530.  
  4531. Name  : StripBlanks          (Strip Blanks)
  4532. Class : String
  4533. Level : Any
  4534.  
  4535. This routine strips leading and/or trailing white space from a string.  This
  4536. includes control characters as well as blanks (anything below CHR$(33)).
  4537.  
  4538. See also StripSpaces.
  4539.  
  4540.    StripBlanks St$, Which%, StLen%
  4541.    St$ = LEFT$(St$, StLen%)
  4542.  
  4543. St$      string to process
  4544. Which%   1: strip left, 2: strip right, 3: strip left and right
  4545. -------
  4546. St$      processed string
  4547. StLen    length of processed string
  4548.  
  4549. Name  : StripChar            (Strip Characters)
  4550. Class : String
  4551. Level : Any
  4552.  
  4553. This routine strips all occurrences of a given list of characters out of a
  4554. string.  Among the uses for this are cleaning up user-entered values.  For
  4555. instance, a strip list of "$," would remove commas and dollar signs from a
  4556. number, and "()- " will remove telephone delimiters.
  4557.  
  4558.    StripChar St$, StripList$, StLen%
  4559.    St$ = LEFT$(St$, StLen%)
  4560.  
  4561. St$         string to process
  4562. StripList$  characters to remove from the string
  4563. -------
  4564. St$         processed string
  4565. StLen%      length of processed string
  4566.  
  4567. Name  : StripRange           (Strip Range of characters)
  4568. Class : String
  4569. Level : Any
  4570.  
  4571. This routine strips an inclusive range of characters out of a string.  The
  4572. range is specified as the first and last ASCII codes to strip.  For instance,
  4573. using a low character of "0" and a high of "9" would remove all digits from a
  4574. string.
  4575.  
  4576.    StripRange St$, ASC(LowChar$), ASC(HighChar$), StLen%
  4577.    St$ = LEFT$(St$, StLen%)
  4578.  
  4579. St$         string to process
  4580. LowChar$    lowest character to strip
  4581. HighChar$   highest character to strip
  4582. -------
  4583. St$         processed string
  4584. StLen%      length of processed string
  4585.  
  4586. Name  : StripSpaces          (Strip Spaces)
  4587. Class : String
  4588. Level : Any
  4589.  
  4590. This routine strips leading and/or trailing spaces from a string.
  4591.  
  4592. See also StripBlanks.
  4593.  
  4594.    StripSpaces St$, Which%, StLen%
  4595.    St$ = LEFT$(St$, StLen%)
  4596.  
  4597. St$      string to process
  4598. Which%   1: strip left, 2: strip right, 3: strip left and right
  4599. -------
  4600. St$      processed string
  4601. StLen%   length of processed string
  4602.  
  4603. Name  : Strip2$              (Strip Spaces)
  4604. Class : String
  4605. Level : Any
  4606.  
  4607. This routine strips both leading and trailing white space from a string.  It
  4608. works just like Strip, but is a function rather than a subprogram.  White
  4609. space includes control characters as well as blanks (anything below CHR$(33)).
  4610.  
  4611.    Result$ = Strip2$(St$)
  4612.  
  4613. St$       string to process
  4614. -------
  4615. Result$   processed string
  4616.  
  4617. Name  : StrSqu2              (String Squish, 2-gram)
  4618. Class : String
  4619. Level : Any
  4620.  
  4621. This is a text compression routine which uses a 2-gram algorithm to compress
  4622. common pairs of characters out of a string.  You can reasonably expect to
  4623. reduce the text size by about a third with this routine.  Compression is
  4624. quite fast.  The one limitation is that only plain text may be compressed;
  4625. the text may not contain CHR$(128) through CHR$(255), as these codes are used
  4626. by the compression algorithm.
  4627.  
  4628. You must use StrSquLen2 before this routine to determine the proper length to
  4629. which to initialize the result string.
  4630.  
  4631. The compressed text can be restored to original form with StrUnsqu2.
  4632.  
  4633.    StrSquLen2 St$, ResultLen%
  4634.    Result$ = SPACE$(ResultLen%)
  4635.    StrSqu2 St$, Result$
  4636.  
  4637. St$       string to compress
  4638. -------
  4639. Result$   compressed string
  4640.  
  4641. Name  : StrSquLen2           (String Squished Length, 2-gram)
  4642. Class : String
  4643. Level : Any
  4644.  
  4645. This routine is used in conjunction with the StrSqu2 text compressor. It
  4646. tells you what size the resulting text will be.  See StrSqu2 for further
  4647. information.
  4648.  
  4649.    StrSquLen2 St$, ResultLen%
  4650.    Result$ = SPACE$(ResultLen%)
  4651.    StrSqu2 St$, Result$
  4652.  
  4653. St$          string to compress
  4654. -------
  4655. ResultLen%   length of the compressed string
  4656.  
  4657. Name  : StrUnsqu2            (String Unsquish, 2-gram)
  4658. Class : String
  4659. Level : Any
  4660.  
  4661. This routine decompresses text which was compressed by StrSqu2.  Text is
  4662. decompressed at lightning speed, as this routine has no overhead to speak of.
  4663.  
  4664. You must use StrUnsquLen2 before this routine to determine the proper length
  4665. to which to initialize the result string.
  4666.  
  4667.    StrUnsquLen2 St$, ResultLen%
  4668.    Result$ = SPACE$(ResultLen%)
  4669.    StrUnsqu2 St$, Result$
  4670.  
  4671. St$       string to decompress
  4672. -------
  4673. Result$   decompressed string
  4674.  
  4675. Name  : StrUnsquLen2         (String Unsquished Length, 2-gram)
  4676. Class : String
  4677. Level : Any
  4678.  
  4679. This routine is used in conjunction with the StrUnsqu2 text decompressor. It
  4680. tells you what size the resulting text will be.  See StrUnsqu2 for further
  4681. information.
  4682.  
  4683.    StrUnsquLen2 St$, ResultLen%
  4684.    Result$ = SPACE$(ResultLen%)
  4685.    StrUnsqu2 St$, Result$
  4686.  
  4687. St$          string to decompress
  4688. -------
  4689. ResultLen%   length of the decompressed string
  4690.  
  4691. Name  : SubExist             (Subdirectory Existence)
  4692. Class : Disk
  4693. Level : DOS
  4694.  
  4695. This routine lets you see if a given subdirectory actually exists.  This
  4696. isn't really necessary for the PBClone file routines, which will return an
  4697. appropriate error code, but it's a valuable safeguard when using the BASIC
  4698. OPEN statement.
  4699.  
  4700. See also SubExist2, the FUNCTION version of this routine.
  4701.  
  4702.    SubExist SubDir$, Found%
  4703.  
  4704. SubDir$   name of the subdirectory to look for
  4705. -------
  4706. Found%    whether the subdirectory was found (0 if no)
  4707.  
  4708. Name  : SubExist2%           (Subdirectory Existence)
  4709. Class : Disk
  4710. Level : DOS
  4711.  
  4712. This routine lets you see if a given subdirectory actually exists.  This
  4713. isn't really necessary for the PBClone file routines, which will return an
  4714. appropriate error code, but it's a valuable safeguard when using the BASIC
  4715. OPEN statement.
  4716.  
  4717. See also SubExist, the SUB version of this routine.
  4718.  
  4719.    Found% = SubExist2%(SubDir$)
  4720.  
  4721. SubDir$   name of the subdirectory to look for
  4722. -------
  4723. Found%    whether the subdirectory was found (0 if no)
  4724.  
  4725. Name  : Time2Int             (Time to Integer)
  4726. Class : Time
  4727. Level : Any
  4728.  
  4729. This routine compresses a time into a single integer.  Note that this integer
  4730. is not in a format that lends itself to simple computation-- you cannot
  4731. subtract one from another to find out the length of time between them.  If
  4732. that's what you want, try the Elapsed routine.
  4733.  
  4734. Note that odd numbers of seconds will be rounded down to the previous even
  4735. number.  This is a result of the storage format used.
  4736.  
  4737.    Time2Int Hour%, Minute%, Second%, IntTime%
  4738.  
  4739. Hour%      hour (0-23)
  4740. Minute%    minute
  4741. Second%    second
  4742. -------
  4743. IntTime%   time compressed into an integer
  4744.  
  4745. Name  : Time2Sec&            (Time to Seconds)
  4746. Class : Time
  4747. Level : Any
  4748.  
  4749. This routine converts a time string into the number of seconds past midnight.
  4750. This is convenient if you want to find the difference between two times or to
  4751. calculate what time it will be after a given interval.
  4752.  
  4753.    Seconds& = Time2Sec&(TimeSt$)
  4754.  
  4755. TimeSt$    time string (TIME$ format)
  4756. -------
  4757. Seconds&   number of seconds past midnight
  4758.  
  4759. Name  : TimeN2S              (Time Numbers to String)
  4760. Class : Time
  4761. Level : Any / DOS
  4762.  
  4763. Many of the PBClone routines return the time as a set of numbers.  This
  4764. routine provides an easy way to convert those numbers into string form.  The
  4765. time format used (whether seconds are included) will be based on the length
  4766. of the string which you pass to the routine.  For instance, a string like
  4767. "xx:xx" would return a time like "21:35", whereas "xx:xx:xx" would return
  4768. "21:35:08".
  4769.  
  4770. You can get the current time in the desired format by passing zeroes for
  4771. Hour%, Minute% and Second%.
  4772.  
  4773.    TimeSt$ = "xx:xx:xx"
  4774.    TimeN2S Hour%, Minute%, Second%, TimeSt$
  4775.  
  4776. Hour%     hour (0-23)
  4777. Minute%   minute
  4778. Second%   second
  4779. -------
  4780. TimeSt$   time string.  Init to 5 or 8 characters (see above).
  4781.  
  4782. Name  : TimeS2N              (Time String to Numbers)
  4783. Class : Time
  4784. Level : Any
  4785.  
  4786. Many of the PBClone routines need to be passed the time as a set of numbers.
  4787. This routine provides an easy way to convert a time from string form into
  4788. numbers.  You may use either "xx:xx:xx" or "xx:xx" form to specify the time
  4789. (the string length is important, but the delimiter and contents of the string
  4790. are ignored).  If the 5-character short form is used, the Second% value will
  4791. be zero.
  4792.  
  4793.    TimeS2N Hour%, Minute%, Second%, TimeSt$
  4794.  
  4795. TimeSt$   time string.  Init to 5 or 8 characters (see above).
  4796. -------
  4797. Hour%     hour (0-23)
  4798. Minute%   minute
  4799. Second%   second (0 if 5-char format)
  4800.  
  4801. Name  : TInstr               (Typed INSTR)
  4802. Class : String
  4803. Level : Any
  4804.  
  4805. As you might guess from the "Instr" part of the name, this routine searches a
  4806. string.  Instead of searching for a specific character or substring, though,
  4807. it looks for a specific type of character-- letters, numbers, control codes,
  4808. or whatever.  You can search for the first of a combination of types, too,
  4809. which also allows searching for "anything but" a specific type.
  4810.  
  4811. The character type code is specified by adding any of the following:
  4812.  
  4813.     1    alphabetic
  4814.     2    numeric
  4815.     4    symbolic
  4816.     8    control
  4817.    16    graphics
  4818.    32    space
  4819.  
  4820. The TInstr routine is handy for parsing and cleaning up user input, among
  4821. other uses.
  4822.  
  4823.    TInstr St$, ChrType%, Place%
  4824.  
  4825. St$          string to search
  4826. ChrType%     type of character(s) to search for
  4827. -------
  4828. Place%       where the first char of the desired type was found (or 0)
  4829.  
  4830. Name  : TypeIn               (Type In)
  4831. Class : Input
  4832. Level : Clone
  4833.  
  4834. This is an unusual routine which combines both output and input.  It sends a
  4835. string to the keyboard buffer, where it acts as if it had been typed in by
  4836. someone.  The string may be up to 15 key codes in length (anything past 15
  4837. keys will be ignored, due to the limited length of the keyboard buffer).
  4838.  
  4839. Normal keys can be put into the string simply as characters.  Extended keys,
  4840. like Alt-key combinations, arrow keys, and function keys, must be encoded as
  4841. CHR$(0) + CHR$(ScanCode), where the ScanCode is the key's scan code.  You can
  4842. look up such scan codes in your BASIC manual or use GetKey to find out what
  4843. they are.  Extended keys, although apparently taking up two characters, only
  4844. take up one space in the keyboard buffer.  The TypeIn routine allows for this
  4845. fact.
  4846.  
  4847. Among other things, this routine can be used to provide default answers to
  4848. input routines, or to execute another program once your program exits.
  4849.  
  4850.    TypeIn St$
  4851.  
  4852. St$     keys to be "typed" into the keyboard buffer
  4853.  
  4854. Name  : TypePrint            (Type Print)
  4855. Class : Display
  4856. Level : Clone
  4857.  
  4858. TypePrint displays a string as if it was being typed.  The string is
  4859. displayed a character at a time, with a delay between each character.  You
  4860. may choose one color to highlight the just-displayed character and another
  4861. color for the character to turn after the delay is done.
  4862.  
  4863.    TypePrint St$, Row%, Column%, WaitTime%, TmpAttr%, Attr%, Fast%
  4864.  
  4865. St$        string to display
  4866. Row%       row at which to display string
  4867. Column%    column at which to display string
  4868. WaitTime%  delay between characters (milliseconds; 20-60 is reasonable)
  4869. TmpAttr%   color/attribute for just-displayed character
  4870. Attr%      color/attribute for character after the delay is up
  4871. Fast%      whether to use fast displays (may cause snow on CGAs) (0 no)
  4872.  
  4873. Name  : UnCalcAttr           (Undo Calculated Attribute)
  4874. Class : Display
  4875. Level : Any
  4876.  
  4877. Many of the display routines in this library require an "attribute" rather
  4878. than foreground and background colors.  An attribute is a combination of the
  4879. foreground and background colors in a format which is used by all types of
  4880. displays when in text mode.  The UnCalcAttr routine allows you to decode the
  4881. original colors given the attribute.
  4882.  
  4883. Foreground colors are usually specified as 0-31, with backgrounds as 0-7.  If
  4884. you turn blinking off (see Blink), it may be more convenient to express the
  4885. same thing as foreground 0-15, background 0-15.  The CalcAttr routine will
  4886. accept either way of expressing it.
  4887.  
  4888. Note, however, that UnCalcAttr will always return the former pair of results,
  4889. since it has no way of knowing whether Blink has been used (foreground 0-31,
  4890. background 0-15).  The below routine shows how to get around this, if needed.
  4891.  
  4892.    UnCalcAttr Foreground%, Background%, Attr%
  4893.    ' the following is optional and may not be desired...
  4894.    ' it converts colors to "no blink" equivalents (see above)
  4895.    IF Foreground% AND 16 THEN
  4896.       Foreground% = Foreground% - 16
  4897.       Background% = Background% + 8
  4898.    END IF
  4899.  
  4900. Attr%         color "attribute"
  4901. -------
  4902. Foreground%   foreground color
  4903. Background%   background color
  4904.  
  4905. Name  : UnScrunch            (Undo Screen Crunch)
  4906. Class : Display
  4907. Level : Any
  4908.  
  4909. This routine is designed to be used in conjunction with ScrRest and the other
  4910. routines which restore an entire 80x25 text screen from an array.  It expands
  4911. screens that were compressed by Scrunch to their full original size. The
  4912. uncompression algorithm is very fast and will not take any noticeable amount
  4913. of time for most purposes.
  4914.  
  4915.    REDIM FullScreen%(1 TO 2000)
  4916.    DSeg% = VARSEG(FullScreen%(1))
  4917.    DOfs% = VARPTR(FullScreen%(1))
  4918.    UnScrunch DSeg%, DOfs%, CSeg%, COfs%
  4919.  
  4920. DSeg%     segment of the array in which to store the expanded image
  4921. DOfs%     offset of the array in which to store the expanded image
  4922. CSeg%     segment of the compressed image
  4923. COfs%     offset of the compressed image
  4924.  
  4925. Name  : UnSplit              (Undo Split)
  4926. Class : Display
  4927. Level : Clone
  4928.  
  4929. This routine does the opposite of Split-- instead of clearing the screen by
  4930. scrolling it in different directions, it puts text on the screen by scrolling
  4931. it on from different locations.  The effect is quite stunning.
  4932.  
  4933. The information to place on the screen comes from an array that you specify
  4934. which contains a saved screen.  Only 80x25 text modes are supported.  Any of
  4935. the screen save routines (e.g., ScrSave) may be used to load the array.  In a
  4936. typical case, you will use this routine with screens that were created in
  4937. advance and stored to disk for use by your program.
  4938.  
  4939.    UnSplit Scrn%(), Fast%
  4940.  
  4941. Scrn%()   array containing the text to display
  4942. Fast%     whether to use fast mode (0 if no, to avoid snow on CGAs)
  4943.  
  4944. Name  : Upcase               (Uppercase)
  4945. Class : String
  4946. Level : Any
  4947.  
  4948. This routine, like BASIC's UCASE$ function, converts a string to uppercase.
  4949. Since it doesn't have to create a new return string (a fairly slow process),
  4950. it's faster than the BASIC equivalent.
  4951.  
  4952. See also Upcase1.
  4953.  
  4954.    Upcase St$
  4955.  
  4956. St$     string to be capitalized
  4957. -------
  4958. St$     capitalized string
  4959.  
  4960. Name  : Upcase1              (Uppercase)
  4961. Class : String
  4962. Level : Any
  4963.  
  4964. This routine, like BASIC's UCASE$ function, converts a string to uppercase.
  4965. It converts letters in the extended character set as well as the usual
  4966. letters, making it well suited for text which may not be in English.
  4967.  
  4968. See also Upcase.
  4969.  
  4970.    Upcase1 St$
  4971.  
  4972. St$     string to be capitalized
  4973. -------
  4974. St$     capitalized string
  4975.  
  4976. Name  : UpdTVScreen          (Update TopView Screen)
  4977. Class : Display
  4978. Level : BIOS
  4979.  
  4980. UpdTVScreen tells a TopView-compatible multitasker to update the screen using
  4981. a specified screen buffer (use GetTVScreen to get the buffer location).  Some
  4982. multitaskers will do this automatically, but some won't.  It's safe to use
  4983. this routine either way.
  4984.  
  4985. See also GetDView, GetTView, GetTVScreen.
  4986.  
  4987.    UpdTVScreen DSeg%, DOfs%
  4988.  
  4989. DSeg%       segment of screen buffer
  4990. DOfs%       offset of screen buffer
  4991.  
  4992. Name  : VGARest13            (VGA Restore for SCREEN 13)
  4993. Class : Display
  4994. Level : Clone
  4995.  
  4996. This routine allows you to restore a SCREEN 13 (VGA, 320x200, 256 color)
  4997. display that was saved using VGASave13 (see).
  4998.  
  4999.    VGARest13 DSeg%, DOfs%
  5000.  
  5001. DSeg%        segment of storage array, returned by VARSEG
  5002. DOfs%        offset  of storage array, returned by VARPTR
  5003.  
  5004. Name  : VGASave13            (VGA Save of SCREEN 13)
  5005. Class : Display
  5006. Level : Clone
  5007.  
  5008. This routine allows you to save a SCREEN 13 (VGA, 320x200, 256 color) display
  5009. that can be restored using VGARest13 (see).
  5010.  
  5011. The array used to hold the screen must contain 64,000 bytes.  For an integer
  5012. array, this means that you must create the array by DIM Array%(1 TO 32000).
  5013.  
  5014.    VGASave13 DSeg%, DOfs%
  5015.  
  5016. DSeg%        segment of storage array, returned by VARSEG
  5017. DOfs%        offset  of storage array, returned by VARPTR
  5018.  
  5019. Name  : WeekDay              (Week Day)
  5020. Class : Time
  5021. Level : DOS
  5022.  
  5023. This routine tells you what the day of the week is, just the thing for
  5024. calendar programs and whatnot.  The day is returned as a number from 1-7,
  5025. which identifies a day from Sunday through Saturday.
  5026.  
  5027.    WeekDay Day%
  5028.  
  5029. -------
  5030. Day%     current day
  5031.  
  5032. Name  : WeekDay1             (Week Day)
  5033. Class : Time
  5034. Level : Any
  5035.  
  5036. This routine tells you the day of the week for any given date.
  5037.  
  5038.    WeekDay1 MonthNr%, DayNr%, YearNr%, DayName$
  5039.  
  5040. MonthNr%     month number (1-12)
  5041. DayNr%       day number (1-31)
  5042. YearNr%      year number (1900 on)
  5043. -------
  5044. DayName$     day of the week
  5045.  
  5046. Name  : WinCheck             (Windows Check)
  5047. Class : Equipment
  5048. Level : BIOS
  5049.  
  5050. The WinCheck routine tells you what version of Microsoft Windows is in use,
  5051. if any.  It returns the results as two integers containing the major and
  5052. minor version numbers.  For instance, Windows 3.0 would return a major number
  5053. of 3, minor 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  5054. not running, 0.0 will be returned.  NOTE that this routine is not able to
  5055. detect Windows 1.x versions!
  5056.  
  5057.    WinCheck MajorV%, MinorV%
  5058.  
  5059. -------
  5060. MajorV%   major part of the Windows version
  5061. MinorV%   minor part of the Windows version
  5062.  
  5063. Name  : WindowManager        (Window Manager)
  5064. Class : Display
  5065. Level : Clone
  5066.  
  5067. WindowManager displays a pop-up window according to your specifications.  The
  5068. window may have any of a variety of frames, a title, or a shadow, and it may
  5069. appear instantly or "grow" onto the screen.  Only text mode is supported.
  5070.  
  5071. These are the available frame types:
  5072.     0   no frame
  5073.     1   single lines
  5074.     2   double lines
  5075.     3   single horizontal, double vertical lines
  5076.     4   double horizontal, single vertical lines
  5077.     5   block graphic lines
  5078.  
  5079. These are the available shadows:
  5080.    -3   transparent shadow on the right
  5081.    -2   transparent shadow on the left
  5082.    -1   solid black shadow on the left
  5083.     0   no shadow
  5084.    1+   shadow attribute (use CalcAttr) for a colored shadow
  5085.  
  5086. Options for growing windows are as follows:
  5087.    -1   grow as fast as possible
  5088.     0   pop onto the screen
  5089.    1+   grow with a specified delay in milliseconds (15 works well for me)
  5090.  
  5091. Note that this routine is different from its ProBas equivalent in a number of
  5092. respects.  The grow delay time is different.  Growing is done more smoothly.
  5093. The shadow and title parameters are not changed by this routine.  A new frame
  5094. type (5) was added.  If a title is too long, it is truncated instead of being
  5095. ignored completely.  Using a -1 as the title foreground color will not turn
  5096. off the title; instead, use a null title string.
  5097.  
  5098.    WindowManager TopRow%, LeftCol%, BottomRow%, RightCol%, Frame%,
  5099.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  5100.  
  5101. TopRow%     top row of window
  5102. LeftCol%    left column of window
  5103. BottomRow%  bottom row of window
  5104. RightCol%   right column of window
  5105. Frame%      frame type (see above)
  5106. Fore%       frame foreground color
  5107. Back%       frame background color
  5108. Grow%       window growing option (see above)
  5109. Shade%      window shadow option (see above)
  5110. TFore%      title foreground color
  5111. Title$      window title ("" if none)
  5112. Page%       display page (normally zero)
  5113. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  5114.  
  5115. Name  : WindowMan2           (Window Manager)
  5116. Class : Display
  5117. Level : Clone
  5118.  
  5119. This routine is identical to WindowManager but for the fact that it allows
  5120. you to design your own custom window frames.  Please see the description of
  5121. WindowManager for general information.
  5122.  
  5123. These are the additional frame types:
  5124.     6   custom frame composed of a single character
  5125.     7   custom frame composed of the specified 7-character list:
  5126.         top left corner, top middle, top right corner,
  5127.         left middle, right middle,
  5128.         bottom left corner, bottom middle, bottom right corner
  5129.  
  5130.  /------------------------------------------------------------\
  5131.  | A custom frame like this would be defined as frame type 7, |
  5132.  | with a frame string of "/-\||\-/", for instance.           |
  5133.  \------------------------------------------------------------/
  5134.  
  5135.  *************************************************
  5136.  * On the other hand, a frame like this would be *
  5137.  * frame type 6, with a frame string of "*".     *
  5138.  *************************************************
  5139.  
  5140. Note that this routine differs from the ProBas equivalent in that it supports
  5141. full frame definitions through frame type 7 (ProBas only supports type 6).
  5142. The other differences mentioned under WindowManager are also relevant.
  5143.  
  5144.    WindowMan2 TopRow%, LeftCol%, BottomRow%, RightCol%, Frame%, FSt$,
  5145.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  5146.  
  5147. TopRow%     top row of window
  5148. LeftCol%    left column of window
  5149. BottomRow%  bottom row of window
  5150. RightCol%   right column of window
  5151. Frame%      frame type (see above)
  5152. FSt$        frame definition string (see above)
  5153. Fore%       frame foreground color
  5154. Back%       frame background color
  5155. Grow%       window growing option (see above)
  5156. Shade%      window shadow option (see above)
  5157. TFore%      title foreground color
  5158. Title$      window title ("" if none)
  5159. Page%       display page (normally zero)
  5160. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  5161.  
  5162. Name  : WindowMan3           (Window Manager)
  5163. Class : Display
  5164. Level : Clone
  5165.  
  5166. This routine is identical in function to WindowManager.  The parameters are
  5167. mostly passed as an array, however, instead of one by one.  Please see the
  5168. description of WindowManager for general information.
  5169.  
  5170.    WindowMan3 Parm%(), Title$
  5171.  
  5172. Parm%(1)    top row of window
  5173. Parm%(2)    left column of window
  5174. Parm%(3)    bottom row of window
  5175. Parm%(4)    right column of window
  5176. Parm%(5)    frame type (see above)
  5177. Parm%(6)    frame foreground color
  5178. Parm%(7)    frame background color
  5179. Parm%(8)    window growing option (see above)
  5180. Parm%(9)    window shadow option (see above)
  5181. Parm%(10)   title foreground color
  5182. Parm%(11)   display page (normally zero)
  5183. Parm%(12)   whether to use fast mode (0 if no, to avoid snow on CGAs)
  5184. Title$      window title ("" if none)
  5185.  
  5186. Name  : WindowMan4           (Window Manager)
  5187. Class : Display
  5188. Level : Clone
  5189.  
  5190. This is an extremely cut-down version of WindowManager, providing no more
  5191. than a simple frame generator.
  5192.  
  5193. These are the available frame types:
  5194.     0   no frame
  5195.     1   single lines
  5196.     2   double lines
  5197.     3   single horizontal, double vertical lines
  5198.     4   double horizontal, single vertical lines
  5199.     5   block graphic lines
  5200.  
  5201. Note that this routine is different from its ProBas equivalent in that a new
  5202. frame type (5) is available.
  5203.  
  5204.    WindowMan4 TopRow%, LeftCol%, BottomRow%, RightCol%, Frame%, Attr%,
  5205.       Page%, Fast%
  5206.  
  5207. TopRow%     top row of window
  5208. LeftCol%    left column of window
  5209. BottomRow%  bottom row of window
  5210. RightCol%   right column of window
  5211. Frame%      frame type (see above)
  5212. Attr%       frame color/attribute (use CalcAttr)
  5213. Page%       display page (normally zero)
  5214. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  5215.  
  5216. Name  : WriteBitF            (Write Bit Field)
  5217. Class : Numeric
  5218. Level : Any
  5219.  
  5220. This routine allows you to set an element of a virtual array.  The actual
  5221. array can be any numeric type, as it is just being used as a storage area.
  5222. The virtual array is composed of numbers of a bit length that you specify
  5223. (1-8).  This provides efficient storage for numbers which have a limited
  5224. range.
  5225.  
  5226. Here's how you DIM the actual array, assuming an integer array is used:
  5227.    DIM Array%(1 TO (VirtElements * VirtBits + 15) \ 16)
  5228.  
  5229. "VirtElements" is the number of elements in the virtual array and "VirtBits"
  5230. is the number of bits per element.
  5231.  
  5232. See also ReadBitF.
  5233.  
  5234.    WriteBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  5235.  
  5236. DSeg%        segment of actual array
  5237. DOfs%        offset of actual array
  5238. ElementNr&   virtual element number (starts at 0)
  5239. BitLen%      bits per virtual element (1-8)
  5240. Value%       value to set element to (0-255 or less, depending on BitLen%)
  5241.  
  5242. Name  : Xlate                (Translate)
  5243. Class : String
  5244. Level : Any
  5245.  
  5246. The Xlate routine allows for translating a string, character by character,
  5247. very quickly.  It uses a translation table that you provide.  This table is
  5248. 256 bytes long, one byte for each character in the ASCII table.  The
  5249. translation is done by position-- for instance, if the original character was
  5250. "A" (ASCII 65), the translated character will be whatever is in the
  5251. translation table at position 66.  Why 66, when "A" is 65?  Because ASCII
  5252. runs from 0-255, but the translation string is 1-256: everything is one
  5253. higher in the string than the ASCII character it represents.
  5254.  
  5255. Translation capabilities are handy in communications software.  They can also
  5256. be used in other things.  One simple use would be to set up a translation
  5257. table where all lowercase characters would be converted to uppercase.  You
  5258. might ask why, since BASIC has a UCASE$ function and PBClone has an Upcase
  5259. routine.  Well, Upcase is faster than UCASE$, since it doesn't have to create
  5260. a return string; but Xlate would be even faster, since it translates every
  5261. character directly instead of deciding whether it's a lowercase letter!
  5262.  
  5263. Simple encoding, WordStar file decryption, string reversal, uppercase /
  5264. lowercase conversion, and many other things can be done with Xlate.
  5265.  
  5266. Remember to initialize all 256 characters in the translation table!
  5267.  
  5268.    Xlate St$, XlateTable$
  5269.  
  5270. St$          string to translate
  5271. XlateTable$  translation table
  5272. -------
  5273. St$          translated string
  5274.  
  5275. Name  : XMPrint              (Translate and MS-DOS Print)
  5276. Class : Display
  5277. Level : DOS
  5278.  
  5279. A combination of the Xlate and DMPrint routines, this 'un allows you to
  5280. display using DOS services while being able to translate or screen out
  5281. characters.  Each character of the string to display is passed through a
  5282. translation table you provide (256 bytes, where each position corresponds
  5283. directly to the ASCII code of the same number [0-255]).  If the result is 0,
  5284. the character is not displayed.  Otherwise, the translated character is
  5285. displayed using DOS display services.  The new cursor position is returned so
  5286. you can inform BASIC about it.
  5287.  
  5288. Note that the new cursor position may not be accurate!  Some ANSI drivers do
  5289. not update the BIOS cursor position info, in which case the results won't be
  5290. useful.  That's a hazard of using DOS output.
  5291.  
  5292.    XMPrint St$, XlateTable$, Row%, Column%
  5293.    LOCATE Row%, Column%
  5294.  
  5295. St$          string to display
  5296. XlateTable$  translation table
  5297. -------
  5298. Row%         current row
  5299. Column%      current column
  5300.  
  5301. Name  : XorSt                (XOR String)
  5302. Class : String
  5303. Level : Any
  5304.  
  5305. This routine XORs each byte in one string with the corresponding byte in a
  5306. second string.  The strings must be the same length.
  5307.  
  5308.    XorSt St1$, St2$
  5309.  
  5310. St1$      string to XOR
  5311. St2$      string to XOR with
  5312. -------
  5313. St1$      result
  5314.  
  5315. Name  : XQPrint              (Extended Quick Print)
  5316. Class : Display
  5317. Level : Clone
  5318.  
  5319. This routine provides a rather crude, but very fast, display capability.  It
  5320. works like the PRINT statement in BASIC, except that it doesn't move the
  5321. cursor or process control codes.  It works only in text modes.
  5322.  
  5323. See also QPrint, a slightly less flexible (but even faster) routine.
  5324.  
  5325.    XQPrint St$, Row%, Column%, Attr%, Page%, Fast%
  5326.  
  5327. St$       string to display
  5328. Row%      starting row
  5329. Column%   starting column
  5330. Attr%     color/attribute (see CalcAttr)
  5331. Page%     display page (unused on MDA/Herc displays; normally zero)
  5332. Fast%     whether to use fast mode (nonzero if so; may cause snow on CGAs)
  5333.  
  5334. Name  : XQPrintOver          (Extended Quick Print Overwrite)
  5335. Class : Display
  5336. Level : Clone
  5337.  
  5338. This routine provides a rather crude, but very fast, display capability.  It
  5339. works like the PRINT statement in BASIC, except that it doesn't move the
  5340. cursor or process control codes.  It works only in text modes.
  5341.  
  5342. This is a slightly unusual variant on a print routine.  It displays all
  5343. characters except spaces.  If your string contains a space, that position on
  5344. the screen will be skipped.  In other words, it acts kind of like an overlay.
  5345. This can be handy when you have text in alternating colors.
  5346.  
  5347. I came up with this routine when I designed a program with a function key
  5348. display at the bottom of the screen-- the names of the function keys were one
  5349. color and the associated definitions were another color.  It was obvious that
  5350. the easiest way of handling that would be to use an "overlay" approach.  The
  5351. function key definitions were laid down with XQPrint.  I then overlaid the
  5352. line with the function key names in a different color, using XQPrintOver.
  5353.  
  5354.    XQPrintOver St$, Row%, Column%, Attr%, Page%, Fast%
  5355.  
  5356. St$       string to display
  5357. Row%      starting row
  5358. Column%   starting column
  5359. Attr%     color/attribute (see CalcAttr)
  5360. Page%     display page (unused on MDA/Herc displays; normally zero)
  5361. Fast%     whether to use fast mode (nonzero if so; may cause snow on CGAs)
  5362.  
  5363.