home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / CLIPPER / NFTROFF / 1.TR next >
Text File  |  1993-12-01  |  18KB  |  1,123 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_AADDITION()    Add elements unique of source array to target array
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_AADDITION()
  25. Add elements unique of source array to target array
  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_AADDITION( <aList1>, <aList2> [, <lTrimmer> [, <lCaseSens> ] ] ) ;
  36. .in 1.04i
  37. \fB-> aNewArray
  38. .sp
  39. .in 0.08i
  40. \fBArguments
  41. .sp
  42. .in 0.4i
  43. \fB<aList1>\fR is the primary array\.
  44. .sp
  45. \fB<aList2>\fR is the secondary array\.
  46. .sp
  47. \fB<lTrimmer>\fR is a logical value denoting whether leading or
  48. .in 1.04i
  49. trailing spaces should be included in the
  50. comparison\. If \.T\., then ignores spaces in
  51. comparison, defaults to \.T\., \.F\. includes spaces\.
  52. .sp
  53. .in 0.4i
  54. \fB<lCaseSens>\fR is a logical value denoting case sensitivity\.
  55. .in 1.04i
  56. If \.T\., then comparison is sensitive to case,
  57. defaults to \.T\., \.F\. ignores case\.
  58. .sp
  59. .in 0.08i
  60. \fBReturns
  61. .sp
  62. .in 0.4i
  63. An array of the union of aList1 and aList2\.
  64. .sp
  65. .in 0.08i
  66. \fBDescription
  67. .sp
  68. .in 0.4i
  69. This function will add the elements unique of aList2 with aList1\.
  70. It returns a new array including all the elements of aList1
  71. plus the unique elements of aList2\.
  72. .sp
  73. .in 0.08i
  74. \fBExamples
  75. .sp
  76. .in 0.4i
  77. .br
  78. aList1 := {"apple", "orange", "pear"}
  79. .br
  80. aList2 := {"apple ", "banana", "PEAR"}
  81. .sp
  82. .br
  83. FT_AADDITION( aList1, aList2 )
  84. .in 0.8i
  85. .br
  86. // ignores spaces, sensitive to case
  87. .br
  88. // returns {"apple","orange","pear","banana","PEAR"}
  89. .sp
  90. .in 0.4i
  91. .br
  92. FT_AADDITION( aList1, aList2, , \.F\. )
  93. .in 0.8i
  94. .br
  95. // ignores spaces, not sensitive to case
  96. .br
  97. // returns {"apple","orange","pear","banana"}
  98. .sp
  99. .in 0.4i
  100. .br
  101. FT_AADDITION( aList1, aList2, \.F\., \.F\. )
  102. .in 0.8i
  103. .br
  104. // sensitive to spaces, not sensitive to case
  105. .br
  106. // returns {"apple","orange","pear","apple ","banana"}
  107. .sp
  108. .in 0.08i
  109. \fBSource:\fR AADING\.PRG
  110. .sp
  111. .ta 1.84i
  112. \fBAuthor:\fR Ralph Oliver,    TRANSCOM SYSTEMS
  113. .br
  114. .ta
  115. .in 0i
  116. .ta 1.63265i
  117. .sp 2
  118. .ne 20
  119. .ps +3
  120. .vs +3
  121. FT_AAVG()    Average numeric values in an array
  122. .br
  123. .ta
  124. .in 0.08i
  125. .ps -3
  126. .vs -3
  127. .sp 2
  128. \fBFT_AAVG()
  129. Average numeric values in an array
  130. .in 0i
  131. .br
  132. \l'6.24i'
  133. .br
  134. .sp
  135. .in 0.08i
  136. \fBSyntax
  137. .sp
  138. .in 0.4i
  139. \fBFT_AAVG( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nAverage
  140. .sp
  141. .in 0.08i
  142. \fBArguments
  143. .sp
  144. .in 0.4i
  145. \fB<aArray>\fR is the array containing the elements to be averaged\.
  146. .sp
  147. \fB<nStartIndex>\fR is the first array item to include,
  148. defaults to first element\.
  149. .sp
  150. \fB<nEndIndex>\fR is the last array element to include,
  151. defaults to all elements\.
  152. .sp
  153. .in 0.08i
  154. \fBReturns
  155. .sp
  156. .in 0.4i
  157. The average of the specified array elements\.
  158. .sp
  159. .in 0.08i
  160. \fBDescription
  161. .sp
  162. .in 0.4i
  163. This function is used to get a numeric average of selected or all
  164. elements of an array\.
  165. .sp
  166. This routine requires FT_ASUM()\.
  167. .sp
  168. .in 0.08i
  169. \fBExamples
  170. .sp
  171. .in 0.4i
  172. .ta 2.32i
  173. FT_AAVG(aSubTotals)    // Get Average of Entire Array
  174. .br
  175. .ta
  176. .sp
  177. .ta 2.32i
  178. FT_AAVG(aSubTotals, 5)    // Get Average of 5th Element On
  179. .br
  180. .ta
  181. .sp
  182. .ta 2.32i
  183. FT_AAVG(aSubTotals, , 10)    // Get Average of 1st 10 Elements
  184. .br
  185. .ta
  186. .sp
  187. .ta 2.32i
  188. FT_AAVG(aSubTotals, 5, 10)    // Get Average of Elements 5-10
  189. .br
  190. .ta
  191. .sp
  192. .in 0.08i
  193. \fBSource:\fR AAVG\.PRG
  194. .sp
  195. \fBAuthor:\fR David Husnian
  196. .in 0i
  197. .ta 1.63265i
  198. .sp 2
  199. .ne 20
  200. .ps +3
  201. .vs +3
  202. FT_ADESSORT()    Sort an array in descending order
  203. .br
  204. .ta
  205. .in 0.08i
  206. .ps -3
  207. .vs -3
  208. .sp 2
  209. \fBFT_ADESSORT()
  210. Sort an array in descending order
  211. .in 0i
  212. .br
  213. \l'6.24i'
  214. .br
  215. .sp
  216. .in 0.08i
  217. \fBSyntax
  218. .sp
  219. .in 0.4i
  220. \fBFT_ADESSORT( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> aSorted
  221. .sp
  222. .in 0.08i
  223. \fBArguments
  224. .sp
  225. .in 0.4i
  226. \fB<aArray>\fR is the array to be sorted
  227. .sp
  228. \fB<nStartIndex>\fR is the first array item to include in the sort,
  229. defaults to first element
  230. .sp
  231. \fB<nEndIndex>\fR is the last array element to include in the sort,
  232. defaults to all elements
  233. .sp
  234. .in 0.08i
  235. \fBReturns
  236. .sp
  237. .in 0.4i
  238. The array, sorted in descending order\.
  239. .sp
  240. .in 0.08i
  241. \fBDescription
  242. .sp
  243. .in 0.4i
  244. This function is used to sort an array in descending order, i\.e\., Z-A
  245. .sp
  246. .in 0.08i
  247. \fBExamples
  248. .sp
  249. .in 0.4i
  250. .ta 2.72i
  251. FT_ADESSORT(aNames)    // Sort the Entire Array
  252. .br
  253. .ta
  254. .sp
  255. .ta 2.72i
  256. FT_ADESSORT(aNames, 5)    // Sort from the 5th Element On
  257. .br
  258. .ta
  259. .sp
  260. .ta 2.72i
  261. FT_ADESSORT(aNames, , 10)    // Sort the 1st 10 Elements
  262. .br
  263. .ta
  264. .sp
  265. .ta 2.72i
  266. FT_ADESSORT(aNames, 5, 10)    // Sort Elements 5-10
  267. .br
  268. .ta
  269. .sp
  270. .in 0.08i
  271. \fBSource:\fR ADESSORT\.PRG
  272. .sp
  273. \fBAuthor:\fR David Husnian
  274. .in 0i
  275. .ta 1.63265i
  276. .sp 2
  277. .ne 20
  278. .ps +3
  279. .vs +3
  280. FT_AEMAXLEN()    Find longest element within an array
  281. .br
  282. .ta
  283. .in 0.08i
  284. .ps -3
  285. .vs -3
  286. .sp 2
  287. \fBFT_AEMAXLEN()
  288. Find longest element within an array
  289. .in 0i
  290. .br
  291. \l'6.24i'
  292. .br
  293. .sp
  294. .in 0.08i
  295. \fBSyntax
  296. .sp
  297. .in 0.4i
  298. \fBFT_AEMAXLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) ;
  299. .in 1.28i
  300. \fB-> nMaxlen
  301. .sp
  302. .in 0.08i
  303. \fBArguments
  304. .sp
  305. .in 0.4i
  306. \fB<aArray>\fR is the array containing the elements to be measured\.
  307. .sp
  308. \fB<nDimension>\fR is the array dimension to be measured,
  309. .in 1.28i
  310. defaults to first dimension\.
  311. .sp
  312. .in 0.4i
  313. \fB<nStart>\fR is the starting array element to include,
  314. .in 1.28i
  315. defaults to first array element\.
  316. .sp
  317. .in 0.4i
  318. \fB<nCount>\fR is the number of array elements to process from
  319. .in 1.28i
  320. from \fB<nStart>\fR, defaults to remaining elements
  321. in array\.
  322. .sp
  323. .in 0.08i
  324. \fBReturns
  325. .sp
  326. .in 0.4i
  327. The length of the longest size element of an array\.
  328. .sp
  329. .in 0.08i
  330. \fBDescription
  331. .sp
  332. .in 0.4i
  333. This function will measure each element of an array
  334. dimension and return the longest element\.
  335. .sp
  336. .in 0.08i
  337. \fBExamples
  338. .sp
  339. .in 0.4i
  340. .ta 2.08i
  341. FT_AEMAXLEN(aArray)    // Measure the 1st dimension of an Array
  342. .br
  343. .ta
  344. .sp
  345. .ta 2.08i
  346. FT_AEMAXLEN(aArray,2)    // Measure the 2nd dimension of an Array
  347. .br
  348. .ta
  349. .sp
  350. .ta 2.08i
  351. FT_AEMAXLEN(aArray,2,,9)    // Measure Elements 1-9 of the
  352. .br
  353. .ta
  354. .in 2.96i
  355. 2nd dimension or subarray
  356. .sp
  357. .in 0.4i
  358. FT_AEMAXLEN(aArray,3,5,9) // Measure Elements 5-9 of the
  359. .in 2.96i
  360. 3rd dimension or subarray
  361. .sp
  362. .in 0.4i
  363. .ta 2.08i
  364. FT_AEMAXLEN(aArray,3,5)    // Measure Elements 5 to last in the
  365. .br
  366. .ta
  367. .in 2.96i
  368. 3rd dimension or subarray
  369. .sp
  370. .in 0.08i
  371. \fBSource:\fR AEMAXLEN\.PRG
  372. .sp
  373. .ta 1.84i
  374. \fBAuthor:\fR Ralph Oliver,    TRANSCOM SYSTEMS
  375. .br
  376. .ta
  377. .in 0i
  378. .sp
  379. .in 1.5i
  380. .ti -1.5i
  381. .ta 1.5i
  382. .ft B
  383. See Also:    
  384. .ft R
  385. FT_AEMINLEN()
  386. .ta 1.63265i
  387. .in 0i
  388. .sp 2
  389. .ne 20
  390. .ps +3
  391. .vs +3
  392. FT_AEMINLEN()    Find shortest element within an array
  393. .br
  394. .ta
  395. .in 0.08i
  396. .ps -3
  397. .vs -3
  398. .sp 2
  399. \fBFT_AEMINLEN()
  400. Find shortest element within an array
  401. .in 0i
  402. .br
  403. \l'6.24i'
  404. .br
  405. .sp
  406. .in 0.08i
  407. \fBSyntax
  408. .sp
  409. .in 0.4i
  410. \fBFT_AEMINLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] )
  411. .in 1.28i
  412. \fB-> nMinlen
  413. .sp
  414. .in 0.08i
  415. \fBArguments
  416. .sp
  417. .in 0.4i
  418. \fB<aArray>\fR is the array containing the elements to be measured\.
  419. .sp
  420. \fB<nDimension>\fR is the array dimension to be measured,
  421. .in 1.28i
  422. defaults to first dimension\.
  423. .sp
  424. .in 0.4i
  425. \fB<nStart>\fR is the starting array element to include,
  426. .in 1.28i
  427. defaults to first array element\.
  428. .sp
  429. .in 0.4i
  430. \fB<nCount>\fR is the number of array elements to process from
  431. .in 1.28i
  432. from \fB<nStart>\fR, defaults to remaining elements
  433. in array\.
  434. .sp
  435. .in 0.08i
  436. \fBReturns
  437. .sp
  438. .in 0.4i
  439. The length of the shortest size element of an array\.
  440. .sp
  441. .in 0.08i
  442. \fBDescription
  443. .sp
  444. .in 0.4i
  445. This function will measure each element of an array
  446. dimension and return the shortest element\.
  447. .sp
  448. .in 0.08i
  449. \fBExamples
  450. .sp
  451. .in 0.4i
  452. .ta 2.08i
  453. FT_AEMINLEN(aArray)    // Measure the 1st dimension of an Array
  454. .br
  455. .ta
  456. .sp
  457. .ta 2.08i
  458. FT_AEMINLEN(aArray,2)    // Measure the 2nd dimension of an Array
  459. .br
  460. .ta
  461. .sp
  462. .ta 2.08i
  463. FT_AEMINLEN(aArray,2,,9)    // Measure Elements 1-9 of 2nd dimension
  464. .br
  465. .ta
  466. .sp
  467. FT_AEMINLEN(aArray,3,5,9) // Measure Elements 5-9 of 3rd dimension
  468. .sp
  469. .ta 2.08i
  470. FT_AEMINLEN(aArray,3,5)    // Measure Elements 5 to end of 3rd dimension
  471. .br
  472. .ta
  473. .sp
  474. .in 0.08i
  475. \fBSource:\fR AEMINLEN\.PRG
  476. .sp
  477. .ta 1.84i
  478. \fBAuthor:\fR Ralph Oliver,    TRANSCOM SYSTEMS
  479. .br
  480. .ta
  481. .in 0i
  482. .sp
  483. .in 1.5i
  484. .ti -1.5i
  485. .ta 1.5i
  486. .ft B
  487. See Also:    
  488. .ft R
  489. FT_AEMAXLEN()
  490. .ta 1.63265i
  491. .in 0i
  492. .sp 2
  493. .ne 20
  494. .ps +3
  495. .vs +3
  496. FT_AMEDIAN()    Find middle value in array, or average of two middle values
  497. .br
  498. .ta
  499. .in 0.08i
  500. .ps -3
  501. .vs -3
  502. .sp 2
  503. \fBFT_AMEDIAN()
  504. Find middle value in array, or average of two middle values
  505. .in 0i
  506. .br
  507. \l'6.24i'
  508. .br
  509. .sp
  510. .in 0.08i
  511. \fBSyntax
  512. .sp
  513. .in 0.4i
  514. \fBFT_AMEDIAN( <aArray> [, <nStart> [, <nEnd> ] ] )
  515. .in 1.28i
  516. \fB-> nMedian
  517. .sp
  518. .in 0.08i
  519. \fBArguments
  520. .sp
  521. .in 0.4i
  522. \fB<aArray>\fR is the array containing the elements to be averaged\.
  523. .sp
  524. \fB<nStart>\fR is the first array element to include,
  525. defaults to first element\.
  526. .sp
  527. \fB<nEnd>\fR is the last array element to include,
  528. defaults to last element\.
  529. .sp
  530. .in 0.08i
  531. \fBReturns
  532. .sp
  533. .in 0.4i
  534. The median average of the array elements
  535. .sp
  536. .in 0.08i
  537. \fBDescription
  538. .sp
  539. .in 0.4i
  540. This function sorts the elements of a numeric array and
  541. then returns the value in the middle element of the sorted
  542. array\.  If there is no exact middle value, then it returns
  543. the average of the two middle values\.  Half of the elements
  544. are > median and half are < median\.  A median average may
  545. more reflect a more useful average when there are extreme
  546. values in the set\.
  547. .sp
  548. .in 0.08i
  549. \fBExamples
  550. .sp
  551. .in 0.4i
  552. .ta 2.08i
  553. FT_AMEDIAN( aArray )    // Return Median for entire array
  554. .br
  555. .ta
  556. .sp
  557. .ta 2.08i
  558. FT_AMEDIAN( aArray, 2)    // Return Median for elements from 2 to end
  559. .br
  560. .ta
  561. .sp
  562. .ta 2.08i
  563. FT_AMEDIAN( aArray, ,9)    // Return Median for 1st 9 elements
  564. .br
  565. .ta
  566. .sp
  567. FT_AMEDIAN( aArray,8,40 ) // Return Median for elements 8 to 40
  568. .sp
  569. .in 0.08i
  570. \fBSource:\fR AMEDIAN\.PRG
  571. .sp
  572. .ta 1.84i
  573. \fBAuthor:\fR Ralph Oliver,    TRANSCOM SYSTEMS
  574. .br
  575. .ta
  576. .in 0i
  577. .sp 2
  578. .ne 20
  579. .ps +3
  580. .vs +3
  581. FT_ANOMATCHES() Find the number of array elements meeting a condition
  582. .br
  583. .in 0.08i
  584. .ps -3
  585. .vs -3
  586. .sp 2
  587. \fBFT_ANOMATCHES()
  588. Find the number of array elements meeting a condition
  589. .in 0i
  590. .br
  591. \l'6.24i'
  592. .br
  593. .sp
  594. .in 0.08i
  595. \fBSyntax
  596. .sp
  597. .in 0.4i
  598. \fBFT_ANOMATCHES( <aArray>, <bCompareBlock> ;
  599. .in 1.6i
  600. \fB[, <nStartIndex> [, <nEndIndex> ] ] ) -> nNoOfMatches
  601. .sp
  602. .in 0.08i
  603. \fBArguments
  604. .sp
  605. .in 0.4i
  606. \fB<aArray>\fR is the array to be searched
  607. .sp
  608. \fB<bCompareBlock>\fR is a code block containing the expression for
  609. the array elements to be tested with\.  Each element is passed
  610. as a parameter to the block\.  If the block returns \.T\., the
  611. number of matches will be incremented by one\.
  612. .sp
  613. \fB<nStartIndex>\fR is the first array item to include in the search,
  614. defaults to first element\.
  615. .sp
  616. \fB<nEndIndex>\fR is the last array element to include in the search,
  617. defaults to all elements\.
  618. .sp
  619. .in 0.08i
  620. \fBReturns
  621. .sp
  622. .in 0.4i
  623. The number of elements that cause the code block to return \.T\.
  624. .sp
  625. .in 0.08i
  626. \fBDescription
  627. .sp
  628. .in 0.4i
  629. This function returns the number of array elements that, when passed
  630. to the supplied code block, cause that code block to return a \.T\. value\.
  631. .sp
  632. .in 0.08i
  633. \fBExamples
  634. .sp
  635. .in 0.4i
  636. .br
  637. // Search the Entire Array
  638. .br
  639. FT_ANOMATCHES(aTries, { | x | x <= 100 } )
  640. .sp
  641. .br
  642. // Search from the 5th Element On
  643. .br
  644. FT_ANOMATCHES(aCodes, { | x | UPPER(x) == cCurrentCode }, 5)
  645. .sp
  646. .br
  647. // Search the 1st 10 Elements
  648. .br
  649. FT_ANOMATCHES(aDates, { | x | IS_BETWEEN(DATE()-7,x,DATE() + 7) }, 10)
  650. .sp
  651. .br
  652. // Search Elements 5-10
  653. .br
  654. FT_ANOMATCHES(aNames, { | x | x <= cLastGoodName }, 5, 10)
  655. .sp
  656. .in 0.08i
  657. \fBSource:\fR ANOMATCH\.PRG
  658. .sp
  659. \fBAuthor:\fR David Husnian
  660. .in 0i
  661. .ta 1.63265i
  662. .sp 2
  663. .ne 20
  664. .ps +3
  665. .vs +3
  666. FT_AREDIT()    2 dimensional array editing function using TBrowse
  667. .br
  668. .ta
  669. .in 0.08i
  670. .ps -3
  671. .vs -3
  672. .sp 2
  673. \fBFT_AREDIT()
  674. 2 dimensional array editing function using TBrowse
  675. .in 0i
  676. .br
  677. \l'6.24i'
  678. .br
  679. .sp
  680. .in 0.08i
  681. \fBSyntax
  682. .sp
  683. .in 0.4i
  684. \fBFT_AREDIT( <nTop>, <nLeft>, <nBottom>, <nRight>, <Array Name>, ;
  685. .in 0.64i
  686. \fB<nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) -> xElement
  687. .sp
  688. .in 0.08i
  689. \fBArguments
  690. .sp
  691. .in 0.4i
  692. \fB<nTop>\fR, \fB<nLeft>\fR, \fB<nBottom>\fR, \fB<nRight>\fR are coordinates for TBrowse
  693. .sp
  694. \fB<Array Name>\fR is name of 2 dimensional to array edit
  695. .sp
  696. .ta 1.04i
  697. \fB<nElem>\fR    is pointer for element in array
  698. .br
  699. .ta
  700. .sp
  701. .ta 1.04i
  702. \fB<aHeadings>\fR    is array of column headings
  703. .br
  704. .ta
  705. .sp
  706. .ta 1.04i
  707. \fB<aBlocks>\fR    is array of blocks describing each array element
  708. .br
  709. .ta
  710. .sp
  711. [ \fB<bGetFunc>\fR ] is get editing function for handling individual elements
  712. .sp
  713. .in 0.08i
  714. \fBReturns
  715. .sp
  716. .in 0.4i
  717. Value of element positioned on when exit FT_AREDIT()
  718. The type of this value depends on what is displayed\.
  719. .sp
  720. .in 0.08i
  721. \fBDescription
  722. .sp
  723. .in 0.4i
  724. This function allows you to position yourself in an array,
  725. add and delete rows with the <F7> and <F8> keys,
  726. and pass a UDF with information to edit the individual gets\.
  727. .sp
  728. .in 0.08i
  729. \fBExamples
  730. .sp
  731. .in 0.48i
  732. FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks)
  733. .sp
  734. This example will allow you to browse a 2 dimensional array
  735. But you can\'t edit it since there is no GetBlock UDF
  736. It allows the user to hit ENTER to select an element or ESC to
  737. return 0
  738. .sp
  739. .br
  740. * This second example shows how to edit a 2 dimensional array
  741. .br
  742. * as might be done to edit an invoice
  743. .sp
  744. .in 0.96i
  745. .br
  746. LOCAL i, ar[3, 26], aBlocks[3], aHeadings[3]
  747. .br
  748. LOCAL nElem := 1, bGetFunc
  749. .sp
  750. .in 0.48i
  751. .br
  752. * Set up two dimensional array "ar"
  753. .sp
  754. .in 0.96i
  755. .br
  756. FOR i = 1 TO 26
  757. .in 1.2i
  758. .ta 1.84i 2.16i 2.4i 2.72i 3.04i
  759. .br
  760. ar[1, i] := i    //    1    ->    26    Numeric
  761. .br
  762. .ta
  763. .ta 1.84i 3.04i
  764. .br
  765. ar[2, i] := CHR(i+64)    // "A" -> "Z"    Character
  766. .br
  767. .ta
  768. .ta 1.84i 3.04i
  769. .br
  770. ar[3, i] := CHR(91-i)    // "Z" -> "A"    Character
  771. .br
  772. .ta
  773. .in 1.04i
  774. .br
  775. NEXT i
  776. .sp
  777. .in 0.48i
  778. .br
  779. * SET UP aHeadings Array for column headings
  780. .sp
  781. .in 0.96i
  782. .ta 0.88i
  783. .br
  784. aHeadings    := { "Numbers", "Letters", "Reverse" }
  785. .br
  786. .ta
  787. .sp
  788. .in 0.48i
  789. .br
  790. * Need to set up individual array blocks for each TBrowse column
  791. .sp
  792. .in 0.64i
  793. .br
  794. aBlocks[1] := {|| STR(ar[1, nElem], 2) } // prevent default 10 spaces
  795. .br
  796. aBlocks[2] := {|| ar[2, nElem] }
  797. .br
  798. aBlocks[3] := {|| ar[3, nElem] }
  799. .sp
  800. .in 0.48i
  801. .br
  802. * set up TestGet() as the passed Get Function so FT_ArEdit knows how
  803. .br
  804. * to edit the individual gets\.
  805. .sp
  806. .in 0.64i
  807. .ta 0.88i
  808. .br
  809. bGetFunc    := { | b, ar, nDim, nElem | TestGet(b, ar, nDim, nElem) }
  810. .br
  811. .ta
  812. .br
  813. SetColor( "N/W, W/N, , , W/N" )
  814. .br
  815. CLEAR SCREEN
  816. .br
  817. FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc)
  818. .sp
  819. .sp
  820. .in 0.08i
  821. \fBSource:\fR AREDIT\.PRG
  822. .sp
  823. \fBAuthor:\fR James J\. Orlowski, M\.D\.
  824. .in 0i
  825. .ta 1.63265i
  826. .sp 2
  827. .ne 20
  828. .ps +3
  829. .vs +3
  830. FT_ASUM()    Sum the elements of an array
  831. .br
  832. .ta
  833. .in 0.08i
  834. .ps -3
  835. .vs -3
  836. .sp 2
  837. \fBFT_ASUM()
  838. Sum the elements of an array
  839. .in 0i
  840. .br
  841. \l'6.24i'
  842. .br
  843. .sp
  844. .in 0.08i
  845. \fBSyntax
  846. .sp
  847. .in 0.4i
  848. \fBFT_ASUM( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nSum
  849. .sp
  850. .in 0.08i
  851. \fBArguments
  852. .sp
  853. .in 0.4i
  854. \fB<aArray>\fR is the array containing the elements to be summed\.
  855. .sp
  856. \fB<nStartIndex>\fR is the first array item to include,
  857. defaults to first element\.
  858. .sp
  859. \fB<nEndIndex>\fR is the last array element to include,
  860. defaults to all elements\.
  861. .sp
  862. .in 0.08i
  863. \fBReturns
  864. .sp
  865. .in 0.4i
  866. The sum of the elements of the array or the lengths of the elements\.
  867. .sp
  868. .in 0.08i
  869. \fBDescription
  870. .sp
  871. .in 0.4i
  872. This function is to sum the elements of a numeric array or to sum the
  873. lengths of a character array\.
  874. .sp
  875. .in 0.08i
  876. \fBExamples
  877. .sp
  878. .sp
  879. .in 0.4i
  880. .ta 2.72i
  881. FT_ASUM(aSubTotals)    // Sum the Entire Array
  882. .br
  883. .ta
  884. .sp
  885. .ta 2.72i
  886. FT_ASUM(aSubTotals, 5)    // Sum from the 5th Element On
  887. .br
  888. .ta
  889. .sp
  890. .ta 2.72i
  891. FT_ASUM(aSubTotals, , 10)    // Sum the 1st 10 Elements
  892. .br
  893. .ta
  894. .sp
  895. .ta 2.72i
  896. FT_ASUM(aSubTotals, 5, 10)    // Sum Elements 5-10
  897. .br
  898. .ta
  899. .sp
  900. .in 0.08i
  901. \fBSource:\fR ASUM\.PRG
  902. .sp
  903. \fBAuthor:\fR David Husnian
  904. .in 0i
  905. .ta 1.63265i
  906. .sp 2
  907. .ne 20
  908. .ps +3
  909. .vs +3
  910. FT_RESTARR()    Restore a Clipper array from a disc file
  911. .br
  912. .ta
  913. .in 0.08i
  914. .ps -3
  915. .vs -3
  916. .sp 2
  917. \fBFT_RESTARR()
  918. Restore a Clipper array from a disc file
  919. .in 0i
  920. .br
  921. \l'6.24i'
  922. .br
  923. .sp
  924. .in 0.08i
  925. \fBSyntax
  926. .sp
  927. .in 0.4i
  928. \fBFT_RESTARR( <cFileName>, <nErrorCode> ) -> aArray
  929. .sp
  930. .in 0.08i
  931. \fBArguments
  932. .sp
  933. .in 0.4i
  934. \fB<cFileName>\fR is a DOS file name\.
  935. .sp
  936. \fB<nErrorCode>\fR will return any DOS file error\.
  937. .sp
  938. All arguments are required\.
  939. .sp
  940. .in 0.08i
  941. \fBReturns
  942. .sp
  943. .in 0.4i
  944. Return an array variable\.
  945. .sp
  946. .in 0.08i
  947. \fBDescription
  948. .sp
  949. .in 0.4i
  950. FT_RESTARR() restores an array which was saved to
  951. a disc file using FT_SAVEARR()\.
  952. .sp
  953. .sp
  954. .in 0.08i
  955. \fBExamples
  956. .sp
  957. .in 0.32i
  958. .br
  959. aArray := { {\'Invoice 1\',CTOD(\'04/15/91\'),1234\.32,\.T\.},;
  960. .in 1.28i
  961. .br
  962. {\'Invoice 2\',DATE(),234\.98,\.F\.},;
  963. .ta 2.56i
  964. .br
  965. {\'Invoice 3\',DATE() + 1,0,\.T\.}    }
  966. .br
  967. .ta
  968. .in 0.32i
  969. .br
  970. nErrorCode := 0
  971. .br
  972. FT_SAVEARR(aArray,\'INVOICE\.DAT\',@nErrorCode)
  973. .br
  974. IF nErrorCode = 0
  975. .in 0.48i
  976. .br
  977. aSave := FT_RESTARR(\'INVOICE\.DAT\',@nErrorCode)
  978. .br
  979. IF nErrorCode # 0
  980. .in 0.72i
  981. .br
  982. ? \'Error restoring array\'
  983. .in 0.48i
  984. .br
  985. ENDIF
  986. .in 0.32i
  987. .br
  988. ELSE
  989. .in 0.48i
  990. .br
  991. ? \'Error writing array\'
  992. .in 0.32i
  993. .br
  994. ENDIF
  995. .sp
  996. .sp
  997. .in 0.08i
  998. \fBSource:\fR SAVEARR\.PRG
  999. .sp
  1000. \fBAuthor:\fR David Barrett
  1001. .in 0i
  1002. .sp
  1003. .in 1.5i
  1004. .ti -1.5i
  1005. .ta 1.5i
  1006. .ft B
  1007. See Also:    
  1008. .ft R
  1009. FT_SAVEARR()
  1010. .ta 1.63265i
  1011. .in 0i
  1012. .sp 2
  1013. .ne 20
  1014. .ps +3
  1015. .vs +3
  1016. FT_SAVEARR()    Save Clipper array to a disc file\.
  1017. .br
  1018. .ta
  1019. .in 0.08i
  1020. .ps -3
  1021. .vs -3
  1022. .sp 2
  1023. \fBFT_SAVEARR()
  1024. Save Clipper array to a disc file\.
  1025. .in 0i
  1026. .br
  1027. \l'6.24i'
  1028. .br
  1029. .sp
  1030. .in 0.08i
  1031. \fBSyntax
  1032. .sp
  1033. .in 0.4i
  1034. \fBFT_SAVEARR( <aArray>, <cFileName>, <nErrorCode> ) -> lRet
  1035. .sp
  1036. .in 0.08i
  1037. \fBArguments
  1038. .sp
  1039. .in 0.4i
  1040. \fB<aArray>\fR is any Clipper array except those containing
  1041. compiled code blocks\.
  1042. .sp
  1043. \fB<cFileName>\fR is a DOS file name\.
  1044. .sp
  1045. \fB<nErrorCode>\fR will return any DOS file error\.
  1046. .sp
  1047. All arguments are required\.
  1048. .sp
  1049. .sp
  1050. .in 0.08i
  1051. \fBReturns
  1052. .sp
  1053. .in 0.4i
  1054. \.F\. if there was a DOS file error or the array contained
  1055. code blocks, otherwise returns \.T\.
  1056. .sp
  1057. .in 0.08i
  1058. \fBDescription
  1059. .sp
  1060. .in 0.4i
  1061. FT_SAVEARR() saves any Clipper array, except those
  1062. containing compiled code blocks, to a disc file\.  The
  1063. array can be restored from the disc file using
  1064. FT_RESTARR()\.
  1065. .sp
  1066. .sp
  1067. .in 0.08i
  1068. \fBExamples
  1069. .sp
  1070. .in 0.32i
  1071. .br
  1072. aArray := { {\'Invoice 1\',CTOD(\'04/15/91\'),1234\.32,\.T\.},;
  1073. .in 1.28i
  1074. .br
  1075. {\'Invoice 2\',DATE(),234\.98,\.F\.},;
  1076. .ta 2.56i
  1077. .br
  1078. {\'Invoice 3\',DATE() + 1,0,\.T\.}    }
  1079. .br
  1080. .ta
  1081. .in 0.32i
  1082. .br
  1083. nErrorCode := 0
  1084. .br
  1085. FT_SAVEARR(aArray,\'INVOICE\.DAT\',@nErrorCode)
  1086. .br
  1087. IF nErrorCode = 0
  1088. .in 0.48i
  1089. .br
  1090. aSave := FT_RESTARR(\'INVOICE\.DAT\',@nErrorCode)
  1091. .br
  1092. IF nErrorCode # 0
  1093. .in 0.72i
  1094. .br
  1095. ? \'Error restoring array\'
  1096. .in 0.48i
  1097. .br
  1098. ENDIF
  1099. .in 0.32i
  1100. .br
  1101. ELSE
  1102. .in 0.48i
  1103. .br
  1104. ? \'Error writing array\'
  1105. .in 0.32i
  1106. .br
  1107. ENDIF
  1108. .sp
  1109. .sp
  1110. .in 0.08i
  1111. \fBSource:\fR SAVEARR\.PRG
  1112. .sp
  1113. \fBAuthor:\fR David Barrett
  1114. .in 0i
  1115. .sp
  1116. .in 1.5i
  1117. .ti -1.5i
  1118. .ta 1.5i
  1119. .ft B
  1120. See Also:    
  1121. .ft R
  1122. FT_RESTARR()
  1123.