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

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