home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / CLIPPER / NFTROFF / 2.TR < prev    next >
Text File  |  1993-12-01  |  16KB  |  1,064 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_BYT2BIT()    Convert byte to string of 1\'s and 0\'s
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_BYT2BIT()
  25. Convert byte to string of 1\'s and 0\'s
  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_BYT2BIT( <cByte> ) -> cBitPattern
  36. .sp
  37. .in 0.08i
  38. \fBArguments
  39. .sp
  40. .in 0.4i
  41. \fB<cByte>\fR is the byte to convert\.
  42. .sp
  43. .in 0.08i
  44. \fBReturns
  45. .sp
  46. .in 0.4i
  47. 9-character string, consisting of 1\'s and 0\'s, representing bits 0
  48. through 7 of parameter byte, with space between bits 3 and 4\.  Returns
  49. NIL if parameters are faulty\.
  50. .sp
  51. .in 0.08i
  52. \fBDescription
  53. .sp
  54. .in 0.4i
  55. Can be used to show results of bit manipulation, both before and after\.
  56. Binary representation follows right-to-left convention of bit position
  57. numbering, 0 through 7\.  Space between high and low nibbles for clarity
  58. and easy comparison to hexadecimal notation\.
  59. .sp
  60. This function is presented to illustrate that bit-wise operations
  61. are possible with Clipper code\.  For greater speed, write \.C or
  62. \.ASM versions and use the Clipper Extend system\.
  63. .sp
  64. .in 0.08i
  65. \fBExamples
  66. .sp
  67. .in 0.4i
  68. These three code lines perform a bitwise AND on bytes with values of
  69. CHR(20) and CHR(36), and deliver the result as a string in binary (bit)
  70. format\.
  71. .sp
  72. .in 0.8i
  73. .ta 2.4i
  74. ? FT_BYT2BIT(CHR(20))    // byte1: \'0001 0100\'
  75. .br
  76. .ta
  77. .ta 2.4i
  78. ? FT_BYT2BIT(CHR(36))    // byte2: \'0010 0100\'
  79. .br
  80. .ta
  81. .sp
  82. ? FT_BYT2BIT(FT_BYTEAND(CHR(20), CHR(36)))
  83. .in 2.32i
  84. // result: \'0000 0100\'
  85. .sp
  86. .in 0.4i
  87. For a demonstration of Clipper bit manipulations, compile and
  88. link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
  89. .sp
  90. .in 0.08i
  91. \fBSource:\fR BYT2BIT\.PRG
  92. .sp
  93. \fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
  94. .in 0i
  95. .sp
  96. .in 1.5i
  97. .ti -1.5i
  98. .ta 1.5i
  99. .ft B
  100. See Also:    
  101. .ft R
  102. FT_BYT2HEX()
  103. .ta 1.63265i
  104. .in 0i
  105. .sp 2
  106. .ne 20
  107. .ps +3
  108. .vs +3
  109. FT_BYT2HEX()    Convert byte to hexadecimal version of its binary value
  110. .br
  111. .ta
  112. .in 0.08i
  113. .ps -3
  114. .vs -3
  115. .sp 2
  116. \fBFT_BYT2HEX()
  117. Convert byte to hexadecimal version of its binary value
  118. .in 0i
  119. .br
  120. \l'6.24i'
  121. .br
  122. .sp
  123. .in 0.08i
  124. \fBSyntax
  125. .sp
  126. .in 0.4i
  127. \fBFT_BYT2HEX( cByte ) -> cHexValue
  128. .sp
  129. .in 0.08i
  130. \fBArguments
  131. .sp
  132. .in 0.4i
  133. \fB<cByte>\fR is the byte to convert\.
  134. .sp
  135. .in 0.08i
  136. \fBReturns
  137. .sp
  138. .in 0.4i
  139. Three-character string, consisting of two digits of hexadecimal
  140. notation and letter \'h\' to signify hex\.  Returns NIL if parameters are
  141. faulty\.
  142. .sp
  143. .in 0.08i
  144. \fBDescription
  145. .sp
  146. .in 0.4i
  147. Can be used to show results of bit manipulation, both before and after\.
  148. .sp
  149. This function is presented to illustrate that bit-wise operations
  150. are possible with Clipper code\.  For greater speed, write \.C or
  151. \.ASM versions and use the Clipper Extend system\.
  152. .sp
  153. .in 0.08i
  154. \fBExamples
  155. .sp
  156. .in 0.4i
  157. These three code lines perform a bitwise AND on bytes with values of
  158. CHR(20) and CHR(36), and deliver the result as a string in hexadecimal
  159. format, using \'h\' to signify hexadecimal\.
  160. .sp
  161. .in 0.8i
  162. .ta 2.4i
  163. ? FT_BYT2HEX(CHR(20))    // byte1: \'14h\'
  164. .br
  165. .ta
  166. .ta 2.4i
  167. ? FT_BYT2HEX(CHR(36))    // byte2: \'24h\'
  168. .br
  169. .ta
  170. .sp
  171. ? FT_BYT2HEX(FT_BYTEAND(CHR(20), CHR(36)))
  172. .in 2.32i
  173. // result: \'04h\'
  174. .sp
  175. .in 0.4i
  176. For a demonstration of Clipper bit manipulations, compile and
  177. link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
  178. .sp
  179. .in 0.08i
  180. \fBSource:\fR BYT2HEX\.PRG
  181. .sp
  182. \fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
  183. .in 0i
  184. .sp
  185. .in 1.5i
  186. .ti -1.5i
  187. .ta 1.5i
  188. .ft B
  189. See Also:    
  190. .ft R
  191. FT_BYT2BIT()
  192. .ta 1.63265i
  193. .in 0i
  194. .sp 2
  195. .ne 20
  196. .ps +3
  197. .vs +3
  198. FT_D2E()    Convert decimal to scientific notation
  199. .br
  200. .ta
  201. .in 0.08i
  202. .ps -3
  203. .vs -3
  204. .sp 2
  205. \fBFT_D2E()
  206. Convert decimal to scientific notation
  207. .in 0i
  208. .br
  209. \l'6.24i'
  210. .br
  211. .sp
  212. .in 0.08i
  213. \fBSyntax
  214. .sp
  215. .in 0.96i
  216. .ta 2.56i
  217. \fBFT_D2E( <nDec>, <nPrecision> )    -> <cNumE>
  218. .br
  219. .ta
  220. .sp
  221. .in 0.08i
  222. \fBArguments
  223. .sp
  224. .in 1.28i
  225. .ta 1.2i
  226. \fB<nDec>\fR    Decimal number to convert
  227. .br
  228. .ta
  229. .sp
  230. .ta 1.2i
  231. \fB<nPrecision>\fR    Number of decimal places in result\.
  232. .br
  233. .ta
  234. .in 1.68i
  235. Defaults to 6 decimal places\.
  236. .sp
  237. .in 0.08i
  238. \fBReturns
  239. .sp
  240. .in 1.28i
  241. .ta 1.2i
  242. <cNumE>    A string representing a number in
  243. .br
  244. .ta
  245. .in 1.68i
  246. scientific notation
  247. .sp
  248. .in 0.08i
  249. \fBDescription
  250. .sp
  251. .in 1.28i
  252. Given a decimal number and the desired precision,
  253. a string representing the equivalent in scientific
  254. notation is returned\.
  255. .sp
  256. .in 0.08i
  257. \fBExamples
  258. .sp
  259. .in 1.28i
  260. ? FT_D2E( 12\.345, 2 )
  261. .in 1.44i
  262. -> 1\.23E1
  263. .sp
  264. .in 1.28i
  265. ? FT_D2E( -12\.345, 3 )
  266. .in 1.44i
  267. -> -1\.235E1
  268. .sp
  269. .in 1.28i
  270. ? FT_D2E( 0\.00000543, 2 )
  271. .in 1.44i
  272. -> 5\.43E-6
  273. .sp
  274. .in 0.08i
  275. \fBSource:\fR D2E\.PRG
  276. .sp
  277. \fBAuthor:\fR Gary Baren
  278. .in 0i
  279. .sp
  280. .in 1.5i
  281. .ti -1.5i
  282. .ta 1.5i
  283. .ft B
  284. See Also:    
  285. .ft R
  286. FT_E2D()
  287. .ta 1.63265i
  288. .in 0i
  289. .sp 2
  290. .ne 20
  291. .ps +3
  292. .vs +3
  293. FT_DEC2BIN()    Convert decimal to binary
  294. .br
  295. .ta
  296. .in 0.08i
  297. .ps -3
  298. .vs -3
  299. .sp 2
  300. \fBFT_DEC2BIN()
  301. Convert decimal to binary
  302. .in 0i
  303. .br
  304. \l'6.24i'
  305. .br
  306. .sp
  307. .in 0.08i
  308. \fBSyntax
  309. .sp
  310. .in 0.4i
  311. \fBFT_DEC2BIN( <nNum> ) -> cBinaryNumber
  312. .sp
  313. .in 0.08i
  314. \fBArguments
  315. .sp
  316. .in 0.4i
  317. \fB<nNum>\fR is the numeric expression to be converted\.
  318. .sp
  319. .in 0.08i
  320. \fBReturns
  321. .sp
  322. .in 0.4i
  323. A character string representing <nNum> in binary format\.
  324. .sp
  325. .in 0.08i
  326. \fBDescription
  327. .sp
  328. .in 0.4i
  329. This function can be used in conjunction with any bit-wise
  330. operations\.
  331. .sp
  332. .in 0.08i
  333. \fBExamples
  334. .sp
  335. .in 0.4i
  336. .ta 2.48i
  337. QOut( FT_DEC2BIN(255) )    // "11111111"
  338. .br
  339. .ta
  340. .ta 2.48i
  341. QOut( FT_DEC2BIN(2) )    // "00000010"
  342. .br
  343. .ta
  344. .sp
  345. .in 0.08i
  346. \fBSource:\fR DECTOBIN\.PRG
  347. .sp
  348. \fBAuthor:\fR Greg Lief
  349. .in 0i
  350. .ta 1.63265i
  351. .sp 2
  352. .ne 20
  353. .ps +3
  354. .vs +3
  355. FT_E2D()    Convert scientific notation string to a decimal
  356. .br
  357. .ta
  358. .in 0.08i
  359. .ps -3
  360. .vs -3
  361. .sp 2
  362. \fBFT_E2D()
  363. Convert scientific notation string to a decimal
  364. .in 0i
  365. .br
  366. \l'6.24i'
  367. .br
  368. .sp
  369. .in 0.08i
  370. \fBSyntax
  371. .sp
  372. .in 0.96i
  373. .ta 1.52i
  374. \fBFT_E2D( <cNumE> )    -> <nDec>
  375. .br
  376. .ta
  377. .sp
  378. .in 0.08i
  379. \fBArguments
  380. .sp
  381. .in 1.28i
  382. .ta 0.8i
  383. \fB<cNumE>\fR    Scientific notation string to convert
  384. .br
  385. .ta
  386. .sp
  387. .in 0.08i
  388. \fBReturns
  389. .sp
  390. .in 1.28i
  391. .ta 0.8i
  392. <nDec>    Decimal number
  393. .br
  394. .ta
  395. .sp
  396. .in 0.08i
  397. \fBDescription
  398. .sp
  399. .in 1.28i
  400. .ta 2.4i
  401. Given a string in the format    x\.yEz, the decimal
  402. .br
  403. .ta
  404. equivalent is returned\.
  405. .sp
  406. .in 0.08i
  407. \fBExamples
  408. .sp
  409. .in 1.28i
  410. ? FT_E2D( "1\.23E1" )
  411. .in 1.44i
  412. -> 12\.3
  413. .sp
  414. .in 1.28i
  415. ? FT_E2D( "-1\.235E1" )
  416. .in 1.44i
  417. -> -12\.35
  418. .sp
  419. .in 1.28i
  420. ? ft_d2e( "5\.43E-6" )
  421. .in 1.44i
  422. -> 0\.0000543
  423. .sp
  424. .in 0.08i
  425. \fBSource:\fR E2D\.PRG
  426. .sp
  427. \fBAuthor:\fR Gary Baren
  428. .in 0i
  429. .sp
  430. .in 1.5i
  431. .ti -1.5i
  432. .ta 1.5i
  433. .ft B
  434. See Also:    
  435. .ft R
  436. FT_D2E()
  437. .ta 1.63265i
  438. .in 0i
  439. .sp 2
  440. .ne 20
  441. .ps +3
  442. .vs +3
  443. FT_ESCCODE()    Convert Lotus style escape codes
  444. .br
  445. .ta
  446. .in 0.08i
  447. .ps -3
  448. .vs -3
  449. .sp 2
  450. \fBFT_ESCCODE()
  451. Convert Lotus style escape codes
  452. .in 0i
  453. .br
  454. \l'6.24i'
  455. .br
  456. .sp
  457. .in 0.08i
  458. \fBSyntax
  459. .sp
  460. .in 0.4i
  461. .ta 1.92i
  462. \fBFT_ESCCODE( <cASCII> )    -> <cPrinterFormat>
  463. .br
  464. .ta
  465. .sp
  466. .in 0.08i
  467. \fBArguments
  468. .sp
  469. .in 0.4i
  470. \fB<cASCII>\fR is the ASCII representation of the printer control
  471. .in 1.28i
  472. codes in Lotus 123 format (e\.g\. "\\027E" for Chr(27)+"E")
  473. .sp
  474. .br
  475. "\\nnn" will be converted to Chr(nnn)
  476. .br
  477. "\\\\" will be converted to "\\"
  478. .sp
  479. .in 0.08i
  480. \fBReturns
  481. .sp
  482. .in 0.4i
  483. The binary version of an ASCII coded printer setup string\.
  484. .sp
  485. .in 0.08i
  486. \fBDescription
  487. .sp
  488. .in 0.4i
  489. This function is useful for allowing the user to enter printer
  490. control codes in Lotus-style ASCII format, and then having
  491. this function convert that code to the format that the printer
  492. needs to receive\.
  493. .sp
  494. .in 0.08i
  495. \fBExamples
  496. .sp
  497. .in 0.4i
  498. .ta 2i
  499. cSetup = "\\015"    // default = Epson compressed print
  500. .br
  501. .ta
  502. .ta 2i
  503. UserInput( @cSetup )    // Let user modify setup code
  504. .br
  505. .ta
  506. .ta 2i
  507. SET DEVICE TO PRINT    // get ready to print
  508. .br
  509. .ta
  510. .ta 2i
  511. ?? FT_ESCCODE( cSetup )    // Output the converted code
  512. .br
  513. .ta
  514. .sp
  515. .in 0.08i
  516. \fBSource:\fR PRTESC\.PRG
  517. .sp
  518. \fBAuthor:\fR Steven Tyrakowski
  519. .in 0i
  520. .ta 1.63265i
  521. .sp 2
  522. .ne 20
  523. .ps +3
  524. .vs +3
  525. FT_HEX2DEC()    Convert a hex number to decimal
  526. .br
  527. .ta
  528. .in 0.08i
  529. .ps -3
  530. .vs -3
  531. .sp 2
  532. \fBFT_HEX2DEC()
  533. Convert a hex number to decimal
  534. .in 0i
  535. .br
  536. \l'6.24i'
  537. .br
  538. .sp
  539. .in 0.08i
  540. \fBSyntax
  541. .sp
  542. .in 0.32i
  543. \fBFT_HEX2DEC( <cHexNum> ) -> nDecNum
  544. .sp
  545. .in 0.08i
  546. \fBArguments
  547. .sp
  548. .in 0.32i
  549. \fB<cHexNum>\fR is a character string representing a hex number\.
  550. .sp
  551. .in 0.08i
  552. \fBReturns
  553. .sp
  554. .in 0.32i
  555. A decimal number\.
  556. .sp
  557. .in 0.08i
  558. \fBDescription
  559. .sp
  560. .in 0.32i
  561. Converts a hexadecimal number to a BASE 10 decimal number\.
  562. Useful for using FT_INT86()\.
  563. .sp
  564. .in 0.08i
  565. \fBExamples
  566. .sp
  567. .in 0.32i
  568. FT_INT86( HEX2DEC( "21" ), aRegs )
  569. .sp
  570. Converts 21h, the Dos Interrupt, to its decimal equivalent,
  571. 33, for use by FT_INT86()\.
  572. .sp
  573. .in 0.08i
  574. \fBSource:\fR HEX2DEC\.PRG
  575. .sp
  576. \fBAuthor:\fR Robert A\. DiFalco
  577. .in 0i
  578. .ta 1.63265i
  579. .sp 2
  580. .ne 20
  581. .ps +3
  582. .vs +3
  583. FT_INVCLR()    Get the inverse of a color
  584. .br
  585. .ta
  586. .in 0.08i
  587. .ps -3
  588. .vs -3
  589. .sp 2
  590. \fBFT_INVCLR()
  591. Get the inverse of a color
  592. .in 0i
  593. .br
  594. \l'6.24i'
  595. .br
  596. .sp
  597. .in 0.08i
  598. \fBSyntax
  599. .sp
  600. .in 0.4i
  601. \fBFT_INVCLR( [ <cDsrdColor> ] ) -> cColor
  602. .sp
  603. .in 0.08i
  604. \fBArguments
  605. .sp
  606. .in 0.4i
  607. \fB<cDsrdColor>\fR is the color to get the inverse of\.  Defaults to
  608. current color\.
  609. .sp
  610. .in 0.08i
  611. \fBReturns
  612. .sp
  613. .in 0.4i
  614. The inverse of the passed color\.
  615. .sp
  616. .in 0.08i
  617. \fBDescription
  618. .sp
  619. .in 0.4i
  620. This function inverts a passed color (in the Clipper format: ??/??),
  621. e\.g\., "W/N" is converted to "N/W"\.
  622. .sp
  623. .in 0.08i
  624. \fBExamples
  625. .sp
  626. .in 0.4i
  627. .ta 2.8i
  628. .br
  629. cInverse := FT_INVCLR()    // Get Inverse of Current Color
  630. .br
  631. .ta
  632. .ta 0.72i
  633. .br
  634. cInvErr    := FT_INVCLR( cErrColor ) // Get Inverse of cErrorColor
  635. .br
  636. .ta
  637. .sp
  638. .in 0.08i
  639. \fBSource:\fR INVCLR\.PRG
  640. .sp
  641. \fBAuthor:\fR David Husnian
  642. .in 0i
  643. .ta 1.63265i
  644. .sp 2
  645. .ne 20
  646. .ps +3
  647. .vs +3
  648. FT_NTOW()    Translate numeric value to words
  649. .br
  650. .ta
  651. .in 0.08i
  652. .ps -3
  653. .vs -3
  654. .sp 2
  655. \fBFT_NTOW()
  656. Translate numeric value to words
  657. .in 0i
  658. .br
  659. \l'6.24i'
  660. .br
  661. .sp
  662. .in 0.08i
  663. \fBSyntax
  664. .sp
  665. .in 0.4i
  666. \fBFT_NTOW( <nNumber> ) -> cWords
  667. .sp
  668. .in 0.08i
  669. \fBArguments
  670. .sp
  671. .in 0.4i
  672. .ta 0.88i
  673. \fB<nNumber>\fR    An integer to translate
  674. .br
  675. .ta
  676. .sp
  677. .in 0.08i
  678. \fBReturns
  679. .sp
  680. .in 0.4i
  681. A text string representing <nNumber>
  682. .sp
  683. .in 0.08i
  684. \fBDescription
  685. .sp
  686. .in 0.48i
  687. Translates numeric input to a text string\.
  688. .sp
  689. FT_NTOW is intended to be used with integers only\.  Since I don\'t
  690. know what your application will be, I can\'t assume the type of
  691. fraction you want returned (ninety nine cents, 99/100, \.99, etc)\.
  692. If you want the fraction in words, just pass it as an integer\.
  693. .sp
  694. .ta 2.56i
  695. Do not pass a negative number!    Handle negative numbers any way
  696. .br
  697. .ta
  698. you need to in your code\.  (ie: CR, DB, Negative, Minus, etc\.)
  699. .sp
  700. Also, numeric 0 is returned as a null string\.  You will need to
  701. make a decision how to output it (zero dollars, no dollars, etc)\.
  702. .sp
  703. .in 0.08i
  704. \fBExamples
  705. .sp
  706. .in 1.28i
  707. .ta 2.56i
  708. ? FT_NTOW( 999 )    -> Nine Hundred Ninety Nine
  709. .br
  710. .ta
  711. .sp
  712. .ta 2.56i
  713. ? FT_NTOW( 1000 )    -> One Thousand
  714. .br
  715. .ta
  716. .sp
  717. ? FT_NTOW( 23 ) + " Dollars and " + FT_NTOW( 99 ) + " Cents"
  718. .in 1.92i
  719. -> Twenty Three Dollars and Ninety Nine Cents
  720. .sp
  721. .in 1.28i
  722. ? FT_NTOW( 23 ) + " Dollars and " + "99/100"
  723. .in 1.92i
  724. -> Twenty Three Dollars and 99/100
  725. .sp
  726. .in 0.32i
  727. .ta 0.56i
  728. x    := -23\.99
  729. .br
  730. .ta
  731. .ta 0.56i
  732. cents    := str( (x - int( x )) * 100, 2, 0 ) + "/100"
  733. .br
  734. .ta
  735. .in 1.28i
  736. .ta 0.56i
  737. x    := int( x )
  738. .br
  739. .ta
  740. .in 0.32i
  741. string := iif( x < 0, "Credit of ", "Debit of " )
  742. .in 1.28i
  743. ? string + FT_NTOW( abs(x) ) + " Dollars and " + "99/100"
  744. .in 1.68i
  745. -> Credit of Twenty Three Dollars and 99/100
  746. .sp
  747. .in 0.08i
  748. \fBSource:\fR NTOW\.PRG
  749. .sp
  750. \fBAuthor:\fR Gary Baren
  751. .in 0i
  752. .ta 1.63265i
  753. .sp 2
  754. .ne 20
  755. .ps +3
  756. .vs +3
  757. FT_SQZN()    Compress a numeric value into a character string
  758. .br
  759. .ta
  760. .in 0.08i
  761. .ps -3
  762. .vs -3
  763. .sp 2
  764. \fBFT_SQZN()
  765. Compress a numeric value into a character string
  766. .in 0i
  767. .br
  768. \l'6.24i'
  769. .br
  770. .sp
  771. .in 0.08i
  772. \fBSyntax
  773. .sp
  774. .in 0.4i
  775. \fBFT_SQZN( <nValue> [, <nSize> [, <nDecimals> ] ] ) -> cCompressed
  776. .sp
  777. .in 0.08i
  778. \fBArguments
  779. .sp
  780. .in 0.4i
  781. .ta 1.04i
  782. nValue    - The numeric value to be compressed
  783. .br
  784. .ta
  785. .ta 1.04i
  786. nSize    - Optional size of numeric field, defaults to 10
  787. .br
  788. .ta
  789. .ta 1.04i
  790. nDecimals    - Optional number of decimal places, defaults to 0
  791. .br
  792. .ta
  793. .sp
  794. .in 0.08i
  795. \fBReturns
  796. .sp
  797. .in 0.4i
  798. .ta 1.04i
  799. cCompressed    - Compressed string, 50% the size of nSize
  800. .br
  801. .ta
  802. .sp
  803. .in 0.08i
  804. \fBDescription
  805. .sp
  806. .sp
  807. .in 0.32i
  808. The FT_SQZN function allows a numeric value to be compressed when
  809. stored in the database\.  The compression is 50% the storage space
  810. of the original number\.  The companion function, FT_UNSQZN returns
  811. the original number from the compressed string\.
  812. .sp
  813. .sp
  814. .in 0.08i
  815. \fBExamples
  816. .sp
  817. .sp
  818. .in 0.16i
  819. replace TRANS->cust_id with FT_SQZN(mcust_id,8),;
  820. .in 0.8i
  821. .ta 1.2i
  822. TRANS->amount    with FT_SQZN(mamount,12,2)
  823. .br
  824. .ta
  825. .sp
  826. .sp
  827. .in 0.08i
  828. \fBSource:\fR SQZN\.PRG
  829. .sp
  830. \fBAuthor:\fR Joseph D\. Booth, Sr\.
  831. .in 0i
  832. .sp
  833. .in 1.5i
  834. .ti -1.5i
  835. .ta 1.5i
  836. .ft B
  837. See Also:    
  838. .ft R
  839. FT_UNSQZN()
  840. .ta 1.63265i
  841. .in 0i
  842. .sp 2
  843. .ne 20
  844. .ps +3
  845. .vs +3
  846. FT_STOD()    Convert a date string to a Clipper date data type
  847. .br
  848. .ta
  849. .in 0.08i
  850. .ps -3
  851. .vs -3
  852. .sp 2
  853. \fBFT_STOD()
  854. Convert a date string to a Clipper date data type
  855. .in 0i
  856. .br
  857. \l'6.24i'
  858. .br
  859. .sp
  860. .in 0.08i
  861. \fBSyntax
  862. .sp
  863. .in 0.4i
  864. \fBFT_STOD( <cDateStr> ) -> dDateType
  865. .sp
  866. .in 0.08i
  867. \fBArguments
  868. .sp
  869. .in 0.4i
  870. \fB<cDateStr>\fR is a Clipper string in the format "CCYYMMDD"\.
  871. .sp
  872. .in 0.08i
  873. \fBReturns
  874. .sp
  875. .in 0.4i
  876. A Clipper date type\.
  877. .sp
  878. .in 0.08i
  879. \fBDescription
  880. .sp
  881. .in 0.4i
  882. This function allows the programmer to hard code a date into the
  883. program without knowing what the current date type is\.  This
  884. function is the converse of the Clipper DTOS() function\.
  885. .sp
  886. .in 0.08i
  887. \fBExamples
  888. .sp
  889. .in 0.4i
  890. .br
  891. LOCAL dMyDate
  892. .br
  893. dMyDate := FT_STOD( "19901127" )
  894. .sp
  895. .in 0.08i
  896. \fBSource:\fR STOD\.C
  897. .sp
  898. \fBAuthor:\fR Clayton Neff
  899. .in 0i
  900. .ta 1.63265i
  901. .sp 2
  902. .ne 20
  903. .ps +3
  904. .vs +3
  905. FT_UNSQZN()    Uncompress a numeric compressed by FT_SQZN()
  906. .br
  907. .ta
  908. .in 0.08i
  909. .ps -3
  910. .vs -3
  911. .sp 2
  912. \fBFT_UNSQZN()
  913. Uncompress a numeric compressed by FT_SQZN()
  914. .in 0i
  915. .br
  916. \l'6.24i'
  917. .br
  918. .sp
  919. .in 0.08i
  920. \fBSyntax
  921. .sp
  922. .in 0.4i
  923. \fBFT_UNSQZN( <cCompressed>, <nSize> [, <nDecimals> ] ) -> nValue
  924. .sp
  925. .in 0.08i
  926. \fBArguments
  927. .sp
  928. .in 0.4i
  929. .ta 1.2i
  930. \fB<cCompressed>\fR    - Compressed string, obtained from FT_SQZN()
  931. .br
  932. .ta
  933. .sp
  934. .ta 1.2i
  935. \fB<nSize>\fR    - Size of numeric field
  936. .br
  937. .ta
  938. .sp
  939. .ta 1.2i
  940. \fB<nDecimals>\fR    - Optional number of decimal places
  941. .br
  942. .ta
  943. .sp
  944. .in 0.08i
  945. \fBReturns
  946. .sp
  947. .in 0.4i
  948. .ta 1.04i
  949. nValue    - Uncompressed numeric value
  950. .br
  951. .ta
  952. .sp
  953. .in 0.08i
  954. \fBDescription
  955. .sp
  956. .sp
  957. .in 0.32i
  958. The FT_UNSQZN function returns the numeric value from the compressed
  959. string\.  The compression is 50% the storage space of the original
  960. number\.  The original number must have been compressed using the
  961. FT_SQZN() function\.
  962. .sp
  963. This function, along with FT_SQZN() can be used to reduce disk storage
  964. requirements for numeric fields in a database file\.
  965. .sp
  966. .sp
  967. .in 0.08i
  968. \fBExamples
  969. .sp
  970. .sp
  971. .in 0.32i
  972. .br
  973. mcust_id := FT_UNSQZN(TRANS->cust_id,8),;
  974. .ta 0.72i
  975. .br
  976. mamount    := FT_UNSQZN(TRANS->amount,12,2)
  977. .br
  978. .ta
  979. .sp
  980. .sp
  981. .in 0.08i
  982. \fBSource:\fR SQZN\.PRG
  983. .sp
  984. \fBAuthor:\fR Joseph D\. Booth, Sr\.
  985. .in 0i
  986. .sp
  987. .in 1.5i
  988. .ti -1.5i
  989. .ta 1.5i
  990. .ft B
  991. See Also:    
  992. .ft R
  993. FT_SQZN()
  994. .ta 1.63265i
  995. .in 0i
  996. .sp 2
  997. .ne 20
  998. .ps +3
  999. .vs +3
  1000. FT_XTOY()    Convert from any data type to any other data type
  1001. .br
  1002. .ta
  1003. .in 0.08i
  1004. .ps -3
  1005. .vs -3
  1006. .sp 2
  1007. \fBFT_XTOY()
  1008. Convert from any data type to any other data type
  1009. .in 0i
  1010. .br
  1011. \l'6.24i'
  1012. .br
  1013. .sp
  1014. .in 0.08i
  1015. \fBSyntax
  1016. .sp
  1017. .in 0.4i
  1018. \fBFT_XTOY( <xValueToConvert>, <cTypeToConvertTo> ;
  1019. .in 1.12i
  1020. \fB[, <lWantYesNo> ] ) -> xResult
  1021. .sp
  1022. .in 0.08i
  1023. \fBArguments
  1024. .sp
  1025. .in 0.4i
  1026. \fB<xValueToConvert>\fR is the value to convert\.
  1027. .sp
  1028. \fB<cTypeToConvertTo>\fR is the type of value to convert to
  1029. ("C","D","L","N","A" or "B")\.
  1030. .sp
  1031. \fB<lWantYesNo>\fR is a logical to signal if \'Y\' or \'N\' is to be returned
  1032. if Converting a logical, otherwise \'\.T\.\' or \'\.F\.\' will be returned
  1033. for logicals\.
  1034. .sp
  1035. .in 0.08i
  1036. \fBReturns
  1037. .sp
  1038. .in 0.4i
  1039. The original value converted to the new type\.
  1040. .sp
  1041. .in 0.08i
  1042. \fBDescription
  1043. .sp
  1044. .in 0.4i
  1045. This function converts a value of character, date, numeric, logical,
  1046. array or code block type to any of the other type\.  While it is
  1047. guaranteed to return a value of the correct type, that value may not
  1048. be meaningful (i\.e\., converting from a code block returns an EMPTY()
  1049. value of the desired type)\.
  1050. .sp
  1051. .in 0.08i
  1052. \fBExamples
  1053. .sp
  1054. .in 0.4i
  1055. .br
  1056. nNumericValue := FT_XTOY(cInputValue, "N")
  1057. .br
  1058. IF (FT_XTOY(nInputValue, "L"))
  1059. .sp
  1060. .in 0.08i
  1061. \fBSource:\fR ANY2ANY\.PRG
  1062. .sp
  1063. \fBAuthor:\fR David Husnian
  1064.