home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / CLIPPER / NFTROFF / 7.TR < prev    next >
Text File  |  1993-12-01  |  18KB  |  1,228 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_DFCLOSE()    Close file displayed by FT_DISPFILE()
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_DFCLOSE()
  25. Close file displayed by FT_DISPFILE()
  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_DFCLOSE() -> NIL
  36. .sp
  37. .in 0.08i
  38. \fBArguments
  39. .sp
  40. .in 0.4i
  41. None
  42. .sp
  43. .in 0.08i
  44. \fBReturns
  45. .sp
  46. .in 0.4i
  47. NIL
  48. .sp
  49. .in 0.08i
  50. \fBDescription
  51. .sp
  52. .in 0.4i
  53. Closes the file opened by FT_DFSETUP()
  54. .sp
  55. .in 0.08i
  56. \fBExamples
  57. .sp
  58. .in 0.4i
  59. @ 4,9 TO 11,71
  60. .sp
  61. FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
  62. .in 1.36i
  63. "AaBb" + Chr(143), \.T\., 5, 132, 4096)
  64. .sp
  65. .in 0.4i
  66. cKey = FT_DISPFILE()
  67. .sp
  68. FT_DFCLOSE()
  69. .sp
  70. @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
  71. .sp
  72. .in 0.08i
  73. \fBSource:\fR DFILE\.PRG
  74. .sp
  75. \fBAuthor:\fR Mike Taylor
  76. .in 0i
  77. .sp
  78. .in 1.5i
  79. .ti -1.5i
  80. .ta 1.5i
  81. .ft B
  82. See Also:    
  83. .ft R
  84. FT_DFSETUP()
  85. , FT_DISPFILE()
  86. .ta 1.63265i
  87. .in 0i
  88. .sp 2
  89. .ne 20
  90. .ps +3
  91. .vs +3
  92. FT_DFSETUP()    Set up parameters for FT_DISPFILE()
  93. .br
  94. .ta
  95. .in 0.08i
  96. .ps -3
  97. .vs -3
  98. .sp 2
  99. \fBFT_DFSETUP()
  100. Set up parameters for FT_DISPFILE()
  101. .in 0i
  102. .br
  103. \l'6.24i'
  104. .br
  105. .sp
  106. .in 0.08i
  107. \fBSyntax
  108. .sp
  109. .in 0.4i
  110. .br
  111. \fBFT_DFSETUP( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ;
  112. .in 1.12i
  113. .ta 4.16i
  114. .br
  115. \fB<nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>,    ;
  116. .br
  117. .ta
  118. .br
  119. \fB<lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) -> nResult
  120. .sp
  121. .in 0.08i
  122. \fBArguments
  123. .sp
  124. .in 0.64i
  125. .ta 1.12i
  126. \fB<cInFile>\fR    - text file to display (full path and filename)
  127. .br
  128. .ta
  129. .ta 1.12i
  130. \fB<nTop>\fR    - upper row of window
  131. .br
  132. .ta
  133. .ta 1.12i
  134. \fB<nLeft>\fR    - left col of window
  135. .br
  136. .ta
  137. .ta 1.12i
  138. \fB<nBottom>\fR    - lower row of window
  139. .br
  140. .ta
  141. .ta 1.12i
  142. \fB<nRight>\fR    - right col of window
  143. .br
  144. .ta
  145. .ta 1.12i
  146. \fB<nStart>\fR    - line to place highlight at startup
  147. .br
  148. .ta
  149. .ta 1.12i 3.04i
  150. \fB<nCNormal>\fR    - normal text color    (numeric attribute)
  151. .br
  152. .ta
  153. .ta 3.04i
  154. \fB<nCHighlight>\fR - text highlight color    (numeric attribute)
  155. .br
  156. .ta
  157. .ta 1.12i 3.04i
  158. \fB<cExitKeys>\fR    - terminating key list    (each byte of string is a
  159. .br
  160. .ta
  161. .in 1.92i
  162. key code)
  163. .in 0.64i
  164. .ta 1.12i
  165. \fB<lBrowse>\fR    - act-like-a-browse-routine flag
  166. .br
  167. .ta
  168. .ta 1.12i
  169. \fB<nColSkip>\fR    - col increment for left/right arrows
  170. .br
  171. .ta
  172. .ta 1.12i
  173. \fB<nRMargin>\fR    - right margin - anything to right is truncated
  174. .br
  175. .ta
  176. .ta 1.12i
  177. \fB<nBuffSize>\fR    - size of the paging buffer
  178. .br
  179. .ta
  180. .sp
  181. .in 0.08i
  182. \fBReturns
  183. .sp
  184. .in 0.4i
  185. 0 if successful, FError() code if not
  186. .sp
  187. .in 0.08i
  188. \fBDescription
  189. .sp
  190. .in 0.4i
  191. Note: make sure you allocate a buffer large enough to hold enough
  192. data for the number of lines that you have in the window\.  Use the
  193. following formula as a guideline:
  194. .sp
  195. .in 0.64i
  196. buffer size = (# of line) + 1 * RMargin
  197. .sp
  198. .in 0.4i
  199. This is the smallest you should make the buffer\.  For normal use,
  200. 4096 bytes is recommended
  201. .sp
  202. .in 0.08i
  203. \fBExamples
  204. .sp
  205. .in 0.4i
  206. @ 4,9 TO 11,71
  207. .sp
  208. FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
  209. .in 1.28i
  210. "AaBb" + Chr(143), \.T\., 5, 132, 4096)
  211. .sp
  212. .in 0.4i
  213. cKey = FT_DISPFILE()
  214. .sp
  215. FT_DFCLOSE()
  216. .sp
  217. @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
  218. .sp
  219. .in 0.08i
  220. \fBSource:\fR DFILE\.PRG
  221. .sp
  222. \fBAuthor:\fR Mike Taylor
  223. .in 0i
  224. .sp
  225. .in 1.5i
  226. .ti -1.5i
  227. .ta 1.5i
  228. .ft B
  229. See Also:    
  230. .ft R
  231. FT_DISPFILE()
  232. , FT_DFCLOSE()
  233. .ta 1.63265i
  234. .in 0i
  235. .sp 2
  236. .ne 20
  237. .ps +3
  238. .vs +3
  239. FT_DISPFILE()    Browse a text file
  240. .br
  241. .ta
  242. .in 0.08i
  243. .ps -3
  244. .vs -3
  245. .sp 2
  246. \fBFT_DISPFILE()
  247. Browse a text file
  248. .in 0i
  249. .br
  250. \l'6.24i'
  251. .br
  252. .sp
  253. .in 0.08i
  254. \fBSyntax
  255. .sp
  256. .in 0.4i
  257. \fBFT_DISPFILE() -> cExitkey
  258. .sp
  259. .in 0.08i
  260. \fBArguments
  261. .sp
  262. .in 0.4i
  263. None
  264. .sp
  265. .in 0.08i
  266. \fBReturns
  267. .sp
  268. .in 0.4i
  269. The ASCII keystroke that terminated FT_DISPFILE()
  270. .sp
  271. .in 0.08i
  272. \fBDescription
  273. .sp
  274. .in 0.4i
  275. This routine displays a text file within a defined window using as
  276. little memory as possible\.  The text file to display has to be
  277. present or an error value of 0 is returned (as a character\.)
  278. .sp
  279. Assumptions: The routine assumes that all lines are terminated
  280. .in 1.44i
  281. with a CR/LF sequence (0x0d and 0x0a)\.
  282. .sp
  283. .in 0.4i
  284. .ta 1.04i
  285. Note:    Make sure you allocate a buffer large enough to hold
  286. .br
  287. .ta
  288. .in 1.44i
  289. enough data for the number of lines that you have
  290. in the window\.  Use the following formula as a
  291. guideline - buffer size = (# of line) + 1 * RMargin
  292. this is the smallest you should make the buffer and
  293. for normal use I recommend 4096 bytes\.
  294. .sp
  295. .in 0.4i
  296. .ta 2i
  297. Cursor Keys: Up, Down    - moves the highlight line
  298. .br
  299. .ta
  300. .in 1.44i
  301. Left, Right - moves the window over nColSkip col\'s
  302. .ta 0.96i
  303. Home    - moves the window to the far left
  304. .br
  305. .ta
  306. .ta 0.96i
  307. End    - moves the window to the nRMargin column
  308. .br
  309. .ta
  310. .ta 0.96i
  311. PgUp, PgDn    - moves the highlight one page
  312. .br
  313. .ta
  314. .ta 0.96i
  315. Ctrl-PgUp    - moves the highlight to the file top
  316. .br
  317. .ta
  318. .ta 0.96i
  319. Ctrl-PgDn    - moves the highlight to the file bottom
  320. .br
  321. .ta
  322. .ta 0.96i
  323. Ctrl-Right    - moves the window 16 col\'s to the right
  324. .br
  325. .ta
  326. .ta 0.96i
  327. Ctrl-Left    - moves the window 16 col\'s to the left
  328. .br
  329. .ta
  330. .sp
  331. Esc, Return - terminates the function
  332. .sp
  333. All other keys are ignored unless they are specified
  334. within cExitKeys parameter\.  This list will tell the
  335. routine what keys terminate the function\.  Special
  336. keys must be passed by a unique value and that value
  337. can be found by looking in the keys\.h file\.
  338. .sp
  339. .in 0.08i
  340. \fBExamples
  341. .sp
  342. .in 0.4i
  343. @ 4,9 TO 11,71
  344. .sp
  345. FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
  346. .in 1.36i
  347. "AaBb" + Chr(143), \.T\., 5, 132, 4096)
  348. .sp
  349. .in 0.4i
  350. cKey = FT_DISPFILE()
  351. .sp
  352. FT_DFCLOSE()
  353. .sp
  354. @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
  355. .sp
  356. .in 0.08i
  357. \fBSource:\fR DISPC\.C
  358. .sp
  359. \fBAuthor:\fR Mike Taylor
  360. .in 0i
  361. .sp
  362. .in 1.5i
  363. .ti -1.5i
  364. .ta 1.5i
  365. .ft B
  366. See Also:    
  367. .ft R
  368. FT_DFSETUP()
  369. , FT_DFCLOSE()
  370. .ta 1.63265i
  371. .in 0i
  372. .sp 2
  373. .ne 20
  374. .ps +3
  375. .vs +3
  376. FT_FEOF()    Determine when end of text file is encountered
  377. .br
  378. .ta
  379. .in 0.08i
  380. .ps -3
  381. .vs -3
  382. .sp 2
  383. \fBFT_FEOF()
  384. Determine when end of text file is encountered
  385. .in 0i
  386. .br
  387. \l'6.24i'
  388. .br
  389. .sp
  390. .in 0.08i
  391. \fBSyntax
  392. .sp
  393. .in 0.4i
  394. \fBFT_FEOF() -> lResult
  395. .sp
  396. .in 0.08i
  397. \fBArguments
  398. .sp
  399. .in 0.4i
  400. None
  401. .sp
  402. .in 0.08i
  403. \fBReturns
  404. .sp
  405. .in 0.4i
  406. \.T\. if an attempt was made to skip past the last record of
  407. the currently selected text file, otherwise \.F\.
  408. .sp
  409. .in 0.08i
  410. \fBDescription
  411. .sp
  412. .in 0.4i
  413. This function is similar to the CLIPPER Eof() function\.
  414. .sp
  415. A text file "record" is a line of text terminated by a CRLF pair\.
  416. .sp
  417. .in 0.08i
  418. \fBExamples
  419. .sp
  420. .in 0.4i
  421. .br
  422. FT_FUSE( "FTTEXT\.C" )
  423. .br
  424. FT_FGOBOT()
  425. .ta 1.52i
  426. .br
  427. ? FT_FEOF()    // \.F\.
  428. .br
  429. .ta
  430. .br
  431. FT_FSKIP()
  432. .ta 1.52i
  433. .br
  434. ? FT_FEOF()    // \.T\.
  435. .br
  436. .ta
  437. .sp
  438. .in 0.08i
  439. \fBSource:\fR FTTEXT\.C
  440. .sp
  441. \fBAuthor:\fR Brice de Ganahl
  442. .in 0i
  443. .sp
  444. .in 1.5i
  445. .ti -1.5i
  446. .ta 1.5i
  447. .ft B
  448. See Also:    
  449. .ft R
  450. FT_FUSE()
  451. , FT_FGOBOT()
  452. , FT_FSKIP()
  453. .ta 1.63265i
  454. .in 0i
  455. .sp 2
  456. .ne 20
  457. .ps +3
  458. .vs +3
  459. FT_FGOBOT()    Go to the last record in a text file
  460. .br
  461. .ta
  462. .in 0.08i
  463. .ps -3
  464. .vs -3
  465. .sp 2
  466. \fBFT_FGOBOT()
  467. Go to the last record in a text file
  468. .in 0i
  469. .br
  470. \l'6.24i'
  471. .br
  472. .sp
  473. .in 0.08i
  474. \fBSyntax
  475. .sp
  476. .in 0.4i
  477. \fBFT_FGOBOT() -> NIL
  478. .sp
  479. .in 0.08i
  480. \fBArguments
  481. .sp
  482. .in 0.4i
  483. None
  484. .sp
  485. .in 0.08i
  486. \fBReturns
  487. .sp
  488. .in 0.4i
  489. NIL
  490. .sp
  491. .in 0.08i
  492. \fBDescription
  493. .sp
  494. .in 0.4i
  495. This function moves the record pointer to the last record of the
  496. file in the currently selected text file workarea\.
  497. .sp
  498. A text file "record" is a line of text terminated by a CRLF pair\.
  499. .sp
  500. .in 0.08i
  501. \fBExamples
  502. .sp
  503. .in 0.4i
  504. .br
  505. // read last line
  506. .br
  507. FT_FUSE( "text\.c" )
  508. .br
  509. FT_FGOBOT()
  510. .br
  511. ? FT_FREADLN()
  512. .sp
  513. .in 0.08i
  514. \fBSource:\fR FTTEXT\.C
  515. .sp
  516. \fBAuthor:\fR Brice de Ganahl
  517. .in 0i
  518. .sp
  519. .in 1.5i
  520. .ti -1.5i
  521. .ta 1.5i
  522. .ft B
  523. See Also:    
  524. .ft R
  525. FT_FSELECT()
  526. , FT_FUSE()
  527. , FT_FGOTOP()
  528. , FT_FRECNO()
  529. , FT_FREADLN()
  530. .ta 1.63265i
  531. .in 0i
  532. .sp 2
  533. .ne 20
  534. .ps +3
  535. .vs +3
  536. FT_FGOTO()    Move record pointer to specific record in a text file
  537. .br
  538. .ta
  539. .in 0.08i
  540. .ps -3
  541. .vs -3
  542. .sp 2
  543. \fBFT_FGOTO()
  544. Move record pointer to specific record in a text file
  545. .in 0i
  546. .br
  547. \l'6.24i'
  548. .br
  549. .sp
  550. .in 0.08i
  551. \fBSyntax
  552. .sp
  553. .in 0.4i
  554. \fBFT_FGOTO( nLine ) -> NIL
  555. .sp
  556. .in 0.08i
  557. \fBArguments
  558. .sp
  559. .in 0.4i
  560. \fB<nLine>\fR is the record number to go to\.
  561. .sp
  562. .in 0.08i
  563. \fBReturns
  564. .sp
  565. .in 0.4i
  566. NIL
  567. .sp
  568. .in 0.08i
  569. \fBDescription
  570. .sp
  571. .in 0.4i
  572. This function moves the record pointer to a specific record
  573. in the file in the currently selected text file workarea\.  If
  574. the record number requested is greater than the number of records
  575. in the file, the record pointer will be positioned at the last
  576. record\.
  577. .sp
  578. A text file "record" is a line of text terminated by a CRLF pair\.
  579. .sp
  580. .in 0.08i
  581. \fBExamples
  582. .sp
  583. .in 0.4i
  584. .br
  585. // read 5th line of text from file
  586. .br
  587. FT_FUSE( "FTTEXT\.C" )
  588. .br
  589. FT_FGOTO(5)
  590. .br
  591. cText := FT_FREADLN()
  592. .sp
  593. .in 0.08i
  594. \fBSource:\fR FTTEXT\.C
  595. .sp
  596. \fBAuthor:\fR Brice de Ganahl
  597. .in 0i
  598. .sp
  599. .in 1.5i
  600. .ti -1.5i
  601. .ta 1.5i
  602. .ft B
  603. See Also:    
  604. .ft R
  605. FT_FRECNO()
  606. , FT_FGOTOP()
  607. , FT_FGOBOT()
  608. , FT_FREADLN()
  609. .ta 1.63265i
  610. .in 0i
  611. .sp 2
  612. .ne 20
  613. .ps +3
  614. .vs +3
  615. FT_FGOTOP()    Go to the first record in a text file
  616. .br
  617. .ta
  618. .in 0.08i
  619. .ps -3
  620. .vs -3
  621. .sp 2
  622. \fBFT_FGOTOP()
  623. Go to the first record in a text file
  624. .in 0i
  625. .br
  626. \l'6.24i'
  627. .br
  628. .sp
  629. .in 0.08i
  630. \fBSyntax
  631. .sp
  632. .in 0.4i
  633. \fBFT_FGOTOP() -> NIL
  634. .sp
  635. .in 0.08i
  636. \fBArguments
  637. .sp
  638. .in 0.4i
  639. None
  640. .sp
  641. .in 0.08i
  642. \fBReturns
  643. .sp
  644. .in 0.4i
  645. NIL
  646. .sp
  647. .in 0.08i
  648. \fBDescription
  649. .sp
  650. .in 0.4i
  651. This function moves the record pointer to the first record
  652. in the currently selected text file workarea\.
  653. .sp
  654. A text file "record" is a line of text terminated by a CRLF pair\.
  655. .sp
  656. .in 0.08i
  657. \fBExamples
  658. .sp
  659. .in 0.4i
  660. .ta 2i
  661. .br
  662. FT_FUSE( "text\.c" )    // open text file
  663. .br
  664. .ta
  665. .br
  666. DO WHILE !FT_FEOF()
  667. .in 0.64i
  668. .ta 1.76i
  669. .br
  670. ? FT_FREADLN()    // read thru file
  671. .br
  672. .ta
  673. .br
  674. FT_FSKIP()
  675. .in 0.4i
  676. .br
  677. ENDDO
  678. .ta 2i
  679. .br
  680. FT_FGOTOP()    // go back to top
  681. .br
  682. .ta
  683. .ta 2i
  684. .br
  685. ? FT_FRECNO()    // 1
  686. .br
  687. .ta
  688. .sp
  689. .in 0.08i
  690. \fBSource:\fR FTTEXT\.C
  691. .sp
  692. \fBAuthor:\fR Brice de Ganahl
  693. .in 0i
  694. .sp
  695. .in 1.5i
  696. .ti -1.5i
  697. .ta 1.5i
  698. .ft B
  699. See Also:    
  700. .ft R
  701. FT_FSELECT()
  702. , FT_FUSE()
  703. , FT_FRECNO()
  704. , FT_FGOBOT()
  705. .ta 1.63265i
  706. .in 0i
  707. .sp 2
  708. .ne 20
  709. .ps +3
  710. .vs +3
  711. FT_FLASTREC()    Determine the no\. of records in the currently selected text
  712. .br
  713. .ta
  714. .in 0.08i
  715. .ps -3
  716. .vs -3
  717. .sp 2
  718. \fBFT_FLASTREC()
  719. Determine the no\. of records in the currently selected text
  720. .in 0i
  721. .br
  722. \l'6.24i'
  723. .br
  724. .sp
  725. .in 0.08i
  726. \fBSyntax
  727. .sp
  728. .in 0.4i
  729. \fBFT_FLASTREC() -> nLastRecordNum
  730. .sp
  731. .in 0.08i
  732. \fBArguments
  733. .sp
  734. .in 0.4i
  735. None
  736. .sp
  737. .in 0.08i
  738. \fBReturns
  739. .sp
  740. .in 0.4i
  741. An integer containing the number of records in the text file in
  742. the currently selected text file workarea, or zero if no file
  743. is currently open in the workarea\.
  744. .sp
  745. .in 0.08i
  746. \fBDescription
  747. .sp
  748. .in 0.4i
  749. This function returns the number of the last record in a text file\.
  750. .sp
  751. A text file "record" is a line of text terminated by a CRLF pair\.
  752. .sp
  753. .in 0.08i
  754. \fBExamples
  755. .sp
  756. .in 0.4i
  757. .br
  758. FT_FUSE( "text\.c" )
  759. .br
  760. ? FT_FLASTREC()
  761. .sp
  762. .in 0.08i
  763. \fBSource:\fR FTTEXT\.C
  764. .sp
  765. \fBAuthor:\fR Brice de Ganahl
  766. .in 0i
  767. .sp
  768. .in 1.5i
  769. .ti -1.5i
  770. .ta 1.5i
  771. .ft B
  772. See Also:    
  773. .ft R
  774. FT_FUSE()
  775. , FT_FGOBOT()
  776. , FT_FRECNO()
  777. .ta 1.63265i
  778. .in 0i
  779. .sp 2
  780. .ne 20
  781. .ps +3
  782. .vs +3
  783. FT_FREADLN()    Read a line from the currently selected text file
  784. .br
  785. .ta
  786. .in 0.08i
  787. .ps -3
  788. .vs -3
  789. .sp 2
  790. \fBFT_FREADLN()
  791. Read a line from the currently selected text file
  792. .in 0i
  793. .br
  794. \l'6.24i'
  795. .br
  796. .sp
  797. .in 0.08i
  798. \fBSyntax
  799. .sp
  800. .in 0.4i
  801. \fBFT_FREADLIN() -> cLine
  802. .sp
  803. .in 0.08i
  804. \fBArguments
  805. .sp
  806. .in 0.4i
  807. None
  808. .sp
  809. .in 0.08i
  810. \fBReturns
  811. .sp
  812. .in 0.4i
  813. A string containing the current record in a text file\.
  814. .sp
  815. .in 0.08i
  816. \fBDescription
  817. .sp
  818. .in 0.4i
  819. This function returns a line of text read from the file in the
  820. currently selected text file workarea\.  Text lines are delimited
  821. with a CRLF pair\.  The record pointer is not moved\.
  822. .sp
  823. A text file "record" is a line of text terminated by a CRLF pair\.
  824. .sp
  825. .in 0.08i
  826. \fBExamples
  827. .sp
  828. .in 0.4i
  829. .br
  830. // display each record of a text file
  831. .br
  832. FT_FUSE( "text\.c" )
  833. .br
  834. DO WHILE ! FT_FEOF()
  835. .in 0.64i
  836. .br
  837. ? FT_FREADLN()
  838. .br
  839. FT_FSKIP()
  840. .in 0.4i
  841. .br
  842. ENDDO
  843. .sp
  844. .in 0.08i
  845. \fBSource:\fR FTTEXT\.C
  846. .sp
  847. \fBAuthor:\fR Brice de Ganahl
  848. .in 0i
  849. .sp
  850. .in 1.5i
  851. .ti -1.5i
  852. .ta 1.5i
  853. .ft B
  854. See Also:    
  855. .ft R
  856. FT_FUSE()
  857. , FT_FRECNO()
  858. , FT_FGOTOP()
  859. , FT_FGOBOT()
  860. .ta 1.63265i
  861. .in 0i
  862. .sp 2
  863. .ne 20
  864. .ps +3
  865. .vs +3
  866. FT_FRECNO()    Return the current record number of a text file
  867. .br
  868. .ta
  869. .in 0.08i
  870. .ps -3
  871. .vs -3
  872. .sp 2
  873. \fBFT_FRECNO()
  874. Return the current record number of a text file
  875. .in 0i
  876. .br
  877. \l'6.24i'
  878. .br
  879. .sp
  880. .in 0.08i
  881. \fBSyntax
  882. .sp
  883. .in 0.4i
  884. \fBFT_FRECNO() -> nRecNo
  885. .sp
  886. .in 0.08i
  887. \fBArguments
  888. .sp
  889. .in 0.4i
  890. None
  891. .sp
  892. .in 0.08i
  893. \fBReturns
  894. .sp
  895. .in 0.4i
  896. The current record number of a text file or 0 if no file is open\.
  897. .sp
  898. .in 0.08i
  899. \fBDescription
  900. .sp
  901. .in 0.4i
  902. This function returns the current record number of the file open
  903. in the currently selected text file workarea\.
  904. .sp
  905. A text file "record" is a line of text terminated by a CRLF pair\.
  906. .sp
  907. .in 0.08i
  908. \fBExamples
  909. .sp
  910. .in 0.4i
  911. .ta 2i
  912. .br
  913. FT_FUSE( "text\.c" )    // open text file
  914. .br
  915. .ta
  916. .br
  917. DO WHILE !FT_FEOF()
  918. .in 0.64i
  919. .ta 1.76i
  920. .br
  921. ? FT_FREADLN()    // read thru file
  922. .br
  923. .ta
  924. .br
  925. FT_FSKIP()
  926. .in 0.4i
  927. .br
  928. ENDDO
  929. .ta 2i
  930. .br
  931. FT_FGOTOP()    // go back to top
  932. .br
  933. .ta
  934. .ta 2i
  935. .br
  936. ? FT_FRECNO()    // 1
  937. .br
  938. .ta
  939. .sp
  940. .in 0.08i
  941. \fBSource:\fR FTTEXT\.C
  942. .sp
  943. \fBAuthor:\fR Brice de Ganahl
  944. .in 0i
  945. .sp
  946. .in 1.5i
  947. .ti -1.5i
  948. .ta 1.5i
  949. .ft B
  950. See Also:    
  951. .ft R
  952. FT_FSELECT()
  953. , FT_FUSE()
  954. , FT_FGOTOP()
  955. , FT_FGOBOT()
  956. .ta 1.63265i
  957. .in 0i
  958. .sp 2
  959. .ne 20
  960. .ps +3
  961. .vs +3
  962. FT_FSELECT()    Select a text file workarea
  963. .br
  964. .ta
  965. .in 0.08i
  966. .ps -3
  967. .vs -3
  968. .sp 2
  969. \fBFT_FSELECT()
  970. Select a text file workarea
  971. .in 0i
  972. .br
  973. \l'6.24i'
  974. .br
  975. .sp
  976. .in 0.08i
  977. \fBSyntax
  978. .sp
  979. .in 0.4i
  980. \fBFT_FSELECT( <nArea> ) -> nArea
  981. .sp
  982. .in 0.08i
  983. \fBArguments
  984. .sp
  985. .in 0.4i
  986. \fB<nArea>\fR is the text file workarea to select\.
  987. .sp
  988. .in 0.08i
  989. \fBReturns
  990. .sp
  991. .in 0.4i
  992. The current selected text file area if no parameter is passed,
  993. otherwise the previous area if a new area is selected\.
  994. .sp
  995. .in 0.08i
  996. \fBDescription
  997. .sp
  998. .in 0.4i
  999. This function selects a text file "workarea" from 1 to 10\.  A
  1000. file may or may not be open in the selected area\.
  1001. .sp
  1002. Each file is opened in its own "workarea", similar to the concept
  1003. used by dbf files\.  As provided, a maximum of 10 files (in 10
  1004. workareas) can be opened (assuming there are sufficient file
  1005. handles available)\.  That number may be increased by modifying
  1006. the #define TEXT_WORKAREAS in the C source code and recompiling\.
  1007. .sp
  1008. All the FT_F*() file functions operate on the file in the currently
  1009. selected text file workarea\.
  1010. .sp
  1011. Text file workareas are separate from and independent of Clipper\'s
  1012. database workareas\.
  1013. .sp
  1014. .in 0.08i
  1015. \fBExamples
  1016. .sp
  1017. .in 0.4i
  1018. .br
  1019. FT_FSELECT(1)
  1020. .br
  1021. nFile1 := FT_FUSE( "temp\.c" )
  1022. .ta 2.56i
  1023. .br
  1024. ? FT_FLASTREC()    // no\. of lines in temp\.c
  1025. .br
  1026. .ta
  1027. .br
  1028. FT_FSELECT(2)
  1029. .br
  1030. nFile2 := FT_FUSE( "temp\.h" )
  1031. .ta 2.56i
  1032. .br
  1033. ? FT_FLASTREC()    // no\. of lines in temp\.h
  1034. .br
  1035. .ta
  1036. .sp
  1037. .in 0.08i
  1038. \fBSource:\fR FTTEXT\.C
  1039. .sp
  1040. \fBAuthor:\fR Brice de Ganahl
  1041. .in 0i
  1042. .sp
  1043. .in 1.5i
  1044. .ti -1.5i
  1045. .ta 1.5i
  1046. .ft B
  1047. See Also:    
  1048. .ft R
  1049. FT_FUSE()
  1050. .ta 1.63265i
  1051. .in 0i
  1052. .sp 2
  1053. .ne 20
  1054. .ps +3
  1055. .vs +3
  1056. FT_FSKIP()    Move the record pointer to a new position in a text file
  1057. .br
  1058. .ta
  1059. .in 0.08i
  1060. .ps -3
  1061. .vs -3
  1062. .sp 2
  1063. \fBFT_FSKIP()
  1064. Move the record pointer to a new position in a text file
  1065. .in 0i
  1066. .br
  1067. \l'6.24i'
  1068. .br
  1069. .sp
  1070. .in 0.08i
  1071. \fBSyntax
  1072. .sp
  1073. .in 0.4i
  1074. \fBFT_FSKIP( [ <nLines> ] ) -> NIL
  1075. .sp
  1076. .in 0.08i
  1077. \fBArguments
  1078. .sp
  1079. .in 0.4i
  1080. \fB<nLines>\fR is the number of lines to skip\.  Defaults to 1 if
  1081. not specified\.
  1082. .sp
  1083. .in 0.08i
  1084. \fBReturns
  1085. .sp
  1086. .in 0.4i
  1087. NIL
  1088. .sp
  1089. .in 0.08i
  1090. \fBDescription
  1091. .sp
  1092. .in 0.4i
  1093. This function moves the text file record pointer, similar to
  1094. the CLIPPER SKIP command\.
  1095. .sp
  1096. A text file "record" is a line of text terminated by a CRLF pair\.
  1097. .sp
  1098. .in 0.08i
  1099. \fBExamples
  1100. .sp
  1101. .in 0.4i
  1102. .br
  1103. // display each record of a text file
  1104. .br
  1105. FT_FUSE( "text\.c" )
  1106. .br
  1107. DO WHILE ! FT_FEOF()
  1108. .in 0.64i
  1109. .br
  1110. ? FT_FREADLN()
  1111. .br
  1112. FT_FSKIP()
  1113. .in 0.4i
  1114. .br
  1115. ENDDO
  1116. .sp
  1117. .in 0.08i
  1118. \fBSource:\fR FTTEXT\.C
  1119. .sp
  1120. \fBAuthor:\fR Brice de Ganahl
  1121. .in 0i
  1122. .sp
  1123. .in 1.5i
  1124. .ti -1.5i
  1125. .ta 1.5i
  1126. .ft B
  1127. See Also:    
  1128. .ft R
  1129. FT_FRECNO()
  1130. , FT_FGOTOP()
  1131. , FT_FGOBOT()
  1132. .ta 1.63265i
  1133. .in 0i
  1134. .sp 2
  1135. .ne 20
  1136. .ps +3
  1137. .vs +3
  1138. FT_FUSE()    Open or close a text file for use by the FT_F* functions
  1139. .br
  1140. .ta
  1141. .in 0.08i
  1142. .ps -3
  1143. .vs -3
  1144. .sp 2
  1145. \fBFT_FUSE()
  1146. Open or close a text file for use by the FT_F* functions
  1147. .in 0i
  1148. .br
  1149. \l'6.24i'
  1150. .br
  1151. .sp
  1152. .in 0.08i
  1153. \fBSyntax
  1154. .sp
  1155. .in 0.4i
  1156. \fBFT_FUSE( [ <cFile> ] ) -> nHandle | NIL
  1157. .sp
  1158. .in 0.08i
  1159. \fBArguments
  1160. .sp
  1161. .in 0.4i
  1162. \fB<cFile>\fR is the text file you want to open\.  If not specified,
  1163. the file currently open, if any, will be closed\.
  1164. .sp
  1165. .in 0.08i
  1166. \fBReturns
  1167. .sp
  1168. .in 0.4i
  1169. If <cFile> is passed and the file is opened successfully, an
  1170. integer containing the file handle\.  If the file cannot be
  1171. opened, -1 will be returned\.
  1172. .sp
  1173. If FT_FUSE() is called without any arguments, it will close the
  1174. text file in the current "text area" and return NIL\.
  1175. .sp
  1176. .in 0.08i
  1177. \fBDescription
  1178. .sp
  1179. .in 0.4i
  1180. The FT_F*() file functions are for reading text files, that is,
  1181. files where each line (record) is delimited by a CRLF pair\.
  1182. .sp
  1183. Each file is opened in its own "workarea", similar to the concept
  1184. use by dbf files\.  As provided, a maximum of 10 files (in 10
  1185. workareas) can be opened (assuming there are sufficient file
  1186. handles available)\.  That number may be increased by modifying
  1187. the #define TEXT_WORKAREAS in the C source code and recompiling\.
  1188. .sp
  1189. .in 0.08i
  1190. \fBExamples
  1191. .sp
  1192. .in 0.4i
  1193. .ta 2i
  1194. .br
  1195. FT_FUSE( "text\.c" )    // open text file
  1196. .br
  1197. .ta
  1198. .br
  1199. DO WHILE !FT_FEOF()
  1200. .in 0.64i
  1201. .br
  1202. ? FT_FREADLN()
  1203. .br
  1204. FT_FSKIP()
  1205. .in 0.4i
  1206. .br
  1207. ENDDO
  1208. .ta 2i
  1209. .br
  1210. FT_FUSE()    // close file
  1211. .br
  1212. .ta
  1213. .sp
  1214. .in 0.08i
  1215. \fBSource:\fR FTTEXT\.C
  1216. .sp
  1217. \fBAuthor:\fR Brice de Ganahl
  1218. .in 0i
  1219. .sp
  1220. .in 1.5i
  1221. .ti -1.5i
  1222. .ta 1.5i
  1223. .ft B
  1224. See Also:    
  1225. .ft R
  1226. FT_FUSE()
  1227. , FT_FSELECT()
  1228.