home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / CLIPPER / NFTROFF / 3.TR < prev    next >
Text File  |  1993-12-01  |  32KB  |  1,833 lines

  1. .de }n
  2. .bp
  3. .sp .5i
  4. ..
  5. .wh -.8i }n
  6. .sp .5i
  7. .po -.4i
  8. .ll 7.5i
  9. .ps 9
  10. .vs 9
  11. .in 0i
  12. .ta 1.63265i
  13. .sp 2
  14. .ne 20
  15. .ps +3
  16. .vs +3
  17. FT_CHDIR()    Change the current directory
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_CHDIR()
  25. Change the current directory
  26. .in 0i
  27. .br
  28. \l'6.24i'
  29. .br
  30. .sp
  31. .in 0.08i
  32. \fBSyntax
  33. .sp
  34. .in 0.4i
  35. \fBFT_CHDIR( <cDirName> ) -> nResult
  36. .sp
  37. .in 0.08i
  38. \fBArguments
  39. .sp
  40. .in 0.4i
  41. \fB<cDirName>\fR is the name of the desired directory\.
  42. .sp
  43. .in 0.08i
  44. \fBReturns
  45. .sp
  46. .in 0.4i
  47. .ta 0.24i
  48. 0    if successful
  49. .br
  50. .ta
  51. .ta 0.24i
  52. 3    if path not found
  53. .br
  54. .ta
  55. 99 if invalid parameters passed
  56. .sp
  57. .in 0.08i
  58. \fBDescription
  59. .sp
  60. .in 0.4i
  61. Use this function if you prefer to change the active directory
  62. instead of relying on the SET PATH command\.
  63. .sp
  64. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  65. To use another assembler, you will need to rearrange the PROC and
  66. SEGMENT directives, and also the ENDP and ENDS directives (a very
  67. minor task)\.
  68. .sp
  69. .in 0.08i
  70. \fBExamples
  71. .sp
  72. .in 0.4i
  73. .br
  74. FT_CHDIR( "C:\\CLIPPER" )
  75. .br
  76. FT_CHDIR( "\\" )
  77. .br
  78. FT_CHDIR( "\.\.\\SOURCE" )
  79. .sp
  80. .in 0.08i
  81. \fBSource:\fR CHDIR\.ASM
  82. .sp
  83. \fBAuthor:\fR Ted Means
  84. .in 0i
  85. .ta 1.63265i
  86. .sp 2
  87. .ne 20
  88. .ps +3
  89. .vs +3
  90. FT_DEFAULT()    Retrieve and optionally change the current default drive
  91. .br
  92. .ta
  93. .in 0.08i
  94. .ps -3
  95. .vs -3
  96. .sp 2
  97. \fBFT_DEFAULT()
  98. Retrieve and optionally change the current default drive
  99. .in 0i
  100. .br
  101. \l'6.24i'
  102. .br
  103. .sp
  104. .in 0.08i
  105. \fBSyntax
  106. .sp
  107. .in 0.4i
  108. \fBFT_DEFAULT( [ <cDrive> ] ) -> cDrive
  109. .sp
  110. .in 0.08i
  111. \fBArguments
  112. .sp
  113. .in 0.4i
  114. \fB<cDrive>\fR is optional, and if specified is the new default drive\.
  115. .sp
  116. .in 0.08i
  117. \fBReturns
  118. .sp
  119. .in 0.4i
  120. The current default drive\.  If a change of default drive is requested,
  121. the return value is the drive AFTER the change is made\.  This allows
  122. you to make sure you specified a valid drive (i\.e\. if you attempt to
  123. change the default drive, and the function returns a different drive
  124. letter than the one you specified, then the drive does not exist)\.
  125. .sp
  126. .in 0.08i
  127. \fBDescription
  128. .sp
  129. .in 0.4i
  130. Useful any time you need to know or change the default drive\.
  131. .sp
  132. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  133. To use another assembler, you will need to rearrange the PROC and
  134. SEGMENT directives, and also the ENDP and ENDS directives (a very
  135. minor task)\.
  136. .sp
  137. .in 0.08i
  138. \fBExamples
  139. .sp
  140. .in 0.4i
  141. .ta 1.92i
  142. cDrive := FT_DEFAULT()    && Get the current drive
  143. .br
  144. .ta
  145. .ta 1.92i
  146. FT_DEFAULT("C")    && Switch to drive C
  147. .br
  148. .ta
  149. .sp
  150. IF FT_DEFAULT("E") != "E"
  151. .in 0.64i
  152. Qout( "Drive E does not exist!" )
  153. .in 0.4i
  154. ENDIF
  155. .sp
  156. .in 0.08i
  157. \fBSource:\fR DEFAULT\.ASM
  158. .sp
  159. \fBAuthor:\fR Ted Means
  160. .in 0i
  161. .ta 1.63265i
  162. .sp 2
  163. .ne 20
  164. .ps +3
  165. .vs +3
  166. FT_DOSVER    Return the current DOS major and minor version as a string
  167. .br
  168. .ta
  169. .in 0.08i
  170. .ps -3
  171. .vs -3
  172. .sp 2
  173. \fBFT_DOSVER
  174. Return the current DOS major and minor version as a string
  175. .in 0i
  176. .br
  177. \l'6.24i'
  178. .br
  179. .sp
  180. .in 0.08i
  181. \fBSyntax
  182. .sp
  183. .in 0.4i
  184. \fBFT_DOSVER() -> <cVersion>
  185. .sp
  186. .in 0.08i
  187. \fBArguments
  188. .sp
  189. .in 0.4i
  190. None
  191. .sp
  192. .in 0.08i
  193. \fBReturns
  194. .sp
  195. .in 0.4i
  196. A character string with the major version number first, a
  197. period ("\."), then the minor version number (e\.g\., "3\.30")
  198. .sp
  199. .in 0.08i
  200. \fBDescription
  201. .sp
  202. .sp
  203. .in 0.4i
  204. FT_DOSVER() invokes DOS interrupt 21h, service 30 in order to
  205. return the current DOS version\.  It does this by setting up
  206. an array corresponding to machine registers and then calling
  207. the toolkit function FT_INT86()\.
  208. .sp
  209. It returns a character string corresponding to the DOS
  210. version, as follows:  The major version, a period ("\."), then
  211. the minor version\.
  212. .sp
  213. .sp
  214. .sp
  215. .in 0.08i
  216. \fBExamples
  217. .sp
  218. .sp
  219. .in 0.48i
  220. .br
  221. FUNCTION main()
  222. .br
  223. RETURN QOut( "Dos version: " + FT_DOSVER() )
  224. .sp
  225. .sp
  226. .in 0.08i
  227. \fBSource:\fR DOSVER\.PRG
  228. .sp
  229. \fBAuthor:\fR Glenn Scott
  230. .in 0i
  231. .ta 1.63265i
  232. .sp 2
  233. .ne 20
  234. .ps +3
  235. .vs +3
  236. FT_DSKFREE()    Return the amount of available disk space
  237. .br
  238. .ta
  239. .in 0.08i
  240. .ps -3
  241. .vs -3
  242. .sp 2
  243. \fBFT_DSKFREE()
  244. Return the amount of available disk space
  245. .in 0i
  246. .br
  247. \l'6.24i'
  248. .br
  249. .sp
  250. .in 0.08i
  251. \fBSyntax
  252. .sp
  253. .in 0.4i
  254. \fBFT_DSKFREE( [ <cDrive> ] ) -> nSpaceAvail
  255. .sp
  256. .in 0.08i
  257. \fBArguments
  258. .sp
  259. .in 0.4i
  260. \fB<cDrive>\fR is the fixed disk to query\. If no parameter is passed
  261. the operation will be performed on the default drive\.  Do not
  262. include the ":"\.
  263. .sp
  264. .in 0.08i
  265. \fBReturns
  266. .sp
  267. .in 0.4i
  268. Integer representing the available disk space in bytes\.
  269. .sp
  270. .in 0.08i
  271. \fBDescription
  272. .sp
  273. .in 0.4i
  274. Function to return the available space on the passed
  275. drive letter or the default drive if no drive is passed\.
  276. .sp
  277. Uses FT_INT86() through the internal function _ftDiskInfo()\.
  278. .sp
  279. .in 0.08i
  280. \fBExamples
  281. .sp
  282. .in 0.4i
  283. .ta 1.28i
  284. ? FT_DSKFREE()    // Returns free space on default drive\.
  285. .br
  286. .ta
  287. .sp
  288. .in 0.08i
  289. \fBSource:\fR DISKFUNC\.PRG
  290. .sp
  291. \fBAuthor:\fR Robert A\. DiFalco
  292. .in 0i
  293. .ta 1.63265i
  294. .sp 2
  295. .ne 20
  296. .ps +3
  297. .vs +3
  298. FT_DSKSIZE()    Return the maximum capacity of a fixed disk
  299. .br
  300. .ta
  301. .in 0.08i
  302. .ps -3
  303. .vs -3
  304. .sp 2
  305. \fBFT_DSKSIZE()
  306. Return the maximum capacity of a fixed disk
  307. .in 0i
  308. .br
  309. \l'6.24i'
  310. .br
  311. .sp
  312. .in 0.08i
  313. \fBSyntax
  314. .sp
  315. .in 0.4i
  316. \fBFT_DSKSIZE( [ <cDrive> ] ) -> nMaxCapacity
  317. .sp
  318. .in 0.08i
  319. \fBArguments
  320. .sp
  321. .in 0.4i
  322. \fB<cDrive>\fR is the fixed disk to query\. If no drive is sent, the
  323. operation will be performed on the default drive\. Send without
  324. the ":"\.
  325. .sp
  326. .in 0.08i
  327. \fBReturns
  328. .sp
  329. .in 0.4i
  330. An integer representing the maximum disk capacity in bytes\.
  331. .sp
  332. .in 0.08i
  333. \fBDescription
  334. .sp
  335. .in 0.4i
  336. Function utilizing FT_INT86() to return Maximum Disk Size\.
  337. Uses FT_INT86() through the internal function _ftDiskInfo()\.
  338. .sp
  339. .in 0.08i
  340. \fBExamples
  341. .sp
  342. .in 0.4i
  343. .ta 1.6i
  344. .br
  345. ? FT_DSKSIZE()    // Maximum capacity for default drive
  346. .br
  347. .ta
  348. .br
  349. ? FT_DSKSIZE( "D" ) // Maximum capacity for Drive D:
  350. .sp
  351. .in 0.08i
  352. \fBSource:\fR DISKFUNC\.PRG
  353. .sp
  354. \fBAuthor:\fR Robert A\. DiFalco
  355. .in 0i
  356. .ta 1.63265i
  357. .sp 2
  358. .ne 20
  359. .ps +3
  360. .vs +3
  361. FT_FLOPTST()    Test diskette drive status
  362. .br
  363. .ta
  364. .in 0.08i
  365. .ps -3
  366. .vs -3
  367. .sp 2
  368. \fBFT_FLOPTST()
  369. Test diskette drive status
  370. .in 0i
  371. .br
  372. \l'6.24i'
  373. .br
  374. .sp
  375. .in 0.08i
  376. \fBSyntax
  377. .sp
  378. .in 0.48i
  379. \fBFT_FLOPTST( <nDrive> ) -> nStatus
  380. .sp
  381. .in 0.08i
  382. \fBArguments
  383. .sp
  384. .in 0.48i
  385. \fB<nDrive>\fR is the diskette drive number, 0 = A:, 1 = B:
  386. .sp
  387. .in 0.08i
  388. \fBReturns
  389. .sp
  390. .in 0.48i
  391. .br
  392. -1 - Wrong Parameters
  393. .in 0.56i
  394. .br
  395. 0 - Drive Loaded and ready to read or write
  396. .br
  397. 1 - Drive Door Open or Diskette inserted upside down
  398. .br
  399. 2 - Diskette is unformatted
  400. .br
  401. 3 - Write protected
  402. .br
  403. 4 - Undetermined
  404. .sp
  405. .in 0.08i
  406. \fBDescription
  407. .sp
  408. .in 0.48i
  409. FT_FLOPTST() is designed as a full replacement for ISDRIVE()\.  Where
  410. ISDRIVE() returns just \.T\. or \.F\. depending if the diskette drive is
  411. ready or not, FT_FLOPTST() returns a numeric code designating the
  412. diskette drive\'s status\.
  413. .sp
  414. FT_FLOPTST() is particularly useful in backup and restore programs
  415. that need to test the floppy drive before writing/reading from a
  416. floppy disk\.
  417. .sp
  418. .in 0.08i
  419. \fBExamples
  420. .sp
  421. .in 0.48i
  422. .br
  423. iStatus := FT_FLOPTST( 1 )
  424. .sp
  425. .br
  426. DO CASE
  427. .in 0.72i
  428. .br
  429. CASE iStatus == 1
  430. .in 0.96i
  431. .br
  432. Qout( "The door to drive A is open\." )
  433. .in 0.72i
  434. .br
  435. CASE iStatus == 2
  436. .in 0.96i
  437. .br
  438. Qout( "The diskette in drive A is not formatted\." )
  439. .in 0.72i
  440. .br
  441. CASE iStatus == 3
  442. .in 0.96i
  443. .br
  444. Qout( "The diskette in drive A is write-protected\." )
  445. .in 0.72i
  446. .br
  447. CASE iStatus == 4
  448. .in 0.96i
  449. .br
  450. Qout( "Something is wrong with drive A, but I don\'t know what\." )
  451. .in 0.48i
  452. .br
  453. ENDCASE
  454. .sp
  455. .in 0.08i
  456. \fBSource:\fR FLOPTST\.ASM
  457. .sp
  458. \fBAuthor:\fR Joseph LaCour
  459. .in 0i
  460. .ta 1.63265i
  461. .sp 2
  462. .ne 20
  463. .ps +3
  464. .vs +3
  465. FT_HANDCNT()    Count number of available DOS (not network) file handles
  466. .br
  467. .ta
  468. .in 0.08i
  469. .ps -3
  470. .vs -3
  471. .sp 2
  472. \fBFT_HANDCNT()
  473. Count number of available DOS (not network) file handles
  474. .in 0i
  475. .br
  476. \l'6.24i'
  477. .br
  478. .sp
  479. .in 0.08i
  480. \fBSyntax
  481. .sp
  482. .in 0.32i
  483. \fBFT_HANDCNT() -> nHandles
  484. .sp
  485. .in 0.08i
  486. \fBArguments
  487. .sp
  488. .in 0.32i
  489. None
  490. .sp
  491. .in 0.08i
  492. \fBReturns
  493. .sp
  494. .in 0.32i
  495. numeric, long integer
  496. .sp
  497. .in 0.08i
  498. \fBDescription
  499. .sp
  500. .in 0.32i
  501. FT_HANDCNT() finds the internal DOS Device Control Blocks used for
  502. storing file information and counts the number of DCB entries\.  The
  503. DCB is set up by reading the FILES= line in CONFIG\.SYS, and there
  504. is one DCB entry for each file handle\.
  505. .sp
  506. NOTE: For Novell networks, the number of network file handles is
  507. .in 0.8i
  508. controlled by SHELL\.CFG\.  To date, I know where this information
  509. is stored after SHELL\.CFG has been read, but have not come up
  510. with a reliable way to retrieve the information\.  There is no
  511. public variable associated with the storage location, and the
  512. location can change from version to version of NETx\.EXE\.
  513. Novell Tech Support\'s response, though friendly, was "Nope, we
  514. don\'t know of a way for you to do it, either\.  Good luck\."
  515. .sp
  516. .in 0.08i
  517. \fBExamples
  518. .sp
  519. .in 0.32i
  520. .br
  521. nHandles := FT_HANDCNT()
  522. .br
  523. ? "This PC has " + LTRIM( STR( nHandles ) ) + " set by CONFIG\.SYS\."
  524. .sp
  525. .in 0.08i
  526. \fBSource:\fR HANDCNT\.ASM
  527. .sp
  528. \fBAuthor:\fR Bob Clarke
  529. .in 0i
  530. .ta 1.63265i
  531. .sp 2
  532. .ne 20
  533. .ps +3
  534. .vs +3
  535. FT_INP()    Retrieve a byte from a specified I/O port
  536. .br
  537. .ta
  538. .in 0.08i
  539. .ps -3
  540. .vs -3
  541. .sp 2
  542. \fBFT_INP()
  543. Retrieve a byte from a specified I/O port
  544. .in 0i
  545. .br
  546. \l'6.24i'
  547. .br
  548. .sp
  549. .in 0.08i
  550. \fBSyntax
  551. .sp
  552. .in 0.48i
  553. \fBFT_INP( <nPort> ) -> nValue
  554. .sp
  555. .in 0.08i
  556. \fBArguments
  557. .sp
  558. .in 0.4i
  559. \fB<nPort>\fR is the port from which to retrieve the byte\.  If it is
  560. invalid in any way, the function will return zero\.
  561. .sp
  562. .in 0.08i
  563. \fBReturns
  564. .sp
  565. .in 0.4i
  566. The byte retrieved\.
  567. .sp
  568. .in 0.08i
  569. \fBDescription
  570. .sp
  571. .in 0.4i
  572. It may sometimes be useful to read a byte from a port without having
  573. to resort to C or assembler\.  This function allows you to do so\.
  574. .sp
  575. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  576. To use another assembler, you will need to rearrange the PROC and
  577. SEGMENT directives, and also the ENDP and ENDS directives (a very
  578. minor task)\.
  579. .sp
  580. .in 0.08i
  581. \fBExamples
  582. .sp
  583. .in 0.4i
  584. .ta 1.92i
  585. byte := FT_INP( 100 )    // read a byte from port 100 (064h)
  586. .br
  587. .ta
  588. .sp
  589. .in 0.08i
  590. \fBSource:\fR INP\.ASM
  591. .sp
  592. \fBAuthor:\fR Ted Means
  593. .in 0i
  594. .sp
  595. .in 1.5i
  596. .ti -1.5i
  597. .ta 1.5i
  598. .ft B
  599. See Also:    
  600. .ft R
  601. FT_OUTP()
  602. .ta 1.63265i
  603. .in 0i
  604. .sp 2
  605. .ne 20
  606. .ps +3
  607. .vs +3
  608. FT_INT86()    Execute a software interrupt
  609. .br
  610. .ta
  611. .in 0.08i
  612. .ps -3
  613. .vs -3
  614. .sp 2
  615. \fBFT_INT86()
  616. Execute a software interrupt
  617. .in 0i
  618. .br
  619. \l'6.24i'
  620. .br
  621. .sp
  622. .in 0.08i
  623. \fBSyntax
  624. .sp
  625. .in 0.48i
  626. \fBFT_INT86( <nInterruptNumber>, <aRegisterValues> ) -> lResult
  627. .sp
  628. .in 0.08i
  629. \fBArguments
  630. .sp
  631. .in 0.48i
  632. \fB<nInterruptNumber>\fR is the interrupt to execute\.
  633. .sp
  634. \fB<aRegisterValues>\fR is an array that contains values to be loaded
  635. into the various CPU registers\.  The correspondence between
  636. registers and array elements is as follows:
  637. .sp
  638. .in 1.2i
  639. .ta 1.04i 1.36i
  640. aElement[1]    ==    AX register
  641. .br
  642. .ta
  643. .ta 1.04i 1.36i
  644. aElement[2]    ==    BX register
  645. .br
  646. .ta
  647. .ta 1.04i 1.36i
  648. aElement[3]    ==    CX register
  649. .br
  650. .ta
  651. .ta 1.04i 1.36i
  652. aElement[4]    ==    DX register
  653. .br
  654. .ta
  655. .ta 1.04i 1.36i
  656. aElement[5]    ==    SI register
  657. .br
  658. .ta
  659. .ta 1.04i 1.36i
  660. aElement[6]    ==    DI register
  661. .br
  662. .ta
  663. .ta 1.04i 1.36i
  664. aElement[7]    ==    BP register
  665. .br
  666. .ta
  667. .ta 1.04i 1.36i
  668. aElement[8]    ==    DS register
  669. .br
  670. .ta
  671. .ta 1.04i 1.36i
  672. aElement[9]    ==    ES register
  673. .br
  674. .ta
  675. .ta 1.36i
  676. aElement[10] ==    Flags register
  677. .br
  678. .ta
  679. .sp
  680. .in 0.08i
  681. \fBReturns
  682. .sp
  683. .in 0.48i
  684. \.T\. if all parameters valid and the function was able
  685. .in 0.8i
  686. to execute the desired interrupt\.
  687. .in 0.48i
  688. \.F\. if invalid parameters passed\.
  689. .sp
  690. .in 0.4i
  691. In addition, the array elements will contain whatever values were in
  692. the CPU registers immediately after the interrupt was executed\.  If
  693. either of the string parameters were altered by the interrupt, these
  694. changes will be reflected as well\.
  695. .sp
  696. .in 0.08i
  697. \fBDescription
  698. .sp
  699. .in 0.4i
  700. It is occasionally useful to be able to call interrupts directly from
  701. Clipper, without having to write a separate routine in C or ASM\.  This
  702. function allows you that capability\.
  703. .sp
  704. Given Clipper\'s high-level orientation, this function is necessarily
  705. somewhat messy to use\.  First, declare an array of ten elements to
  706. hold the eight values for the CPU registers and two string parameters\.
  707. Then initialize the array elements with the values that you want the
  708. CPU registers to contain when the interrupt is executed\.  You need not
  709. initialize all the elements\.  For example, if the interrupt requires
  710. you to specify values for AX, DX, and DS, you would only need to
  711. initialize elements 1, 4, and 8\.
  712. .sp
  713. Once you have done the required register setup, call FT_INT86(),
  714. passing the interrupt number and the register array as parameters\.
  715. The function will load the CPU with your specified values, execute the
  716. interrupt, and then store the contents of the CPU registers back into
  717. your array\.  This will allow you to evaluate the results of the
  718. interrupt\.
  719. .sp
  720. Some interrupt services require you to pass the address of a string in
  721. a pair of registers\.  This function is capable of handling these sorts
  722. of situations, but it will take a little work on your part\.  If you need
  723. to pass a string that uses the DS register, store the string in element
  724. .ta 0.32i
  725. 8;    if you need to pass a string that uses the ES register, store the
  726. .br
  727. .ta
  728. string in element 9\.  FT_INT86() will detect that you\'ve supplied a
  729. string instead of a numeric value and will behave accordingly\.
  730. .sp
  731. That takes care of obtaining the segment portion of the pointer\.  To
  732. specify which register is to contain the offset, use the values REG_DS
  733. and REG_ES which are defined in the FTINT86\.CH file\.  When one of these
  734. values is found in an array element, it alerts FT_Int86() to use the
  735. offset portion of a pointer instead of a numeric value\.  REG_DS tells
  736. FT_Int86() to use the offset of the string in element 8, while REG_ES
  737. tells FT_Int86() to use the offset of the string in element 9\.
  738. .sp
  739. All the CPU registers are sixteen bits in size\.  Some, however, are
  740. also split into two 8-bit registers\.  This function is only capable of
  741. receiving and returning registers that are 16 bits in size\.  To split
  742. a 16-bit register into two 8-bit values, you can use the
  743. pseudo-functions HighByte() and LowByte(), contained in the \.CH file\.
  744. .sp
  745. To alter an 8-bit number so it will appear in the high-order byte of a
  746. register when passed to the FT_INT86() function, use the MakeHI()
  747. pseudo-function contained in the \.CH file\.
  748. .sp
  749. This function is a shell for __ftint86(), which is written in assembler
  750. and does the actual work of executing the interrupt\.  __ftint86() is
  751. callable from C, so feel free to incorporate it into any C routines
  752. for which it might be useful\.  The source for __ftint86() can be found
  753. in the file AINT86\.ASM\.
  754. .sp
  755. .in 0.08i
  756. \fBExamples
  757. .sp
  758. .sp
  759. .in 0.4i
  760. .br
  761. * This example shows how to call the DOS "create file" service\.  Take
  762. .br
  763. * special note of how to set up string parameters\.
  764. .sp
  765. .br
  766. #include "FTINT86\.CH"
  767. .sp
  768. .ta 2.32i
  769. .br
  770. local aRegs[10]    && Declare the register array
  771. .br
  772. .ta
  773. .ta 2.32i
  774. .br
  775. aRegs[ AX ] := makehi(60)    && DOS service, create file
  776. .br
  777. .ta
  778. .ta 2.32i
  779. .br
  780. aRegs[ CX ] := 0    && Specify file attribute
  781. .br
  782. .ta
  783. .sp
  784. .br
  785. * Pay attention here, this is crucial\.  Note how to set up the string
  786. .br
  787. * so it appears in DS:DX\.
  788. .sp
  789. .br
  790. aRegs[ DS ] := "C:\\MISC\\MYFILE\.XXX"
  791. .br
  792. aRegs[ DX ] := REG_DS
  793. .ta 2.32i
  794. .br
  795. FT_INT86( 33, aRegs)    && Make the call to the DOS interrupt
  796. .br
  797. .ta
  798. .sp
  799. .sp
  800. .br
  801. * This example shows how to call the DOS "get current directory"
  802. .br
  803. * service\.  This one also uses a string parameter, but note that it
  804. .br
  805. * uses a different offset register\.
  806. .sp
  807. .br
  808. #include "FTINT86\.CH"
  809. .sp
  810. .br
  811. local aRegs[10]
  812. .br
  813. aRegs[ AX ] := makehi(71)
  814. .ta 2.16i
  815. .br
  816. aRegs[ DX ] := 0    // Choose default drive
  817. .br
  818. .ta
  819. .sp
  820. .br
  821. * This service requires a 64-byte buffer whose address is in DS:SI\.  DOS
  822. .br
  823. * will fill the buffer with the current directory\.
  824. .sp
  825. .br
  826. aRegs[ DS ] := space(64)
  827. .br
  828. aRegs[ SI ] := REG_DS
  829. .br
  830. FT_INT86( 33, aRegs)
  831. .sp
  832. .ta 1.6i
  833. .br
  834. ? aRegs[ DS ]    // Display the directory name
  835. .br
  836. .ta
  837. .sp
  838. .sp
  839. .sp
  840. .br
  841. * For the sake of completeness, here\'s an example that doesn\'t use a
  842. .br
  843. * string\.  This one changes the video mode\.
  844. .sp
  845. .br
  846. #include "FTINT86\.CH"
  847. .sp
  848. .br
  849. local aRegs[10]
  850. .sp
  851. .ta 2.16i
  852. .br
  853. aRegs[ AX ] := 16    && Choose hi-res graphics
  854. .br
  855. .ta
  856. .br
  857. FT_INT86( 16, aRegs)
  858. .sp
  859. .in 0.08i
  860. \fBHeader File:\fR FTINT86\.CH
  861. .sp
  862. \fBSource:\fR CINT86\.C
  863. .sp
  864. \fBAuthor:\fR Ted Means
  865. .in 0i
  866. .ta 1.63265i
  867. .sp 2
  868. .ne 20
  869. .ps +3
  870. .vs +3
  871. FT_ISPRINT()    Check printer status
  872. .br
  873. .ta
  874. .in 0.08i
  875. .ps -3
  876. .vs -3
  877. .sp 2
  878. \fBFT_ISPRINT()
  879. Check printer status
  880. .in 0i
  881. .br
  882. \l'6.24i'
  883. .br
  884. .sp
  885. .in 0.08i
  886. \fBSyntax
  887. .sp
  888. .in 0.4i
  889. \fBFT_ISPRINT( [ <cDevice> ] ) -> lResult
  890. .sp
  891. .in 0.08i
  892. \fBArguments
  893. .sp
  894. .in 0.4i
  895. \fB<cDevice>\fR is optional and is the device to test (LPT2, COM1, etc\.)\.
  896. If omitted, the function will default to the PRN device\.
  897. .sp
  898. .in 0.08i
  899. \fBReturns
  900. .sp
  901. .in 0.4i
  902. \.T\.  if device is ready for output\.
  903. \.F\.  if one of the following conditions occurs:
  904. .in 0.8i
  905. .ta 0.32i
  906. 1)    The device is not ready\.
  907. .br
  908. .ta
  909. .ta 0.32i
  910. 2)    The device does not exist\.
  911. .br
  912. .ta
  913. .ta 0.32i
  914. 3)    DOS couldn\'t open the device for some reason
  915. .br
  916. .ta
  917. .in 1.12i
  918. (such as no file handles available)\.
  919. .sp
  920. .in 0.08i
  921. \fBDescription
  922. .sp
  923. .in 0.4i
  924. The Clipper IsPrinter() function is somewhat limited because it only
  925. works with LPT1\.  Furthermore, it talks directly to the hardware, so
  926. if you have redirected LPT1 via the DOS MODE command, the IsPrinter()
  927. function will return erroneous results\.
  928. .sp
  929. This function offers a better alternative\.  Instead of talking to the
  930. hardware, it issues a DOS call that checks to see if the device is
  931. ready or not\.  That gives DOS an opportunity to deal with any
  932. redirections, and since you pass the device name as a parameter, you
  933. can test any device, not just LPT1 (note that the function defaults
  934. to PRN if you fail to pass a valid parameter)\.
  935. .sp
  936. The function also temporarily traps the DOS critical error handler so
  937. you don\'t get any nasty error messages if the device isn\'t ready\.  It
  938. restores the old critical error handler before exiting\.
  939. .sp
  940. Note that although this function is mainly designed for testing
  941. printers, you can also check to see if a drive is ready\.  Since DOS
  942. thinks the NUL device exists on every drive, you can pass a drive
  943. letter followed by NUL as a parameter\.  If DOS is able to open the
  944. NUL device, then the drive is ready, otherwise the door is open or
  945. something else is wrong\.
  946. .sp
  947. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  948. To use another assembler, you will need to rearrange the PROC and
  949. SEGMENT directives, and also the ENDP and ENDS directives (a very
  950. minor task)\.
  951. .sp
  952. .in 0.08i
  953. \fBExamples
  954. .sp
  955. .in 0.4i
  956. IF ! FT_ISPRINT()
  957. .in 0.64i
  958. Qout( "PRN is not ready!" )
  959. .in 0.4i
  960. ENDIF
  961. .sp
  962. IF ! FT_ISPRINT( "COM2" )
  963. .in 0.64i
  964. Qout( "Check the device on COM2\.  Something is wrong\." )
  965. .in 0.4i
  966. ENDIF
  967. .sp
  968. IF ! FT_ISPRINT( "A:\\NUL" )
  969. .in 0.64i
  970. Qout( "Oops, better check drive A!" )
  971. .in 0.4i
  972. ENDIF
  973. .sp
  974. .in 0.08i
  975. \fBSource:\fR ISPRINT\.ASM
  976. .sp
  977. \fBAuthor:\fR Ted Means
  978. .in 0i
  979. .ta 1.63265i
  980. .sp 2
  981. .ne 20
  982. .ps +3
  983. .vs +3
  984. FT_ISSHARE()    Determine if DOS "Share" is installed
  985. .br
  986. .ta
  987. .in 0.08i
  988. .ps -3
  989. .vs -3
  990. .sp 2
  991. \fBFT_ISSHARE()
  992. Determine if DOS "Share" is installed
  993. .in 0i
  994. .br
  995. \l'6.24i'
  996. .br
  997. .sp
  998. .in 0.08i
  999. \fBSyntax
  1000. .sp
  1001. .in 0.48i
  1002. \fBFT_ISSHARE() -> nRetCode
  1003. .sp
  1004. .in 0.08i
  1005. \fBArguments
  1006. .sp
  1007. .in 0.48i
  1008. None
  1009. .sp
  1010. .in 0.08i
  1011. \fBReturns
  1012. .sp
  1013. .in 0.48i
  1014. nRetcode will be set as follows on exit:
  1015. .sp
  1016. .in 0.8i
  1017. 0 if SHARE not loaded but ok to load
  1018. 1 if SHARE not loaded and not ok to load
  1019. .in 0.64i
  1020. 255 if SHARE loaded
  1021. .sp
  1022. .in 0.08i
  1023. \fBDescription
  1024. .sp
  1025. .in 0.48i
  1026. Uses DOS interrupt 2Fh (MultiPlex interrupt), service 10h
  1027. to determine if DOS SHARE\.COM is loaded\.
  1028. .sp
  1029. .in 0.08i
  1030. \fBExamples
  1031. .sp
  1032. .in 0.4i
  1033. IF FT_ISSHARE() != 255
  1034. .in 0.64i
  1035. Qout("SHARE must be loaded!")
  1036. .in 0.4i
  1037. ENDIF
  1038. .sp
  1039. .in 0.08i
  1040. \fBSource:\fR ISSHARE\.PRG
  1041. .sp
  1042. \fBAuthor:\fR Glenn Scott (from Tom Leylan C source)
  1043. .in 0i
  1044. .sp
  1045. .in 1.5i
  1046. .ti -1.5i
  1047. .ta 1.5i
  1048. .ft B
  1049. See Also:    
  1050. .ft R
  1051. FT_INT86()
  1052. .ta 1.63265i
  1053. .in 0i
  1054. .sp 2
  1055. .ne 20
  1056. .ps +3
  1057. .vs +3
  1058. FT_MKDIR()    Create a subdirectory
  1059. .br
  1060. .ta
  1061. .in 0.08i
  1062. .ps -3
  1063. .vs -3
  1064. .sp 2
  1065. \fBFT_MKDIR()
  1066. Create a subdirectory
  1067. .in 0i
  1068. .br
  1069. \l'6.24i'
  1070. .br
  1071. .sp
  1072. .in 0.08i
  1073. \fBSyntax
  1074. .sp
  1075. .in 0.4i
  1076. .ta 0.88i
  1077. \fBFT_MKDIR(    <cDirName> ) -> nResult
  1078. .br
  1079. .ta
  1080. .sp
  1081. .in 0.08i
  1082. \fBArguments
  1083. .sp
  1084. .in 0.4i
  1085. \fB<cDirName>\fR is the name of the directory to create\.
  1086. .sp
  1087. .in 0.08i
  1088. \fBReturns
  1089. .sp
  1090. .in 0.48i
  1091. .ta 0.24i
  1092. 0    if successful
  1093. .br
  1094. .ta
  1095. .ta 0.24i
  1096. 3    if Path Not Found
  1097. .br
  1098. .ta
  1099. .ta 0.24i
  1100. 5    if Access Denied or directory already exists
  1101. .br
  1102. .ta
  1103. .in 0.4i
  1104. .ta 0.32i
  1105. 99    if invalid parameters passed
  1106. .br
  1107. .ta
  1108. .sp
  1109. .in 0.08i
  1110. \fBDescription
  1111. .sp
  1112. .in 0.4i
  1113. Use this function to create the subdirectories needed by your
  1114. application\.  It might be especially useful in an installation
  1115. program\.
  1116. .sp
  1117. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  1118. To use another assembler, you will need to rearrange the PROC and
  1119. SEGMENT directives, and also the ENDP and ENDS directives (a very
  1120. minor task)\.
  1121. .sp
  1122. .in 0.08i
  1123. \fBExamples
  1124. .sp
  1125. .in 0.4i
  1126. .br
  1127. FT_MKDIR( "C:\\CLIPPER" )
  1128. .br
  1129. FT_MKDIR( "\\EXAMPLE" )
  1130. .br
  1131. FT_MKDIR( "\.\.\\SOURCE" )
  1132. .sp
  1133. .in 0.08i
  1134. \fBSource:\fR MKDIR\.ASM
  1135. .sp
  1136. \fBAuthor:\fR Ted Means
  1137. .in 0i
  1138. .ta 1.63265i
  1139. .sp 2
  1140. .ne 20
  1141. .ps +3
  1142. .vs +3
  1143. FT_OUTP()    Write a byte to a specified I/O port
  1144. .br
  1145. .ta
  1146. .in 0.08i
  1147. .ps -3
  1148. .vs -3
  1149. .sp 2
  1150. \fBFT_OUTP()
  1151. Write a byte to a specified I/O port
  1152. .in 0i
  1153. .br
  1154. \l'6.24i'
  1155. .br
  1156. .sp
  1157. .in 0.08i
  1158. \fBSyntax
  1159. .sp
  1160. .in 0.4i
  1161. \fBFT_OUTP( <nPort>, <nValue> ) -> lResult
  1162. .sp
  1163. .in 0.08i
  1164. \fBArguments
  1165. .sp
  1166. .in 0.48i
  1167. \fB<nPort>\fR is the port from which to retrieve the byte\.
  1168. .sp
  1169. \fB<nValue>\fR is the value between 0 and 255 to write to the port\.
  1170. .sp
  1171. .in 0.08i
  1172. \fBReturns
  1173. .sp
  1174. .in 0.4i
  1175. \.T\. if all parameters were valid and the byte was written to
  1176. .in 0.72i
  1177. the port\.
  1178. .in 0.4i
  1179. \.F\. if invalid parameters were passed\.
  1180. .sp
  1181. .in 0.08i
  1182. \fBDescription
  1183. .sp
  1184. .in 0.4i
  1185. It may sometimes be useful to write a byte to a port without having
  1186. to resort to C or assembler\.  This function allows you to do so\.
  1187. .sp
  1188. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  1189. To use another assembler, you will need to rearrange the PROC and
  1190. SEGMENT directives, and also the ENDP and ENDS directives (a very
  1191. minor task)\.
  1192. .sp
  1193. .in 0.08i
  1194. \fBExamples
  1195. .sp
  1196. .in 0.4i
  1197. .ta 2.16i
  1198. lOk := FT_OUTP( 100, 0 )    // send a Chr(0) to port 100 (064h)
  1199. .br
  1200. .ta
  1201. .sp
  1202. .in 0.08i
  1203. \fBSource:\fR OUTP\.ASM
  1204. .sp
  1205. \fBAuthor:\fR Ted Means
  1206. .in 0i
  1207. .sp
  1208. .in 1.5i
  1209. .ti -1.5i
  1210. .ta 1.5i
  1211. .ft B
  1212. See Also:    
  1213. .ft R
  1214. FT_INP()
  1215. .ta 1.63265i
  1216. .in 0i
  1217. .sp 2
  1218. .ne 20
  1219. .ps +3
  1220. .vs +3
  1221. FT_PEEK()    Retrieve a byte from a specified memory location\.
  1222. .br
  1223. .ta
  1224. .in 0.08i
  1225. .ps -3
  1226. .vs -3
  1227. .sp 2
  1228. \fBFT_PEEK()
  1229. Retrieve a byte from a specified memory location\.
  1230. .in 0i
  1231. .br
  1232. \l'6.24i'
  1233. .br
  1234. .sp
  1235. .in 0.08i
  1236. \fBSyntax
  1237. .sp
  1238. .in 0.4i
  1239. \fBFT_PEEK( <nSegment>, <nOffset> ) -> nValue
  1240. .sp
  1241. .in 0.08i
  1242. \fBArguments
  1243. .sp
  1244. .in 0.4i
  1245. \fB<nSegment>\fR is the segment of the desired memory address\.
  1246. .sp
  1247. .ta 0.88i
  1248. \fB<nOffset>\fR    is the offset of the desired memory address\.
  1249. .br
  1250. .ta
  1251. .sp
  1252. .in 0.08i
  1253. \fBReturns
  1254. .sp
  1255. .in 0.4i
  1256. <nValue> will be a value from 0 to 255 if all parameters were valid and
  1257. .in 1.12i
  1258. the function was able to retrieve the desired byte\.
  1259. .in 0.4i
  1260. <nValue> will be -1 if invalid parameters were passed\.
  1261. .sp
  1262. .in 0.08i
  1263. \fBDescription
  1264. .sp
  1265. .in 0.4i
  1266. Use this function if you have a need to examine a specific memory
  1267. location\.  The function will return the byte at the specified
  1268. address as a numeric value\.  If you need this value as a character,
  1269. use the Chr() function to convert it\.
  1270. .sp
  1271. This function was written for version 5\.1 of MicroSoft C\.  You may
  1272. have to modify the source code to use another compiler\.
  1273. .sp
  1274. .in 0.08i
  1275. \fBExamples
  1276. .sp
  1277. .in 0.4i
  1278. .ta 2.88i
  1279. local nVMode := FT_PEEK( 0, 1097 )    // Get the current video mode
  1280. .br
  1281. .ta
  1282. .sp
  1283. .in 0.08i
  1284. \fBSource:\fR PEEK\.C
  1285. .sp
  1286. \fBAuthor:\fR Ted Means
  1287. .in 0i
  1288. .ta 1.63265i
  1289. .sp 2
  1290. .ne 20
  1291. .ps +3
  1292. .vs +3
  1293. FT_POKE()    Write a byte to a specified memory location
  1294. .br
  1295. .ta
  1296. .in 0.08i
  1297. .ps -3
  1298. .vs -3
  1299. .sp 2
  1300. \fBFT_POKE()
  1301. Write a byte to a specified memory location
  1302. .in 0i
  1303. .br
  1304. \l'6.24i'
  1305. .br
  1306. .sp
  1307. .in 0.08i
  1308. \fBSyntax
  1309. .sp
  1310. .in 0.4i
  1311. \fBFT_POKE( <nSegment>, <nOffset>, <nValue> ) -> lResult
  1312. .sp
  1313. .in 0.08i
  1314. \fBArguments
  1315. .sp
  1316. .in 0.4i
  1317. \fB<nSegment>\fR is the segment of the desired memory address\.
  1318. .sp
  1319. .ta 0.88i
  1320. \fB<nOffset>\fR    is the offset of the desired memory address\.
  1321. .br
  1322. .ta
  1323. .sp
  1324. .ta 0.88i
  1325. \fB<nValue>\fR    is the value to write to the desired memory address\.
  1326. .br
  1327. .ta
  1328. .sp
  1329. .in 0.08i
  1330. \fBReturns
  1331. .sp
  1332. .in 0.4i
  1333. <lResult> will be \.T\. if all parameters were valid and the function was
  1334. .in 1.2i
  1335. able to write the desired byte\.
  1336. .in 0.4i
  1337. <lResult> will be \.F\. if invalid parameters were passed\.
  1338. .sp
  1339. .in 0.08i
  1340. \fBDescription
  1341. .sp
  1342. .in 0.4i
  1343. Use this function if you have a need to change the value at a specific
  1344. memory location\.  The function will write the specified byte to the
  1345. specified address\.  The value must be passed as a numeric; if the byte
  1346. you wish to use is stored as a character, use the Asc() function
  1347. to convert it\.
  1348. .sp
  1349. This function was written for version 5\.1 of MicroSoft C\.  You may
  1350. have to modify the source code to use another compiler\.
  1351. .sp
  1352. .in 0.08i
  1353. \fBExamples
  1354. .sp
  1355. .in 0.4i
  1356. .ta 1.84i
  1357. FT_POKE( 0, 1047, 64)    // Turn CapsLock on
  1358. .br
  1359. .ta
  1360. .sp
  1361. .in 0.08i
  1362. \fBSource:\fR POKE\.C
  1363. .sp
  1364. \fBAuthor:\fR Ted Means
  1365. .in 0i
  1366. .ta 1.63265i
  1367. .sp 2
  1368. .ne 20
  1369. .ps +3
  1370. .vs +3
  1371. FT_REBOOT()    Force a warm or cold boot
  1372. .br
  1373. .ta
  1374. .in 0.08i
  1375. .ps -3
  1376. .vs -3
  1377. .sp 2
  1378. \fBFT_REBOOT()
  1379. Force a warm or cold boot
  1380. .in 0i
  1381. .br
  1382. \l'6.24i'
  1383. .br
  1384. .sp
  1385. .in 0.08i
  1386. \fBSyntax
  1387. .sp
  1388. .in 0.48i
  1389. \fBFT_REBOOT( <nBootType> ) -> NIL
  1390. .sp
  1391. .in 0.08i
  1392. \fBArguments
  1393. .sp
  1394. .in 0.48i
  1395. \fB<nBootType>\fR is used to indicate the type of reboot\.  A value of zero
  1396. will cause a cold boot, while any other value will cause a warm boot\.
  1397. .sp
  1398. .in 0.08i
  1399. \fBReturns
  1400. .sp
  1401. .in 0.48i
  1402. NIL
  1403. .sp
  1404. .in 0.08i
  1405. \fBDescription
  1406. .sp
  1407. .in 0.48i
  1408. This function is valuable if you need to reboot the PC for some
  1409. reason; e\.g\. an installation routine that modifies CONFIG\.SYS or
  1410. AUTOEXEC\.BAT\.
  1411. .sp
  1412. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  1413. To use another assembler, you will need to rearrange the PROC and
  1414. SEGMENT directives, and also the ENDP and ENDS directives (a very
  1415. minor task)\.
  1416. .sp
  1417. .in 0.08i
  1418. \fBExamples
  1419. .sp
  1420. .in 0.48i
  1421. .br
  1422. #define COLD 0
  1423. .br
  1424. #define WARM 1
  1425. .sp
  1426. .br
  1427. // Issue a warm boot
  1428. .sp
  1429. .br
  1430. FT_Reboot(WARM)
  1431. .sp
  1432. .sp
  1433. .in 0.08i
  1434. \fBSource:\fR REBOOT\.ASM
  1435. .sp
  1436. \fBAuthor:\fR Ted Means
  1437. .in 0i
  1438. .ta 1.63265i
  1439. .sp 2
  1440. .ne 20
  1441. .ps +3
  1442. .vs +3
  1443. FT_RMDIR()    Delete a subdirectory
  1444. .br
  1445. .ta
  1446. .in 0.08i
  1447. .ps -3
  1448. .vs -3
  1449. .sp 2
  1450. \fBFT_RMDIR()
  1451. Delete a subdirectory
  1452. .in 0i
  1453. .br
  1454. \l'6.24i'
  1455. .br
  1456. .sp
  1457. .in 0.08i
  1458. \fBSyntax
  1459. .sp
  1460. .in 0.48i
  1461. \fBFT_RMDIR( <cDirName> ) -> nResult
  1462. .sp
  1463. .in 0.08i
  1464. \fBArguments
  1465. .sp
  1466. .in 0.48i
  1467. \fB<cDirName>\fR is the name of the directory to delete\.
  1468. .sp
  1469. .in 0.08i
  1470. \fBReturns
  1471. .sp
  1472. .in 0.56i
  1473. .ta 0.24i
  1474. 0    if successful
  1475. .br
  1476. .ta
  1477. .ta 0.24i
  1478. 3    if Path Not Found
  1479. .br
  1480. .ta
  1481. .ta 0.24i
  1482. 5    if Access Denied (directory not empty)
  1483. .br
  1484. .ta
  1485. .in 0.48i
  1486. .ta 0.32i
  1487. 16    if attempt to delete current directory\.
  1488. .br
  1489. .ta
  1490. .ta 0.32i
  1491. 99    if invalid parameters passed
  1492. .br
  1493. .ta
  1494. .sp
  1495. .in 0.08i
  1496. \fBDescription
  1497. .sp
  1498. .in 0.4i
  1499. This function is useful if you need to remove a subdirectory for
  1500. some reason\.
  1501. .sp
  1502. The source code is written to adhere to Turbo Assembler\'s IDEAL mode\.
  1503. To use another assembler, you will need to rearrange the PROC and
  1504. SEGMENT directives, and also the ENDP and ENDS directives (a very
  1505. minor task)\.
  1506. .sp
  1507. .in 0.08i
  1508. \fBExamples
  1509. .sp
  1510. .in 0.4i
  1511. .br
  1512. FT_RMDIR( "C:\\CLIPPER" )
  1513. .br
  1514. FT_RMDIR( "\\EXAMPLE" )
  1515. .br
  1516. FT_RMDIR( "\.\.\\SOURCE" )
  1517. .sp
  1518. .in 0.08i
  1519. \fBSource:\fR RMDIR\.ASM
  1520. .sp
  1521. \fBAuthor:\fR Ted Means
  1522. .in 0i
  1523. .ta 1.63265i
  1524. .sp 2
  1525. .ne 20
  1526. .ps +3
  1527. .vs +3
  1528. FT_SETDATE()    Set the DOS system date
  1529. .br
  1530. .ta
  1531. .in 0.08i
  1532. .ps -3
  1533. .vs -3
  1534. .sp 2
  1535. \fBFT_SETDATE()
  1536. Set the DOS system date
  1537. .in 0i
  1538. .br
  1539. \l'6.24i'
  1540. .br
  1541. .sp
  1542. .in 0.08i
  1543. \fBSyntax
  1544. .sp
  1545. .in 0.4i
  1546. \fBFT_SETDATE( <dDate> ) -> <lResult>
  1547. .sp
  1548. .in 0.08i
  1549. \fBArguments
  1550. .sp
  1551. .in 0.4i
  1552. \fB<dDate>\fR is a Clipper date variable that you want to set the current
  1553. DOS system date to\.
  1554. .sp
  1555. It is up to you to send in a valid date\.  The
  1556. year must be within the range 1980 through 2099\.  If DOS
  1557. thinks the date is not valid, it won\'t change the date\.
  1558. .sp
  1559. .sp
  1560. .in 0.08i
  1561. \fBReturns
  1562. .sp
  1563. .in 0.4i
  1564. <lResult> is simply the result of FT_INT86(), passed back
  1565. to your program\.
  1566. .sp
  1567. .sp
  1568. .in 0.08i
  1569. \fBDescription
  1570. .sp
  1571. .in 0.4i
  1572. FT_SETDATE() uses NANFOR\.LIB\'s FT_INT86() function to invoke
  1573. the DOS Set Date service (Interrupt 33, service 43)\.
  1574. .sp
  1575. .sp
  1576. .in 0.08i
  1577. \fBExamples
  1578. .sp
  1579. .sp
  1580. .in 0.16i
  1581. The following program takes a date from the command line and sets
  1582. the DOS system date:
  1583. .sp
  1584. .in 0.24i
  1585. FUNCTION main( cDate )
  1586. .sp
  1587. .in 0.48i
  1588. .br
  1589. cDate := iif( cDate == nil, dtoc( date() ), cDate )
  1590. .ta 2.8i
  1591. .br
  1592. QOut( "Setting date to: " + cDate    + "\.\.\. " )
  1593. .br
  1594. .ta
  1595. .br
  1596. FT_SETDATE( ctod( cDate ) )
  1597. .br
  1598. Qout( "Today is now: " + dtoc( date() ) )
  1599. .sp
  1600. .in 0.24i
  1601. RETURN ( nil )
  1602. .sp
  1603. .sp
  1604. .in 0.08i
  1605. \fBSource:\fR SETDATE\.PRG
  1606. .sp
  1607. \fBAuthor:\fR Glenn Scott
  1608. .in 0i
  1609. .ta 1.63265i
  1610. .sp 2
  1611. .ne 20
  1612. .ps +3
  1613. .vs +3
  1614. FT_SETTIME()    Set the DOS system time
  1615. .br
  1616. .ta
  1617. .in 0.08i
  1618. .ps -3
  1619. .vs -3
  1620. .sp 2
  1621. \fBFT_SETTIME()
  1622. Set the DOS system time
  1623. .in 0i
  1624. .br
  1625. \l'6.24i'
  1626. .br
  1627. .sp
  1628. .in 0.08i
  1629. \fBSyntax
  1630. .sp
  1631. .in 0.4i
  1632. \fBFT_SETTIME( <cTime> ) -> <lResult>
  1633. .sp
  1634. .in 0.08i
  1635. \fBArguments
  1636. .sp
  1637. .in 0.4i
  1638. \fB<cTime>\fR is a string in the form \fB<hh:mm:ss>\fR that you want to set
  1639. the current DOS system time to\.
  1640. .sp
  1641. Use 24-hour time\.  It is up to you to send in a valid time\.  If
  1642. DOS doesn\'t think it is valid, it won\'t reset the time anyway\.
  1643. .sp
  1644. .in 0.08i
  1645. \fBReturns
  1646. .sp
  1647. .in 0.4i
  1648. <lResult> is simply the result of FT_INT86(), passed back
  1649. to your program\.
  1650. .sp
  1651. .sp
  1652. .in 0.08i
  1653. \fBDescription
  1654. .sp
  1655. .in 0.4i
  1656. FT_SETTIME() uses NANFOR\.LIB\'s FT_INT86() function to invoke
  1657. the DOS Set Time service (Interrupt 33, service 45)\.
  1658. .sp
  1659. .sp
  1660. .in 0.08i
  1661. \fBExamples
  1662. .sp
  1663. .sp
  1664. .in 0.16i
  1665. The following program takes a time string from the command line and sets
  1666. the DOS system time:
  1667. .sp
  1668. .in 0.24i
  1669. FUNCTION main( cTime )
  1670. .sp
  1671. .in 0.48i
  1672. .br
  1673. cTime := iif( cTime == nil, time(), cTime )
  1674. .ta 2.8i
  1675. .br
  1676. QOut( "Setting time to: " + cTime    + "\.\.\. " )
  1677. .br
  1678. .ta
  1679. .br
  1680. FT_SETTIME( cTime )
  1681. .br
  1682. Qout( "Time is now: " + time() )
  1683. .sp
  1684. .in 0.24i
  1685. RETURN ( nil )
  1686. .sp
  1687. .sp
  1688. .in 0.08i
  1689. \fBSource:\fR SETTIME\.PRG
  1690. .sp
  1691. \fBAuthor:\fR Glenn Scott
  1692. .in 0i
  1693. .ta 1.63265i
  1694. .sp 2
  1695. .ne 20
  1696. .ps +3
  1697. .vs +3
  1698. FT_SYSMEM()    Determine the amount of conventional memory installed
  1699. .br
  1700. .ta
  1701. .in 0.08i
  1702. .ps -3
  1703. .vs -3
  1704. .sp 2
  1705. \fBFT_SYSMEM()
  1706. Determine the amount of conventional memory installed
  1707. .in 0i
  1708. .br
  1709. \l'6.24i'
  1710. .br
  1711. .sp
  1712. .in 0.08i
  1713. \fBSyntax
  1714. .sp
  1715. .in 0.4i
  1716. \fBFT_SYSMEM() -> nMemSize
  1717. .sp
  1718. .in 0.08i
  1719. \fBArguments
  1720. .sp
  1721. .in 0.4i
  1722. None
  1723. .sp
  1724. .in 0.08i
  1725. \fBReturns
  1726. .sp
  1727. .in 0.4i
  1728. A numeric corresponding to the number of K memory\.
  1729. .sp
  1730. .in 0.08i
  1731. \fBDescription
  1732. .sp
  1733. .in 0.4i
  1734. FT_SYSMEM() simply reports the amount of conventional memory
  1735. (up to 640K) installed\.
  1736. .sp
  1737. FT_SYSMEM() uses DOS interrupt 12h to get this information\.
  1738. For information, refer to Peter Norton\'s _Programmer\'s Guide
  1739. to the IBM PC_ (Brady)\.
  1740. .sp
  1741. .sp
  1742. .in 0.08i
  1743. \fBExamples
  1744. .sp
  1745. .in 0.4i
  1746. QOut( "Conventional memory installed: " + Str( FT_SYSMEM() ) + "K" )
  1747. .sp
  1748. .in 0.08i
  1749. \fBSource:\fR SYSMEM\.PRG
  1750. .sp
  1751. \fBAuthor:\fR Glenn Scott
  1752. .in 0i
  1753. .ta 1.63265i
  1754. .sp 2
  1755. .ne 20
  1756. .ps +3
  1757. .vs +3
  1758. FT_TEMPFIL()    Create a file with a unique name
  1759. .br
  1760. .ta
  1761. .in 0.08i
  1762. .ps -3
  1763. .vs -3
  1764. .sp 2
  1765. \fBFT_TEMPFIL()
  1766. Create a file with a unique name
  1767. .in 0i
  1768. .br
  1769. \l'6.24i'
  1770. .br
  1771. .sp
  1772. .in 0.08i
  1773. \fBSyntax
  1774. .sp
  1775. .in 0.4i
  1776. \fBFT_TEMPFIL( [ <cPath> ] [, <lHide> ] ) -> cFileSpec
  1777. .sp
  1778. .in 0.08i
  1779. \fBArguments
  1780. .sp
  1781. .in 0.4i
  1782. \fB<cPath>\fR is the directory where you want to create the temporary
  1783. file\.  If you omit this argument, the root of the current drive
  1784. is assumed ("\\")\.
  1785. .sp
  1786. If \fB<lHide>\fR is \.T\., then the file will be created with the hidden
  1787. attribute set\.  The default is \.F\.
  1788. .sp
  1789. .in 0.08i
  1790. \fBReturns
  1791. .sp
  1792. .in 0.4i
  1793. <cFileSpec> should be your path, including the name of the newly
  1794. created unique file\.  Use this with FOPEN(), etc\.
  1795. .sp
  1796. .in 0.08i
  1797. \fBDescription
  1798. .sp
  1799. .in 0.4i
  1800. This function uses DOS Interrupt 21, service 5Ah (Create temporary
  1801. file) to create a unique filename in a directory you specify\.
  1802. There will be no extension\.  After the file is created, you may
  1803. then fopen() it and do any i/o you need (see the test driver
  1804. in the source code)\.
  1805. .sp
  1806. This function requires FT_INT86()\.
  1807. .sp
  1808. .in 0.08i
  1809. \fBExamples
  1810. .sp
  1811. .in 0.4i
  1812. Create a unique file in the root of the current drive:
  1813. .sp
  1814. .in 0.96i
  1815. myFile := FT_TEMPFIL()
  1816. .sp
  1817. .in 0.4i
  1818. Create a unique file in the current directory and hide it:
  1819. .sp
  1820. .in 0.96i
  1821. myFile := FT_TEMPFIL("\.\\", \.t\.)
  1822. .sp
  1823. .in 0.4i
  1824. Create a unique file on another drive, but do not hide it:
  1825. .sp
  1826. .in 0.96i
  1827. myFile := FT_TEMPFIL("e:\\nanfor\\src\\")
  1828. .sp
  1829. .in 0.08i
  1830. \fBSource:\fR TEMPFILE\.PRG
  1831. .sp
  1832. \fBAuthor:\fR Glenn Scott
  1833.