home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / CLIPPER / NFTROFF / 5.TR < prev    next >
Text File  |  1993-12-01  |  53KB  |  3,238 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_ACCTADJ()    Adjust beginning or ending fiscal pd\. dates to acctg\. dates
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_ACCTADJ()
  25. Adjust beginning or ending fiscal pd\. dates to acctg\. dates
  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_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
  36. .sp
  37. .in 0.08i
  38. \fBArguments
  39. .sp
  40. .in 0.4i
  41. \fB<dGivenDate>\fR is any valid date in any valid format\.
  42. Defaults to DATE() if not supplied\.
  43. .sp
  44. \fB<lIsEnd>\fR is a logical variable\. \.F\. = adjust for beginning of
  45. period mode, \.T\. = adjust for end of period mode\.  Defaults to
  46. beginning of period mode\.
  47. .sp
  48. .in 0.08i
  49. \fBReturns
  50. .sp
  51. .in 0.4i
  52. An adjusted date dependent upon mode and work week start day\.
  53. .sp
  54. .in 0.08i
  55. \fBDescription
  56. .sp
  57. .in 0.4i
  58. Called by other FT_ACCT\.\. functions\. The algorithm is:
  59. .sp
  60. Beginning of period mode:
  61. .sp
  62. .in 0.64i
  63. If dGivenDate is in last 3 days of work week
  64. .in 0.88i
  65. Return next week\'s start date
  66. .in 0.64i
  67. Else
  68. .in 0.88i
  69. Return this week\'s start date
  70. .in 0.64i
  71. Endif
  72. .sp
  73. .in 0.4i
  74. End of period mode:
  75. .sp
  76. .in 0.64i
  77. If dGivenDate is in last 4 days of work week
  78. .in 0.88i
  79. Return this week\'s end date
  80. .in 0.64i
  81. Else
  82. .in 0.88i
  83. Return prior week\'s end date
  84. .in 0.64i
  85. Endif
  86. .sp
  87. .in 0.08i
  88. \fBExamples
  89. .sp
  90. .in 0.4i
  91. Beginning of period mode (lIsEnd == \.F\.)
  92. .sp
  93. .in 0.56i
  94. .ta 2.32i
  95. dDate := Ctod( "01/31/91" )    // In last 3 days of work week
  96. .br
  97. .ta
  98. .ta 2.32i
  99. ? FT_ACCTADJ( dDate )    // 02/03/91 (next week\'s start)
  100. .br
  101. .ta
  102. .sp
  103. .ta 2.32i
  104. dDate := Ctod( "03/31/91" )    // Not in last 3 days of work week
  105. .br
  106. .ta
  107. .ta 2.32i
  108. ? FT_ACCTADJ( dDate )    // 03/31/91 (this week\'s start)
  109. .br
  110. .ta
  111. .sp
  112. .in 0.4i
  113. End of period mode (lIsEnd == \.T\.)
  114. .sp
  115. .in 0.56i
  116. .ta 2.32i
  117. dDate := Ctod( "01/31/91" )    // In last 4 days of work week
  118. .br
  119. .ta
  120. .ta 2.32i
  121. ? FT_ACCTADJ( dDate, \.T\. )    // 02/02/91 (this week\'s end)
  122. .br
  123. .ta
  124. .sp
  125. .ta 2.32i
  126. dDate := Ctod( "03/31/91" )    // Not in last 4 days of work week
  127. .br
  128. .ta
  129. .ta 2.32i
  130. ? FT_ACCTADJ( dDate, \.T\. )    // 03/30/91 (prior week\'s end)
  131. .br
  132. .ta
  133. .sp
  134. .in 0.08i
  135. \fBSource:\fR ACCTADJ\.PRG
  136. .sp
  137. \fBAuthor:\fR Jo W\. French dba Practical Computing
  138. .in 0i
  139. .sp
  140. .in 1.5i
  141. .ti -1.5i
  142. .ta 1.5i
  143. .ft B
  144. See Also:    
  145. .ft R
  146. FT_DATECNFG()
  147. , FT_DAYTOBOW()
  148. .ta 1.63265i
  149. .in 0i
  150. .sp 2
  151. .ne 20
  152. .ps +3
  153. .vs +3
  154. FT_ACCTMONTH()    Return accounting month data
  155. .br
  156. .ta
  157. .in 0.08i
  158. .ps -3
  159. .vs -3
  160. .sp 2
  161. \fBFT_ACCTMONTH()
  162. Return accounting month data
  163. .in 0i
  164. .br
  165. \l'6.24i'
  166. .br
  167. .sp
  168. .in 0.08i
  169. \fBSyntax
  170. .sp
  171. .in 0.4i
  172. \fBFT_ACCTMONTH( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
  173. .sp
  174. .in 0.08i
  175. \fBArguments
  176. .sp
  177. .in 0.4i
  178. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  179. to current system date if not supplied\.
  180. .sp
  181. \fB<nMonthNum>\fR is a number from 1 to 12 signifying a month\.
  182. Defaults to current month if not supplied\.
  183. .sp
  184. .in 0.08i
  185. \fBReturns
  186. .sp
  187. .in 0.4i
  188. A three element array containing the following data:
  189. .sp
  190. .in 0.64i
  191. .br
  192. aDateInfo[1] - The year and month as a character string "YYYYMM"
  193. .br
  194. aDateInfo[2] - The beginning date of the accounting month
  195. .br
  196. aDateInfo[3] - The ending date of the accounting month
  197. .sp
  198. .in 0.08i
  199. \fBDescription
  200. .sp
  201. .in 0.4i
  202. FT_ACCTMONTH() creates an array containing data about the
  203. accounting month containing the given date\.
  204. .sp
  205. An accounting period has the following characteristics:
  206. .sp
  207. If the first week of the period contains 4 or more \'work\'
  208. days, it is included in the period; otherwise, the first
  209. week was included in the prior period\.
  210. .sp
  211. If the last week of the period contains 4 or more \'work\'
  212. days it is included in the period; otherwise, the last week
  213. is included in the next period\.  This results in 13 week
  214. \'quarters\' and 4 or 5 week \'months\'\.  Every 5 or 6 years, a
  215. \'quarter\' will contain 14 weeks and the year will contain 53
  216. weeks\.
  217. .sp
  218. .in 0.08i
  219. \fBExamples
  220. .sp
  221. .in 0.4i
  222. .br
  223. // get info about accounting month containing 9/15/90
  224. .br
  225. aDateInfo := FT_ACCTMONTH( Ctod("09/15/90") )
  226. .ta 1.36i 1.68i 2.72i
  227. .br
  228. ? aDateInfo[1]    //    199009    (9th month)
  229. .br
  230. .ta
  231. .ta 1.36i 1.68i 2.72i
  232. .br
  233. ? aDateInfo[2]    //    09/02/90    beginning of month 9
  234. .br
  235. .ta
  236. .ta 1.36i 1.68i 2.72i
  237. .br
  238. ? aDateInfo[3]    //    09/29/90    end of month 9
  239. .br
  240. .ta
  241. .sp
  242. .br
  243. // get info about accounting month 5 in year containing 9/15/90
  244. .br
  245. aDateInfo := FT_ACCTMONTH( Ctod("09/15/90"), 5 )
  246. .ta 1.36i 1.68i
  247. .br
  248. ? aDateInfo[1]    //    199005
  249. .br
  250. .ta
  251. .ta 1.36i 1.68i 2.56i
  252. .br
  253. ? aDateInfo[2]    //    04/29/89    beginning of month 5
  254. .br
  255. .ta
  256. .ta 1.36i 1.68i 2.56i
  257. .br
  258. ? aDateInfo[3]    //    06/02/90    end of month 5
  259. .br
  260. .ta
  261. .sp
  262. .in 0.08i
  263. \fBSource:\fR ACCTMNTH\.PRG
  264. .sp
  265. \fBAuthor:\fR Jo W\. French dba Practical Computing
  266. .in 0i
  267. .sp
  268. .in 1.5i
  269. .ti -1.5i
  270. .ta 1.5i
  271. .ft B
  272. See Also:    
  273. .ft R
  274. FT_DATECNFG()
  275. , FT_ACCTWEEK()
  276. , FT_ACCTQTR()
  277. , FT_ACCTYEAR()
  278. .ta 1.63265i
  279. .in 0i
  280. .sp 2
  281. .ne 20
  282. .ps +3
  283. .vs +3
  284. FT_ACCTQTR()    Return accounting quarter data
  285. .br
  286. .ta
  287. .in 0.08i
  288. .ps -3
  289. .vs -3
  290. .sp 2
  291. \fBFT_ACCTQTR()
  292. Return accounting quarter data
  293. .in 0i
  294. .br
  295. \l'6.24i'
  296. .br
  297. .sp
  298. .in 0.08i
  299. \fBSyntax
  300. .sp
  301. .in 0.4i
  302. \fBFT_ACCTQTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
  303. .sp
  304. .in 0.08i
  305. \fBArguments
  306. .sp
  307. .in 0.4i
  308. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  309. to current system date if not supplied\.
  310. .sp
  311. \fB<nQtrNum>\fR is a number from 1 to 4 signifying a quarter\.
  312. Defaults to current quarter if not supplied\.
  313. .sp
  314. .in 0.08i
  315. \fBReturns
  316. .sp
  317. .in 0.4i
  318. A three element array containing the following data:
  319. .sp
  320. .in 0.64i
  321. .br
  322. aDateInfo[1] - The year and qtr\. as a character string "YYYYQQ"
  323. .br
  324. aDateInfo[2] - The beginning date of the accounting quarter
  325. .br
  326. aDateInfo[3] - The ending date of the accounting quarter
  327. .sp
  328. .in 0.08i
  329. \fBDescription
  330. .sp
  331. .in 0.4i
  332. FT_ACCTQTR() creates an array containing data about the
  333. accounting quarter containing the given date\.
  334. .sp
  335. An accounting period has the following characteristics:
  336. .sp
  337. If the first week of the period contains 4 or more \'work\'
  338. days, it is included in the period; otherwise, the first
  339. week was included in the prior period\.
  340. .sp
  341. If the last week of the period contains 4 or more \'work\'
  342. days it is included in the period; otherwise, the last week
  343. is included in the next period\.  This results in 13 week
  344. \'quarters\' and 4 or 5 week \'months\'\.  Every 5 or 6 years, a
  345. \'quarter\' will contain 14 weeks and the year will contain 53
  346. weeks\.
  347. .sp
  348. .in 0.08i
  349. \fBExamples
  350. .sp
  351. .in 0.4i
  352. .br
  353. // get info about accounting month containing 9/15/90
  354. .br
  355. aDateInfo := FT_ACCTQTR( CTOD("09/15/90") )
  356. .ta 1.36i 1.68i 2.72i
  357. .br
  358. ? aDateInfo[1]    //    199003    (3rd quarter)
  359. .br
  360. .ta
  361. .ta 1.36i 1.68i 2.72i
  362. .br
  363. ? aDateInfo[2]    //    07/01/90    beginning of quarter 3
  364. .br
  365. .ta
  366. .ta 1.36i 1.68i 2.72i
  367. .br
  368. ? aDateInfo[3]    //    09/29/90    end of quarter 3
  369. .br
  370. .ta
  371. .sp
  372. .br
  373. // get info about accounting qtr\. 2 in year containing 9/15/90
  374. .br
  375. aDateInfo := FT_ACCTQTR( CTOD("09/15/90"), 2 )
  376. .ta 1.36i 1.68i
  377. .br
  378. ? aDateInfo[1]    //    199002
  379. .br
  380. .ta
  381. .ta 1.36i 1.68i 2.56i
  382. .br
  383. ? aDateInfo[2]    //    04/01/89    beginning of quarter 2
  384. .br
  385. .ta
  386. .ta 1.36i 1.68i 2.56i
  387. .br
  388. ? aDateInfo[3]    //    06/30/90    end of quarter 2
  389. .br
  390. .ta
  391. .sp
  392. .in 0.08i
  393. \fBSource:\fR ACCTQTR\.PRG
  394. .sp
  395. \fBAuthor:\fR Jo W\. French dba Practical Computing
  396. .in 0i
  397. .sp
  398. .in 1.5i
  399. .ti -1.5i
  400. .ta 1.5i
  401. .ft B
  402. See Also:    
  403. .ft R
  404. FT_DATECNFG()
  405. , FT_ACCTWEEK()
  406. , FT_ACCTMONTH()
  407. , FT_ACCTYEAR()
  408. .ta 1.63265i
  409. .in 0i
  410. .sp 2
  411. .ne 20
  412. .ps +3
  413. .vs +3
  414. FT_ACCTWEEK()    Return accounting week data
  415. .br
  416. .ta
  417. .in 0.08i
  418. .ps -3
  419. .vs -3
  420. .sp 2
  421. \fBFT_ACCTWEEK()
  422. Return accounting week data
  423. .in 0i
  424. .br
  425. \l'6.24i'
  426. .br
  427. .sp
  428. .in 0.08i
  429. \fBSyntax
  430. .sp
  431. .in 0.4i
  432. \fBFT_ACCTWEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
  433. .sp
  434. .in 0.08i
  435. \fBArguments
  436. .sp
  437. .in 0.4i
  438. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  439. to current system date if not supplied\.
  440. .sp
  441. \fB<nWeekNum>\fR is a number from 1 to 52 signifying a week\.
  442. Defaults to current week if not supplied\.
  443. .sp
  444. .in 0.08i
  445. \fBReturns
  446. .sp
  447. .in 0.4i
  448. A three element array containing the following data:
  449. .sp
  450. .in 0.64i
  451. .br
  452. aDateInfo[1] - The year and week as a character string "YYYYWW"
  453. .br
  454. aDateInfo[2] - The beginning date of the accounting week
  455. .br
  456. aDateInfo[3] - The ending date of the accounting week
  457. .sp
  458. .in 0.08i
  459. \fBDescription
  460. .sp
  461. .in 0.4i
  462. FT_ACCTWEEK() returns an array containing data about the
  463. accounting week containing the given date\.
  464. .sp
  465. An accounting period has the following characteristics:
  466. .sp
  467. If the first week of the period contains 4 or more \'work\'
  468. days, it is included in the period; otherwise, the first
  469. week was included in the prior period\.
  470. .sp
  471. If the last week of the period contains 4 or more \'work\'
  472. days it is included in the period; otherwise, the last week
  473. is included in the next period\.  This results in 13 week
  474. \'quarters\' and 4 or 5 week \'months\'\.  Every 5 or 6 years, a
  475. \'quarter\' will contain 14 weeks and the year will contain 53
  476. weeks\.
  477. .sp
  478. .in 0.08i
  479. \fBExamples
  480. .sp
  481. .in 0.4i
  482. .br
  483. // get info about accounting week containing 9/15/90
  484. .br
  485. aDateInfo := FT_ACCTWEEK( CTOD("09/15/90") )
  486. .ta 1.36i 1.68i 2.72i
  487. .br
  488. ? aDateInfo[1]    //    199037    (37th week)
  489. .br
  490. .ta
  491. .ta 1.36i 1.68i 2.72i
  492. .br
  493. ? aDateInfo[2]    //    09/09/90    beginning of week 37
  494. .br
  495. .ta
  496. .ta 1.36i 1.68i 2.72i
  497. .br
  498. ? aDateInfo[3]    //    09/15/90    end of week 37
  499. .br
  500. .ta
  501. .sp
  502. .br
  503. // get info about accounting week 25 in year containing 9/15/90
  504. .br
  505. aDateInfo := FT_ACCTWEEK( CTOD("09/15/90"), 25 )
  506. .ta 1.36i 1.68i
  507. .br
  508. ? aDateInfo[1]    //    199025
  509. .br
  510. .ta
  511. .ta 1.36i 1.68i 2.56i
  512. .br
  513. ? aDateInfo[2]    //    06/17/89    beginning of week 25
  514. .br
  515. .ta
  516. .ta 1.36i 1.68i 2.56i
  517. .br
  518. ? aDateInfo[3]    //    06/23/90    end of week 25
  519. .br
  520. .ta
  521. .sp
  522. .in 0.08i
  523. \fBSource:\fR ACCTWEEK\.PRG
  524. .sp
  525. \fBAuthor:\fR Jo W\. French dba Practical Computing
  526. .in 0i
  527. .sp
  528. .in 1.5i
  529. .ti -1.5i
  530. .ta 1.5i
  531. .ft B
  532. See Also:    
  533. .ft R
  534. FT_DATECNFG()
  535. , FT_ACCTMONTH()
  536. , FT_ACCTQTR()
  537. , FT_ACCTYEAR()
  538. .ta 1.63265i
  539. .in 0i
  540. .sp 2
  541. .ne 20
  542. .ps +3
  543. .vs +3
  544. FT_ACCTYEAR()    Return accounting year data
  545. .br
  546. .ta
  547. .in 0.08i
  548. .ps -3
  549. .vs -3
  550. .sp 2
  551. \fBFT_ACCTYEAR()
  552. Return accounting year data
  553. .in 0i
  554. .br
  555. \l'6.24i'
  556. .br
  557. .sp
  558. .in 0.08i
  559. \fBSyntax
  560. .sp
  561. .in 0.4i
  562. \fBFT_ACCTYEAR( [ <dGivenDate> ] ) -> aDateInfo
  563. .sp
  564. .in 0.08i
  565. \fBArguments
  566. .sp
  567. .in 0.4i
  568. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  569. to current system date if not supplied\.
  570. .sp
  571. .in 0.08i
  572. \fBReturns
  573. .sp
  574. .in 0.4i
  575. A three element array containing the following data:
  576. .sp
  577. .in 0.64i
  578. .br
  579. aDateInfo[1] - The year as a character string "YYYY"
  580. .br
  581. aDateInfo[2] - The beginning date of the accounting year
  582. .br
  583. aDateInfo[3] - The ending date of the accounting year
  584. .sp
  585. .in 0.08i
  586. \fBDescription
  587. .sp
  588. .in 0.4i
  589. FT_ACCTYEAR() creates an array containing data about the
  590. accounting year containing the given date\.
  591. .sp
  592. An accounting period has the following characteristics:
  593. .sp
  594. If the first week of the period contains 4 or more \'work\'
  595. days, it is included in the period; otherwise, the first
  596. week was included in the prior period\.
  597. .sp
  598. If the last week of the period contains 4 or more \'work\'
  599. days it is included in the period; otherwise, the last week
  600. is included in the next period\.  This results in 13 week
  601. \'quarters\' and 4 or 5 week \'months\'\.  Every 5 or 6 years, a
  602. \'quarter\' will contain 14 weeks and the year will contain 53
  603. weeks\.
  604. .sp
  605. .in 0.08i
  606. \fBExamples
  607. .sp
  608. .in 0.4i
  609. .br
  610. // get info about accounting year containing 9/15/90
  611. .br
  612. aDateInfo := FT_ACCTYEAR( CTOD("09/15/90") )
  613. .ta 1.36i 1.68i
  614. .br
  615. ? aDateInfo[1]    //    1990
  616. .br
  617. .ta
  618. .ta 1.36i 1.68i 2.64i
  619. .br
  620. ? aDateInfo[2]    //    12/31/89    beginning of year
  621. .br
  622. .ta
  623. .ta 1.36i 1.68i 2.64i
  624. .br
  625. ? aDateInfo[3]    //    12/29/90    end of year
  626. .br
  627. .ta
  628. .sp
  629. .in 0.08i
  630. \fBSource:\fR ACCTYEAR\.PRG
  631. .sp
  632. \fBAuthor:\fR Jo W\. French dba Practical Computing
  633. .in 0i
  634. .sp
  635. .in 1.5i
  636. .ti -1.5i
  637. .ta 1.5i
  638. .ft B
  639. See Also:    
  640. .ft R
  641. FT_DATECNFG()
  642. , FT_ACCTWEEK()
  643. , FT_ACCTMONTH()
  644. , FT_ACCTQTR()
  645. .ta 1.63265i
  646. .in 0i
  647. .sp 2
  648. .ne 20
  649. .ps +3
  650. .vs +3
  651. FT_ADDWKDY()    Return true number of days to add given number of workdays
  652. .br
  653. .ta
  654. .in 0.08i
  655. .ps -3
  656. .vs -3
  657. .sp 2
  658. \fBFT_ADDWKDY()
  659. Return true number of days to add given number of workdays
  660. .in 0i
  661. .br
  662. \l'6.24i'
  663. .br
  664. .sp
  665. .in 0.08i
  666. \fBSyntax
  667. .sp
  668. .in 0.4i
  669. \fBFT_ADDWKDY( <dStart>, <nWorkDays> ) -> nTrueDays
  670. .sp
  671. .in 0.08i
  672. \fBArguments
  673. .sp
  674. .in 0.4i
  675. .br
  676. \fB<dStart>\fR = date to start adding from
  677. .br
  678. \fB<nWorkDays>\fR = number of workdays to add
  679. .sp
  680. .in 0.08i
  681. \fBReturns
  682. .sp
  683. .in 0.4i
  684. <nTrueDays> = Number of actual days to add to <dStart> in
  685. .in 1.52i
  686. order to add the required <nWorkDays>
  687. .sp
  688. .in 0.08i
  689. \fBDescription
  690. .sp
  691. .in 0.48i
  692. Let\'s say you are given the problem:
  693. .sp
  694. .in 0.72i
  695. "All invoices are due 10 working days from the date they
  696. are printed\.  Please display the due date on the invoice\."
  697. .sp
  698. .in 0.48i
  699. .ta 1.84i
  700. When is the due date?    Assuming you are printing the invoices
  701. .br
  702. .ta
  703. today, your answer is:
  704. .sp
  705. .in 0.88i
  706. dDueDate := DATE() + ft_addWkDay( DATE(), 10 )
  707. .sp
  708. .in 0.48i
  709. A work day is defined as Monday through Friday\.  Unfortunately
  710. this routine does _not_ account for holidays\.
  711. .sp
  712. This documentation was written by Glenn Scott so if it\'s wrong,
  713. blame him\.
  714. .sp
  715. .sp
  716. .in 0.08i
  717. \fBExamples
  718. .sp
  719. .in 0.48i
  720. .br
  721. // Postdate 5 working days from the first of January
  722. .br
  723. dPost := CTOD("01/01/91")
  724. .ta 2.72i
  725. .br
  726. dPost += FT_ADDWKDY( dPost, 5 )    // returns 7 true days
  727. .br
  728. .ta
  729. .ta 2.64i 2.96i
  730. .br
  731. ? dPost    //    01/08/91
  732. .br
  733. .ta
  734. .sp
  735. .sp
  736. .in 0.08i
  737. \fBSource:\fR WDA\.PRG
  738. .sp
  739. \fBAuthor:\fR Eric Splaver
  740. .in 0i
  741. .sp
  742. .in 1.5i
  743. .ti -1.5i
  744. .ta 1.5i
  745. .ft B
  746. See Also:    
  747. .ft R
  748. FT_WORKDAYS()
  749. .ta 1.63265i
  750. .in 0i
  751. .sp 2
  752. .ne 20
  753. .ps +3
  754. .vs +3
  755. FT_CALENDAR()    Display date/time calendar, find a date, return calendar dat
  756. .br
  757. .ta
  758. .in 0.08i
  759. .ps -3
  760. .vs -3
  761. .sp 2
  762. \fBFT_CALENDAR()
  763. Display date/time calendar, find a date, return calendar dat
  764. .in 0i
  765. .br
  766. \l'6.24i'
  767. .br
  768. .sp
  769. .in 0.08i
  770. \fBSyntax
  771. .sp
  772. .in 0.4i
  773. \fBFT_CALENDAR ( [ <nRow> ], [ <nCol> ], [ <cColor> ], [ <lShadow> ] ,
  774. .in 1.52i
  775. \fB[ <lShowHelp> ] ) -> aRetVal
  776. .sp
  777. .in 0.08i
  778. \fBArguments
  779. .sp
  780. .sp
  781. .in 0.4i
  782. \fB<nRow>\fR is an optional screen row for calendar display,
  783. .in 0.96i
  784. default row 1\.
  785. .sp
  786. .in 0.4i
  787. \fB<nCol>\fR is an optional screen col for calendar display,
  788. .in 0.96i
  789. default col 63\.
  790. .sp
  791. .in 0.4i
  792. \fB<cColor>\fR is an optional color string for displayed messages,
  793. .in 1.12i
  794. default is bright white text over green background\.
  795. .sp
  796. .in 0.4i
  797. \fB<lShadow>\fR is an optional logical variable\. If true (\.T\.),
  798. .in 1.2i
  799. it uses FT_SHADOW() to add a transparent shadow
  800. to the display, default (\.F\.)\.
  801. .sp
  802. .in 0.4i
  803. \fB<lShowHelp>\fR is an optional logical variable\. If true, uses
  804. .in 1.36i
  805. .ta 1.6i
  806. FT_XBOX to display    a four line help message
  807. .br
  808. .ta
  809. if the F1 key is pressed, default (\.F\.)\.
  810. .sp
  811. .sp
  812. .in 0.08i
  813. \fBReturns
  814. .sp
  815. .in 0.4i
  816. .ta 0.72i
  817. aRetVal    is an 8 element array containing date, month, day, year,
  818. .br
  819. .ta
  820. .in 1.12i
  821. month (in character format), day of the week, julian day
  822. and current time\.
  823. .sp
  824. .sp
  825. .in 0.08i
  826. \fBDescription
  827. .sp
  828. .in 0.4i
  829. FT_CALENDAR() simply displays today\'s date, time and julian
  830. day in a two line display with an optional box shadow\. Cursor keys may
  831. be used to page through the calendar by day, week, month or year
  832. increments\. Returns an 8 element array of calendar data:
  833. .sp
  834. .ta 0.72i
  835. Element    Value
  836. .br
  837. .ta
  838. .ta 0.72i
  839. [1]    Date in current date format\.
  840. .br
  841. .ta
  842. .ta 0.72i
  843. [2]    Numeric month number\.
  844. .br
  845. .ta
  846. .ta 0.72i
  847. [3]    Numeric day number\.
  848. .br
  849. .ta
  850. .ta 0.72i
  851. [4]    Numeric year number\.
  852. .br
  853. .ta
  854. .ta 0.72i
  855. [5]    Month in character format\.
  856. .br
  857. .ta
  858. .ta 0.72i
  859. [6]    Day of the week in character format\.
  860. .br
  861. .ta
  862. .ta 0.72i
  863. [7]    Numeric Julian day\.
  864. .br
  865. .ta
  866. .ta 0.72i
  867. [8]    Current time in time format\.
  868. .br
  869. .ta
  870. .sp
  871. WARNING: FT_CALENDAR uses FT_SHADOW and FT_XBOX
  872. .in 1.12i
  873. from the Nanforum Toolkit!
  874. .sp
  875. .sp
  876. .in 0.08i
  877. \fBExamples
  878. .sp
  879. .sp
  880. .in 0.24i
  881. .br
  882. LOCAL aRetVal[8]
  883. .br
  884. CLS
  885. .br
  886. aRetVal := FT_CALENDAR (10,40,\'W+/RB\',\.T\.,\.T\.)
  887. .ta 1.36i
  888. ?aRetVal[1]    // Result: 04/20/91
  889. .br
  890. .ta
  891. .ta 1.36i 2.4i
  892. ?aRetVal[2]    // Result:    4
  893. .br
  894. .ta
  895. .ta 1.36i
  896. ?aRetVal[3]    // Result:  20
  897. .br
  898. .ta
  899. .ta 1.36i
  900. ?aRetVal[4]    // Result:  1991
  901. .br
  902. .ta
  903. .ta 1.36i
  904. ?aRetVal[5]    // Result: April
  905. .br
  906. .ta
  907. .ta 1.36i
  908. ?aRetVal[6]    // Result: Saturday
  909. .br
  910. .ta
  911. .ta 1.36i 2.8i
  912. ?aRetVal[7]    // Result:    110
  913. .br
  914. .ta
  915. .ta 1.36i
  916. ?aRetVal[8]    // Result: 12:45:20
  917. .br
  918. .ta
  919. .sp
  920. .sp
  921. .in 0.08i
  922. \fBSource:\fR CALENDAR\.PRG
  923. .sp
  924. \fBAuthor:\fR Isa Asudeh
  925. .in 0i
  926. .sp
  927. .in 1.5i
  928. .ti -1.5i
  929. .ta 1.5i
  930. .ft B
  931. See Also:    
  932. .ft R
  933. FT_DAYOFYR()
  934. .ta 1.63265i
  935. .in 0i
  936. .sp 2
  937. .ne 20
  938. .ps +3
  939. .vs +3
  940. FT_CIV2MIL()    Convert usual civilian format time to military time\.
  941. .br
  942. .ta
  943. .in 0.08i
  944. .ps -3
  945. .vs -3
  946. .sp 2
  947. \fBFT_CIV2MIL()
  948. Convert usual civilian format time to military time\.
  949. .in 0i
  950. .br
  951. \l'6.24i'
  952. .br
  953. .sp
  954. .in 0.08i
  955. \fBSyntax
  956. .sp
  957. .in 0.4i
  958. \fBFT_CIV2MIL( <cCIVTIME> ) -> cMILTIME
  959. .sp
  960. .in 0.08i
  961. \fBArguments
  962. .sp
  963. .in 0.4i
  964. .ta 0.96i
  965. \fB<cCIVTIME>\fR    character string of form hh:mm (am,pm,n or m),
  966. .br
  967. .ta
  968. .in 0.64i
  969. where 0\fB<hh\fR<12\.
  970. .sp
  971. .in 0.08i
  972. \fBReturns
  973. .sp
  974. .in 0.4i
  975. .ta 0.96i
  976. <cMILTIME>    character string of form hhmm, where 0<=hh<24\.
  977. .br
  978. .ta
  979. .sp
  980. .in 0.08i
  981. \fBDescription
  982. .sp
  983. .in 0.4i
  984. Converts time from 12-hour civilian format to military\.
  985. .sp
  986. .in 0.08i
  987. \fBExamples
  988. .sp
  989. .in 0.4i
  990. FT_CIV2MIL( " 5:40 pm" ) -> 1740
  991. .sp
  992. FT_CIV2MIL( " 5:40 am" ) -> 0540
  993. .sp
  994. FT_CIV2MIL( "12:00 n" ) -> 1200
  995. .sp
  996. FT_CIV2MIL( "12:00 m" ) -> 0000
  997. .sp
  998. Caution:  leading blanks are irrelevant; p,a,n,m must be preceded by
  999. .in 1.2i
  1000. one and only one space\.
  1001. .sp
  1002. .in 0.08i
  1003. \fBSource:\fR MILTIME\.PRG
  1004. .sp
  1005. \fBAuthor:\fR Alexander B\. Spencer
  1006. .in 0i
  1007. .sp
  1008. .in 1.5i
  1009. .ti -1.5i
  1010. .ta 1.5i
  1011. .ft B
  1012. See Also:    
  1013. .ft R
  1014. FT_MIL2CIV()
  1015. , FT_SYS2MIL()
  1016. , FT_MIL2MIN()
  1017. , FT_MIN2MIL()
  1018. .ta 1.63265i
  1019. .in 0i
  1020. .sp 2
  1021. .ne 20
  1022. .ps +3
  1023. .vs +3
  1024. FT_DATECNFG()    Set beginning of year/week for FT_ date functions
  1025. .br
  1026. .ta
  1027. .in 0.08i
  1028. .ps -3
  1029. .vs -3
  1030. .sp 2
  1031. \fBFT_DATECNFG()
  1032. Set beginning of year/week for FT_ date functions
  1033. .in 0i
  1034. .br
  1035. \l'6.24i'
  1036. .br
  1037. .sp
  1038. .in 0.08i
  1039. \fBSyntax
  1040. .sp
  1041. .in 0.4i
  1042. \fBFT_DATECNFG( [ <cFYStart> ], [ <nDow> ] ) -> aDateInfo
  1043. .sp
  1044. .in 0.08i
  1045. \fBArguments
  1046. .sp
  1047. .in 0.4i
  1048. \fB<cFYStart>\fR is a character date string in the user\'s system date
  1049. format, i\.e\., the same as the user would enter for CTOD()\.  If
  1050. this argument is NIL, the current value is unchanged\.
  1051. .sp
  1052. Note: The year portion of the date string must be present and
  1053. be a valid year; however, it has no real meaning\.
  1054. .sp
  1055. \fB<nDow>\fR is a number from 1 to 7 (1 = Sunday) indicating the
  1056. desired start of a work week\.  If this argument is NIL,
  1057. the current value is unchanged\.
  1058. .sp
  1059. .sp
  1060. .in 0.08i
  1061. \fBReturns
  1062. .sp
  1063. .in 0.4i
  1064. A 2-element array containing the following information:
  1065. .sp
  1066. .in 0.64i
  1067. aDateInfo[1] - an ANSI date string indicating the beginning
  1068. .in 1.84i
  1069. date of the year\.  Only the month and day are
  1070. meaningful\.
  1071. .sp
  1072. .in 0.64i
  1073. aDateInfo[2] - the number of the first day of the week
  1074. .in 1.84i
  1075. (1 = Sunday)
  1076. .sp
  1077. .sp
  1078. .in 0.08i
  1079. \fBDescription
  1080. .sp
  1081. .in 0.4i
  1082. FT_DATECNFG() is called internally by many of the date functions
  1083. in the library to determine the beginning of year date and
  1084. beginning of week day\.
  1085. .sp
  1086. The default beginning of the year is January 1st and the default
  1087. beginning of the week is Sunday (day 1)\.  Either or both of these
  1088. settings may be changed by calling FT_DATECNFG() with the proper
  1089. arguments\.  They will retain their values for the duration of the
  1090. program or until they are changed again by a subsequent call to
  1091. FT_DATECNFG()\.
  1092. .sp
  1093. It is not necessary to call FT_DATECNFG() unless you need to
  1094. change the defaults\.
  1095. .sp
  1096. FT_DATECNFG() affects the following library functions:
  1097. .sp
  1098. .in 0.56i
  1099. .ta 1.28i 2.88i
  1100. FT_WEEK()    FT_ACCTWEEK()    FT_DAYTOBOW()
  1101. .br
  1102. .ta
  1103. .ta 1.28i 2.88i
  1104. FT_MONTH()    FT_ACCTMONTH()    FT_DAYOFYR()
  1105. .br
  1106. .ta
  1107. .ta 1.28i 2.88i
  1108. FT_QTR()    FT_ACCTQTR()    FT_ACCTADJ()
  1109. .br
  1110. .ta
  1111. .ta 1.28i
  1112. FT_YEAR()    FT_ACCTYEAR()
  1113. .br
  1114. .ta
  1115. .sp
  1116. .in 0.08i
  1117. \fBExamples
  1118. .sp
  1119. .in 0.56i
  1120. // Configure library date functions to begin year on
  1121. .ta 0.32i
  1122. //    July 1st\.
  1123. .br
  1124. .ta
  1125. .sp
  1126. .ta 2.16i
  1127. FT_DATECNFG("07/01/80")    // year is insignificant
  1128. .br
  1129. .ta
  1130. .sp
  1131. // Examples of return values:
  1132. .sp
  1133. .ta 0.32i 3.44i 4.48i
  1134. //    System date format: American    aArray[1]    aArray[2]
  1135. .br
  1136. .ta
  1137. .sp
  1138. .ta 2.96i 3.28i 4.64i
  1139. aArray := FT_DATECNFG()    //    \'1980\.01\.01\'    1 (Sun\.)
  1140. .br
  1141. .ta
  1142. .ta 2.96i 3.28i 4.64i
  1143. aArray := FT_DATECNFG(\'07/01/80\')    //    \'1980\.07\.01\'    1 (Sun\.)
  1144. .br
  1145. .ta
  1146. .ta 3.28i 4.64i
  1147. aArray := FT_DATECNFG(\'07/01/80\', 2) //    \'1980\.07\.01\'    2 (Mon\.)
  1148. .br
  1149. .ta
  1150. .ta 2.96i 3.28i 4.64i
  1151. aArray := FT_DATECNFG( , 2 )    //    \'1980\.01\.01\'    2 (Mon\.)
  1152. .br
  1153. .ta
  1154. .sp
  1155. .ta 0.32i
  1156. //    System date format: British
  1157. .br
  1158. .ta
  1159. .sp
  1160. .ta 3.28i 4.64i
  1161. aArray := FT_DATECNFG(\'01/07/80\', 2) //    \'1980\.07\.01\'    2 (Mon\.)
  1162. .br
  1163. .ta
  1164. .sp
  1165. .in 0.08i
  1166. \fBSource:\fR DATECNFG\.PRG
  1167. .sp
  1168. \fBAuthor:\fR Jo W\. French dba Practical Computing
  1169. .in 0i
  1170. .sp
  1171. .in 1.5i
  1172. .ti -1.5i
  1173. .ta 1.5i
  1174. .ft B
  1175. See Also:    
  1176. .ft R
  1177. FT_ACCTADJ()
  1178. .ta 1.63265i
  1179. .in 0i
  1180. .sp 2
  1181. .ne 20
  1182. .ps +3
  1183. .vs +3
  1184. FT_DAYOFYR()    Return calendar, fiscal or accounting day data
  1185. .br
  1186. .ta
  1187. .in 0.08i
  1188. .ps -3
  1189. .vs -3
  1190. .sp 2
  1191. \fBFT_DAYOFYR()
  1192. Return calendar, fiscal or accounting day data
  1193. .in 0i
  1194. .br
  1195. \l'6.24i'
  1196. .br
  1197. .sp
  1198. .in 0.08i
  1199. \fBSyntax
  1200. .sp
  1201. .in 0.4i
  1202. \fBFT_DAYOFYR( [ <dGivenDate> ], [ <nDayNum> ], [ <lIsAcct> ] )
  1203. .in 0.96i
  1204. \fB-> aDateInfo
  1205. .sp
  1206. .in 0.08i
  1207. \fBArguments
  1208. .sp
  1209. .in 0.4i
  1210. \fB<dGivenDate>\fR is any valid date in any valid format\.  Defaults
  1211. to current system date if not supplied\.
  1212. .sp
  1213. \fB<nDayNum>\fR is a number from 1 to 371, signifying a day of a year\.
  1214. Defaults to current day if not supplied\.
  1215. .sp
  1216. \fB<lIsAcct>\fR is a logical which specifies the type of year to base
  1217. the return value on:  \.F\. = calendar or fiscal year,
  1218. \.T\. = accounting year\.
  1219. .sp
  1220. .in 0.08i
  1221. \fBReturns
  1222. .sp
  1223. .in 0.4i
  1224. A three element array containing the following data:
  1225. .sp
  1226. .in 0.64i
  1227. If <nDayNum> is specified:
  1228. .sp
  1229. .br
  1230. aDateInfo[1] - The date of the specified day number
  1231. .br
  1232. aDateInfo[2] - The beginning date of the year
  1233. .br
  1234. aDateInfo[3] - The ending date of the year
  1235. .sp
  1236. If <nDayNum> is not specified:
  1237. .sp
  1238. .br
  1239. aDateInfo[1] - The year and day as a character string "YYYYDDD"
  1240. .br
  1241. aDateInfo[2] - The beginning date of the year
  1242. .br
  1243. aDateInfo[3] - The ending date of the year
  1244. .sp
  1245. .in 0.08i
  1246. \fBDescription
  1247. .sp
  1248. .in 0.4i
  1249. FT_DAYOFYR() returns an array containing data about a day in the
  1250. calendar or fiscal year containing the given date\.
  1251. .sp
  1252. The beginning of year date defaults to January 1st but may be
  1253. changed with FT_DATECNFG()\.
  1254. .sp
  1255. .in 0.08i
  1256. \fBExamples
  1257. .sp
  1258. .in 0.4i
  1259. aDateInfo := FT_DAYOFYR( CTOD("03/31/91") )
  1260. .ta 1.76i 2.88i
  1261. ? aDateInfo[1]    // 1991090    (90th day of year 1991)
  1262. .br
  1263. .ta
  1264. .ta 1.76i
  1265. ? aDateInfo[2]    // 01/01/91
  1266. .br
  1267. .ta
  1268. .ta 1.76i
  1269. ? aDateInfo[3]    // 12/31/91
  1270. .br
  1271. .ta
  1272. .sp
  1273. .ta 2.8i
  1274. aDateInfo := FT_DAYOFYR( , 90 )    // assume current date is 3/31/91
  1275. .br
  1276. .ta
  1277. .ta 1.76i 2.96i
  1278. ? aDateInfo[1]    // 03/31/91    (90th day of year)
  1279. .br
  1280. .ta
  1281. .ta 1.76i
  1282. ? aDateInfo[2]    // 01/01/91
  1283. .br
  1284. .ta
  1285. .ta 1.76i
  1286. ? aDateInfo[3]    // 12/31/91
  1287. .br
  1288. .ta
  1289. .sp
  1290. aDateInfo := FT_DAYOFYR( , 90, \.T\. )
  1291. .ta 1.76i 2.96i
  1292. ? aDateInfo[1]    // 03/29/91    (90th day of accounting year)
  1293. .br
  1294. .ta
  1295. .ta 1.76i 2.96i
  1296. ? aDateInfo[2]    // 12/30/90    (1st day of accounting year)
  1297. .br
  1298. .ta
  1299. .ta 1.76i 2.96i
  1300. ? aDateInfo[3]    // 12/28/91    (last day of accounting year)
  1301. .br
  1302. .ta
  1303. .sp
  1304. .in 0.08i
  1305. \fBSource:\fR DAYOFYR\.PRG
  1306. .sp
  1307. \fBAuthor:\fR Jo W\. French dba Practical Computing
  1308. .in 0i
  1309. .sp
  1310. .in 1.5i
  1311. .ti -1.5i
  1312. .ta 1.5i
  1313. .ft B
  1314. See Also:    
  1315. .ft R
  1316. FT_DATECNFG()
  1317. .ta 1.63265i
  1318. .in 0i
  1319. .sp 2
  1320. .ne 20
  1321. .ps +3
  1322. .vs +3
  1323. FT_DAYTOBOW()    Calculate no\. of days between date and beginning of week
  1324. .br
  1325. .ta
  1326. .in 0.08i
  1327. .ps -3
  1328. .vs -3
  1329. .sp 2
  1330. \fBFT_DAYTOBOW()
  1331. Calculate no\. of days between date and beginning of week
  1332. .in 0i
  1333. .br
  1334. \l'6.24i'
  1335. .br
  1336. .sp
  1337. .in 0.08i
  1338. \fBSyntax
  1339. .sp
  1340. .in 0.4i
  1341. \fBFT_DAYTOBOW( [ <dGivenDate> ] ) -> nDays
  1342. .sp
  1343. .in 0.08i
  1344. \fBArguments
  1345. .sp
  1346. .in 0.4i
  1347. \fB<dGivenDate>\fR is any valid date in any valid date format\.
  1348. Defaults to current date if not supplied\.
  1349. .sp
  1350. .in 0.08i
  1351. \fBReturns
  1352. .sp
  1353. .in 0.4i
  1354. A positive number of days to beginning of week, range 0 to 6\.
  1355. .sp
  1356. .in 0.08i
  1357. \fBDescription
  1358. .sp
  1359. .in 0.4i
  1360. FT_DAYTOBOW() returns the number of days to the beginning of the
  1361. week\.  Normally this will be one less than the value that
  1362. would be returned by the Clipper function DOW(), unless the
  1363. day for the beginning of the week has been changed with
  1364. FT_DATECNFG()\.
  1365. .sp
  1366. .in 0.08i
  1367. \fBExamples
  1368. .sp
  1369. .in 0.4i
  1370. dDate := CTOD( "09/15/90" )
  1371. .sp
  1372. .ta 2.32i
  1373. ? DOW( dDate )    // Saturday
  1374. .br
  1375. .ta
  1376. .ta 2.32i
  1377. ? CDOW( dDate )    // 7
  1378. .br
  1379. .ta
  1380. .ta 2.32i
  1381. ? FT_DAYTOBOW( dDate )    // 6
  1382. .br
  1383. .ta
  1384. .sp
  1385. .ta 3.12i
  1386. .br
  1387. // change beginning of week to Friday    (yeah!)
  1388. .br
  1389. .ta
  1390. .br
  1391. FT_DATECNFG( , 6 )
  1392. .ta 2.32i
  1393. ? DOW( dDate )    // Saturday
  1394. .br
  1395. .ta
  1396. .ta 2.32i
  1397. ? CDOW( dDate )    // 7
  1398. .br
  1399. .ta
  1400. .ta 2.32i
  1401. ? FT_DAYTOBOW( dDate )    // 1
  1402. .br
  1403. .ta
  1404. .sp
  1405. .in 0.08i
  1406. \fBSource:\fR DAYTOBOW\.PRG
  1407. .sp
  1408. \fBAuthor:\fR Jo W\. French dba Practical Computing
  1409. .in 0i
  1410. .sp
  1411. .in 1.5i
  1412. .ti -1.5i
  1413. .ta 1.5i
  1414. .ft B
  1415. See Also:    
  1416. .ft R
  1417. FT_DATECNFG()
  1418. , FT_ACCTWEEK()
  1419. , FT_WEEK()
  1420. .ta 1.63265i
  1421. .in 0i
  1422. .sp 2
  1423. .ne 20
  1424. .ps +3
  1425. .vs +3
  1426. FT_DOY()    Find number of day within year
  1427. .br
  1428. .ta
  1429. .in 0.08i
  1430. .ps -3
  1431. .vs -3
  1432. .sp 2
  1433. \fBFT_DOY()
  1434. Find number of day within year
  1435. .in 0i
  1436. .br
  1437. \l'6.24i'
  1438. .br
  1439. .sp
  1440. .in 0.08i
  1441. \fBSyntax
  1442. .sp
  1443. .in 0.4i
  1444. \fBFT_DOY( <dDate> ) -> <nResult>
  1445. .sp
  1446. .in 0.08i
  1447. \fBArguments
  1448. .sp
  1449. .in 0.4i
  1450. \fB<dDate>\fR is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
  1451. .sp
  1452. .in 0.08i
  1453. \fBReturns
  1454. .sp
  1455. .in 0.4i
  1456. Return numeric position of day within the year\.
  1457. Return NIL if parameter does not conform\.
  1458. .sp
  1459. .in 0.08i
  1460. \fBDescription
  1461. .sp
  1462. .in 0.4i
  1463. Finds the day number, considering 01/01 as day 1
  1464. Handles dates with CENTURY ON|OFF, to allow for 21st century\.
  1465. Date validation must be external to this function\.
  1466. .sp
  1467. .in 0.08i
  1468. \fBExamples
  1469. .sp
  1470. .in 0.4i
  1471. These code fragments find the day number, given a date\.
  1472. .sp
  1473. .br
  1474. // literal character date
  1475. .ta 0.56i
  1476. .br
  1477. dDate    := CTOD("01/01/91")
  1478. .br
  1479. .ta
  1480. .ta 3.04i
  1481. .br
  1482. nDayNum := FT_DOY(dDate)    // result:  1
  1483. .br
  1484. .ta
  1485. .sp
  1486. .br
  1487. // presume DOS date to be 01/06/91
  1488. .ta 3.04i
  1489. .br
  1490. nDayNum := FT_DOY(DATE())    // result:  6
  1491. .br
  1492. .ta
  1493. .sp
  1494. .br
  1495. // date input
  1496. .ta 0.56i
  1497. .br
  1498. cDate    := SPACE(8)
  1499. .br
  1500. .ta
  1501. .ta 3.04i
  1502. .br
  1503. @ 4,10 get cDate PICT "##/##/##"    // input 07/04/91
  1504. .br
  1505. .ta
  1506. .br
  1507. READ
  1508. .ta 3.04i
  1509. .br
  1510. nDayNum := FT_DOY(CTOD(cDate))    // result: 185
  1511. .br
  1512. .ta
  1513. .sp
  1514. .br
  1515. // last day of year
  1516. .ta 3.12i
  1517. .br
  1518. nDayNum := FT_DOY(CTOD("12/31/91"))    // result: 365
  1519. .br
  1520. .ta
  1521. .sp
  1522. For a demonstration of this function, compile and link the
  1523. program WOY\.PRG in the Nanforum Toolkit source code\.
  1524. .sp
  1525. .in 0.08i
  1526. \fBSource:\fR WOY\.PRG
  1527. .sp
  1528. \fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
  1529. .in 0i
  1530. .ta 1.63265i
  1531. .sp 2
  1532. .ne 20
  1533. .ps +3
  1534. .vs +3
  1535. FT_EASTER()    Return the date of Easter
  1536. .br
  1537. .ta
  1538. .in 0.08i
  1539. .ps -3
  1540. .vs -3
  1541. .sp 2
  1542. \fBFT_EASTER()
  1543. Return the date of Easter
  1544. .in 0i
  1545. .br
  1546. \l'6.24i'
  1547. .br
  1548. .sp
  1549. .in 0.08i
  1550. \fBSyntax
  1551. .sp
  1552. .in 0.4i
  1553. \fBFT_EASTER( <xYear> ) -> dEdate
  1554. .sp
  1555. .in 0.08i
  1556. \fBArguments
  1557. .sp
  1558. .in 0.4i
  1559. xYear can be a character, date or numeric describing the year
  1560. for which you wish to receive the date of Easter\.
  1561. .sp
  1562. .in 0.08i
  1563. \fBReturns
  1564. .sp
  1565. .in 0.4i
  1566. The actual date that Easter occurs\.
  1567. .sp
  1568. .in 0.08i
  1569. \fBDescription
  1570. .sp
  1571. .in 0.4i
  1572. Returns the date of Easter for any year after 1582 up to Clipper\'s
  1573. limit which the manual states is 9999, but the Guide agrees with
  1574. the actual imposed limit of 2999\.
  1575. .sp
  1576. This function can be useful in calender type programs that indicate
  1577. when holidays occur\.
  1578. .sp
  1579. .in 0.08i
  1580. \fBExamples
  1581. .sp
  1582. .in 0.4i
  1583. .ta 2.56i
  1584. dEdate := FT_EASTER( 1990 )    && returns 04/15/1990
  1585. .br
  1586. .ta
  1587. .sp
  1588. .in 0.08i
  1589. \fBSource:\fR EASTER\.PRG
  1590. .sp
  1591. \fBAuthor:\fR Paul Tucker
  1592. .in 0i
  1593. .ta 1.63265i
  1594. .sp 2
  1595. .ne 20
  1596. .ps +3
  1597. .vs +3
  1598. FT_ELAPMIN()    Return difference, in minutes, between two mil format times\.
  1599. .br
  1600. .ta
  1601. .in 0.08i
  1602. .ps -3
  1603. .vs -3
  1604. .sp 2
  1605. \fBFT_ELAPMIN()
  1606. Return difference, in minutes, between two mil format times\.
  1607. .in 0i
  1608. .br
  1609. \l'6.24i'
  1610. .br
  1611. .sp
  1612. .in 0.08i
  1613. \fBSyntax
  1614. .sp
  1615. .in 0.4i
  1616. \fBFT_ELAPMIN( <cTIME1>, <cTIME2> ) -> nMINUTES
  1617. .sp
  1618. .in 0.08i
  1619. \fBArguments
  1620. .sp
  1621. .in 0.4i
  1622. .ta 1.44i
  1623. \fB<cTIME1, cTIME2>\fR    character strings of military form "hhmm",
  1624. .br
  1625. .ta
  1626. .in 0.72i
  1627. where 0\fB<=hh\fR<24\.
  1628. .sp
  1629. .in 0.08i
  1630. \fBReturns
  1631. .sp
  1632. .in 0.4i
  1633. <nMINUTES>
  1634. .sp
  1635. .in 0.08i
  1636. \fBDescription
  1637. .sp
  1638. .in 0.4i
  1639. Finds the arithmetic difference between time two times
  1640. (time 2 - time 1)\.
  1641. If time 2 is smaller than time 1, a NEGATIVE value is returned\.
  1642. .sp
  1643. .in 0.08i
  1644. \fBExamples
  1645. .sp
  1646. .in 0.4i
  1647. .ta 2.64i
  1648. .br
  1649. FT_ELAPMIN( "1718", "2040" ) ->    322
  1650. .br
  1651. .ta
  1652. .br
  1653. FT_ELAPMIN( "2040", "1718" ) -> -322
  1654. .sp
  1655. .in 0.08i
  1656. \fBSource:\fR ELAPMIL\.PRG
  1657. .sp
  1658. \fBAuthor:\fR Alexander B\. Spencer
  1659. .in 0i
  1660. .sp
  1661. .in 1.5i
  1662. .ti -1.5i
  1663. .ta 1.5i
  1664. .ft B
  1665. See Also:    
  1666. .ft R
  1667. FT_ELTIME()
  1668. , FT_MIL2MIN()
  1669. , FT_MIN2MIL()
  1670. .ta 1.63265i
  1671. .in 0i
  1672. .sp 2
  1673. .ne 20
  1674. .ps +3
  1675. .vs +3
  1676. FT_ELAPSED()    Return elapsed time between two days and/or times
  1677. .br
  1678. .ta
  1679. .in 0.08i
  1680. .ps -3
  1681. .vs -3
  1682. .sp 2
  1683. \fBFT_ELAPSED()
  1684. Return elapsed time between two days and/or times
  1685. .in 0i
  1686. .br
  1687. \l'6.24i'
  1688. .br
  1689. .sp
  1690. .in 0.08i
  1691. \fBSyntax
  1692. .sp
  1693. .in 0.4i
  1694. \fBFT_ELAPSED([ <dStart> ], [ <dEnd> ], ;
  1695. .in 1.28i
  1696. \fB<cTimeStart>, <cTimeEnd>) -> aTimedata
  1697. .sp
  1698. .in 0.08i
  1699. \fBArguments
  1700. .sp
  1701. .in 0.4i
  1702. \fB<dStart>\fR is any valid date in any date format\. Defaults to DATE()\.
  1703. .sp
  1704. \fB<dEnd>\fR is any valid date in any date format\. Defaults to DATE()\.
  1705. .sp
  1706. \fB<cTimeStart>\fR is a valid Time string of the format \'hh:mm:ss\' where
  1707. hh is hours in 24-hour format\.
  1708. .sp
  1709. \fB<cTimeEnd>\fR is a valid Time string of the format \'hh:mm:ss\' where
  1710. hh is hours in 24-hour format\.
  1711. .sp
  1712. .in 0.08i
  1713. \fBReturns
  1714. .sp
  1715. .in 0.4i
  1716. A two-dimensional array containing elapsed time data\.
  1717. .sp
  1718. .in 0.08i
  1719. \fBDescription
  1720. .sp
  1721. .in 0.4i
  1722. FT_ELAPSED() calculates the elapsed time between two Date/Time events\.
  1723. .sp
  1724. It returns an array which contains the following data:
  1725. .sp
  1726. .ta 1.12i 2.56i 4.72i
  1727. aRetVal[1,1]    Integer Days    aRetVal[1,2] Total Days    (nn\.nnnn)
  1728. .br
  1729. .ta
  1730. .ta 1.12i 2.56i 4.72i
  1731. aRetVal[2,1]    Integer Hours    aRetVal[2,2] Total Hours    (nn\.nnnn)
  1732. .br
  1733. .ta
  1734. .ta 1.12i 2.56i
  1735. aRetVal[3,1]    Integer Minutes    aRetVal[3,2] Total Minutes (nn\.nnnn)
  1736. .br
  1737. .ta
  1738. .ta 1.12i 2.56i
  1739. aRetVal[4,1]    Integer Seconds    aRetVal[4,2] Total Seconds (nn)
  1740. .br
  1741. .ta
  1742. .sp
  1743. .in 0.08i
  1744. \fBExamples
  1745. .sp
  1746. .in 0.4i
  1747. FT_ELAPSED(CTOD(\'11/28/90\'), CTOD(\'11/30/90\'), \'08:00:00\', \'12:10:30\')
  1748. will return:
  1749. .sp
  1750. .ta 1.36i 2.64i 4.16i 4.8i
  1751. aRetVal[1,1] ->    2 (Days)    aRetVal[1,2] ->    2\.1740    Days
  1752. .br
  1753. .ta
  1754. .ta 1.36i 2.64i 4.08i 4.8i
  1755. aRetVal[2,1] ->    4 (Hours)    aRetVal[2,2] ->    52\.1750    Hours
  1756. .br
  1757. .ta
  1758. .ta 2.64i 4.8i
  1759. aRetVal[3,1] -> 10 (Minutes)    aRetVal[3,2] -> 3130\.5000    Minutes
  1760. .br
  1761. .ta
  1762. .ta 2.64i 4.8i
  1763. aRetVal[4,1] -> 30 (Seconds)    aRetVal[4,2] -> 187830    Seconds
  1764. .br
  1765. .ta
  1766. .sp
  1767. .in 0.08i
  1768. \fBSource:\fR ELAPSED\.PRG
  1769. .sp
  1770. \fBAuthor:\fR Jo W\. French dba Practical Computing
  1771. .in 0i
  1772. .ta 1.63265i
  1773. .sp 2
  1774. .ne 20
  1775. .ps +3
  1776. .vs +3
  1777. FT_ELTIME()    Compute difference between times in hours, minutes, seconds\.
  1778. .br
  1779. .ta
  1780. .in 0.08i
  1781. .ps -3
  1782. .vs -3
  1783. .sp 2
  1784. \fBFT_ELTIME()
  1785. Compute difference between times in hours, minutes, seconds\.
  1786. .in 0i
  1787. .br
  1788. \l'6.24i'
  1789. .br
  1790. .sp
  1791. .in 0.08i
  1792. \fBSyntax
  1793. .sp
  1794. .in 0.4i
  1795. \fBFT_ELTIME( <cTime1>, <cTime2> ) -> cDiff
  1796. .sp
  1797. .in 0.08i
  1798. \fBArguments
  1799. .sp
  1800. .in 0.4i
  1801. .ta 1.44i
  1802. \fB<cTime1, cTime2>\fR    character strings representing times in
  1803. .br
  1804. .ta
  1805. .in 0.64i
  1806. hh:mm:ss format\.
  1807. .sp
  1808. .in 0.08i
  1809. \fBReturns
  1810. .sp
  1811. .in 0.4i
  1812. .ta 0.72i
  1813. <cDiff>    character string representing time difference in
  1814. .br
  1815. .ta
  1816. .in 0.64i
  1817. hh:mm:ss format\.
  1818. .sp
  1819. .in 0.08i
  1820. \fBDescription
  1821. .sp
  1822. .in 0.4i
  1823. Return the absolute difference between two times in hh:mm:ss format
  1824. in character hours, minutes and seconds (hh:mm:ss)\.
  1825. .sp
  1826. .in 0.08i
  1827. \fBExamples
  1828. .sp
  1829. .in 0.4i
  1830. .br
  1831. FT_ELTIME( "22:40:12", "23:55:17" ) -> 01:15:05
  1832. .br
  1833. FT_ELTIME( "23:55:17", "22:40:12" ) -> 01:15:05
  1834. .sp
  1835. .in 0.08i
  1836. \fBSource:\fR ELTIME\.PRG
  1837. .sp
  1838. \fBAuthor:\fR Alexander B\. Spencer
  1839. .in 0i
  1840. .sp
  1841. .in 1.5i
  1842. .ti -1.5i
  1843. .ta 1.5i
  1844. .ft B
  1845. See Also:    
  1846. .ft R
  1847. FT_ELAPMIN()
  1848. , FT_MIL2MIN()
  1849. , FT_MIN2MIL()
  1850. .ta 1.63265i
  1851. .in 0i
  1852. .sp 2
  1853. .ne 20
  1854. .ps +3
  1855. .vs +3
  1856. FT_FDAY()    Return first day of the month
  1857. .br
  1858. .ta
  1859. .in 0.08i
  1860. .ps -3
  1861. .vs -3
  1862. .sp 2
  1863. \fBFT_FDAY()
  1864. Return first day of the month
  1865. .in 0i
  1866. .br
  1867. \l'6.24i'
  1868. .br
  1869. .sp
  1870. .in 0.08i
  1871. \fBSyntax
  1872. .sp
  1873. .in 0.4i
  1874. \fBFT_FDAY( [ <dDateToChk> ] ) -> dFirstDay
  1875. .sp
  1876. .in 0.08i
  1877. \fBArguments
  1878. .sp
  1879. .in 0.4i
  1880. \fB<dDateToChk>\fR is a date within a month for which you want to find
  1881. the first date of that month\.  If not passed or is an incorrect type,
  1882. defaults to current system date\.
  1883. .sp
  1884. .in 0.08i
  1885. \fBReturns
  1886. .sp
  1887. .in 0.4i
  1888. A Clipper date value representing the first date of the month\.
  1889. .sp
  1890. .in 0.08i
  1891. \fBDescription
  1892. .sp
  1893. .in 0.4i
  1894. This function will return the first day of the month of the date
  1895. passed, or the first day of the current month if no argument is
  1896. supplied\.
  1897. .sp
  1898. .in 0.08i
  1899. \fBExamples
  1900. .sp
  1901. .in 0.4i
  1902. dDate := CTOD( "09/15/90" )
  1903. .ta 2.48i
  1904. ? FT_FDAY( dDate )    // 09/01/90
  1905. .br
  1906. .ta
  1907. .ta 2.48i 3.52i
  1908. ? FT_FDAY()    // 03/01/91    (current month)
  1909. .br
  1910. .ta
  1911. .sp
  1912. .in 0.08i
  1913. \fBSource:\fR FIRSTDAY\.PRG
  1914. .sp
  1915. \fBAuthor:\fR Jeff Bryant
  1916. .in 0i
  1917. .sp
  1918. .in 1.5i
  1919. .ti -1.5i
  1920. .ta 1.5i
  1921. .ft B
  1922. See Also:    
  1923. .ft R
  1924. FT_LDAY()
  1925. .ta 1.63265i
  1926. .in 0i
  1927. .sp 2
  1928. .ne 20
  1929. .ps +3
  1930. .vs +3
  1931. FT_LDAY()    Return last day of the month
  1932. .br
  1933. .ta
  1934. .in 0.08i
  1935. .ps -3
  1936. .vs -3
  1937. .sp 2
  1938. \fBFT_LDAY()
  1939. Return last day of the month
  1940. .in 0i
  1941. .br
  1942. \l'6.24i'
  1943. .br
  1944. .sp
  1945. .in 0.08i
  1946. \fBSyntax
  1947. .sp
  1948. .in 0.4i
  1949. \fBFT_LDAY( [ <dDateToChk> ] ) -> dLastDay
  1950. .sp
  1951. .in 0.08i
  1952. \fBArguments
  1953. .sp
  1954. .in 0.4i
  1955. \fB<dDateToChk>\fR is a date within a month for which you want to find
  1956. the last date of that month\.  If not passed or is an incorrect
  1957. type, defaults to current system date\.
  1958. .sp
  1959. .in 0.08i
  1960. \fBReturns
  1961. .sp
  1962. .in 0.4i
  1963. A Clipper date value representing the last date of the month\.
  1964. .sp
  1965. .in 0.08i
  1966. \fBDescription
  1967. .sp
  1968. .in 0.4i
  1969. This function will return the last day of the month of the date
  1970. passed, or the last day of the current month if no argument is
  1971. supplied\.
  1972. .sp
  1973. .in 0.08i
  1974. \fBExamples
  1975. .sp
  1976. .in 0.4i
  1977. dDate := CTOD( "09/15/90" )
  1978. .ta 2.48i
  1979. ? FT_LDAY( dDate )    // 09/30/90
  1980. .br
  1981. .ta
  1982. .ta 2.48i 3.52i
  1983. ? FT_LDAY()    // 03/31/91    (current month)
  1984. .br
  1985. .ta
  1986. .sp
  1987. .in 0.08i
  1988. \fBSource:\fR LASTDAY\.PRG
  1989. .sp
  1990. \fBAuthor:\fR Mike Schinkel
  1991. .in 0i
  1992. .sp
  1993. .in 1.5i
  1994. .ti -1.5i
  1995. .ta 1.5i
  1996. .ft B
  1997. See Also:    
  1998. .ft R
  1999. FT_FDAY()
  2000. .ta 1.63265i
  2001. .in 0i
  2002. .sp 2
  2003. .ne 20
  2004. .ps +3
  2005. .vs +3
  2006. FT_MADD()    Add or subtract months to/from a date
  2007. .br
  2008. .ta
  2009. .in 0.08i
  2010. .ps -3
  2011. .vs -3
  2012. .sp 2
  2013. \fBFT_MADD()
  2014. Add or subtract months to/from a date
  2015. .in 0i
  2016. .br
  2017. \l'6.24i'
  2018. .br
  2019. .sp
  2020. .in 0.08i
  2021. \fBSyntax
  2022. .sp
  2023. .in 0.4i
  2024. \fBFT_MADD( [ <dGivenDate> ], [ <nAddMonths> ], [ <lMakeEOM> ] )
  2025. .in 0.72i
  2026. \fB-> dDate
  2027. .sp
  2028. .in 0.08i
  2029. \fBArguments
  2030. .sp
  2031. .in 0.4i
  2032. \fB<dGivenDate>\fR is any valid date in any date format\. Defaults to
  2033. current system date if not supplied\.
  2034. .sp
  2035. \fB<nAddMonths>\fR is the number of months to be added or subtracted\.
  2036. Defaults to 0 if not supplied\.
  2037. .sp
  2038. \fB<lMakeEOM>\fR is a logical variable indicating whether or not to
  2039. .in 0.56i
  2040. force the returned date to the last date of the month\.  It only
  2041. affects the returned date if \fB<dGivenDate>\fR is an end-of-month date\.
  2042. .in 0.4i
  2043. Defaults to false except for month of February\.
  2044. .sp
  2045. .in 0.08i
  2046. \fBReturns
  2047. .sp
  2048. .in 0.4i
  2049. A date\.
  2050. .sp
  2051. .in 0.08i
  2052. \fBDescription
  2053. .sp
  2054. .in 0.4i
  2055. FT_MADD() adds or subtracts months to/from a given date\.
  2056. .sp
  2057. If MakeEOM is passed and dGivenDate is the last day of a month,
  2058. if will return the EOM of calculated month\.  Otherwise it will
  2059. return the same day as the day of the passed date\.
  2060. .sp
  2061. .in 0.08i
  2062. \fBExamples
  2063. .sp
  2064. .in 0.4i
  2065. dDate := CTOD( "09/15/90" )
  2066. .ta 2.32i
  2067. ? FT_MADD( dDate, 1 )    // 10/15/90
  2068. .br
  2069. .ta
  2070. .ta 2.32i
  2071. ? FT_MADD( dDate, -2 )    // 07/15/90
  2072. .br
  2073. .ta
  2074. .sp
  2075. // force EOM
  2076. dDate := CTOD( "04/30/91" )
  2077. .ta 2.32i
  2078. ? FT_MADD( dDate, 1 )    // 05/30/91
  2079. .br
  2080. .ta
  2081. .ta 2.32i 3.36i
  2082. ? FT_MADD( dDate, 1, \.T\. )    // 05/31/91    <- forced EOM
  2083. .br
  2084. .ta
  2085. .ta 2.32i
  2086. ? FT_MADD( dDate, 2 )    // 06/30/91
  2087. .br
  2088. .ta
  2089. .ta 2.32i 3.36i
  2090. ? FT_MADD( dDate, 2, \.T\. )    // 06/30/91    <- June only has 30 days
  2091. .br
  2092. .ta
  2093. .ta 2.32i
  2094. ? FT_MADD( dDate, 3 )    // 07/30/91
  2095. .br
  2096. .ta
  2097. .ta 2.32i 3.36i
  2098. ? FT_MADD( dDate, 3, \.T\. )    // 07/31/91    <- forced EOM
  2099. .br
  2100. .ta
  2101. .sp
  2102. .sp
  2103. .in 0.08i
  2104. \fBSource:\fR MADD\.PRG
  2105. .sp
  2106. \fBAuthor:\fR Jo W\. French dba Practical Computing
  2107. .in 0i
  2108. .sp
  2109. .in 1.5i
  2110. .ti -1.5i
  2111. .ta 1.5i
  2112. .ft B
  2113. See Also:    
  2114. .ft R
  2115. FT_DAYOFYR()
  2116. , FT_DAYTOBOW()
  2117. .ta 1.63265i
  2118. .in 0i
  2119. .sp 2
  2120. .ne 20
  2121. .ps +3
  2122. .vs +3
  2123. FT_MIL2CIV()    Convert time in military format to civilian format\.
  2124. .br
  2125. .ta
  2126. .in 0.08i
  2127. .ps -3
  2128. .vs -3
  2129. .sp 2
  2130. \fBFT_MIL2CIV()
  2131. Convert time in military format to civilian format\.
  2132. .in 0i
  2133. .br
  2134. \l'6.24i'
  2135. .br
  2136. .sp
  2137. .in 0.08i
  2138. \fBSyntax
  2139. .sp
  2140. .in 0.4i
  2141. \fBFT_MIL2CIV( <cCIVTIME> ) -> dMILTIME
  2142. .sp
  2143. .in 0.08i
  2144. \fBArguments
  2145. .sp
  2146. .in 0.4i
  2147. .ta 0.96i
  2148. \fB<cMILTIME>\fR    character string of form hhmm, where 0\fB<=hh\fR<24\.
  2149. .br
  2150. .ta
  2151. .sp
  2152. .in 0.08i
  2153. \fBReturns
  2154. .sp
  2155. .in 0.4i
  2156. .ta 0.96i
  2157. <cCIVTIME>    character string of form hh:mm (am,pm,n or m),
  2158. .br
  2159. .ta
  2160. .in 0.64i
  2161. where 0<hh<12\.
  2162. .sp
  2163. .in 0.08i
  2164. \fBDescription
  2165. .sp
  2166. .in 0.4i
  2167. Converts time from military to civilian format
  2168. .sp
  2169. .in 0.08i
  2170. \fBExamples
  2171. .sp
  2172. .in 0.4i
  2173. .ta 2i
  2174. FT_MIL2CIV( "1640" ) ->    4:40 pm
  2175. .br
  2176. .ta
  2177. .sp
  2178. .ta 2i
  2179. FT_MIL2CIV( "0440" ) ->    4:40 am
  2180. .br
  2181. .ta
  2182. .sp
  2183. FT_MIL2CIV( "1200" ) -> 12:00 n
  2184. .sp
  2185. FT_MIL2CIV( "0000" ) and FT_MIL2CIV( "2400" ) -> 12:00 m
  2186. .sp
  2187. Caution:  leading blanks are irrelevant\.
  2188. .sp
  2189. .in 0.08i
  2190. \fBSource:\fR MILTIME\.PRG
  2191. .sp
  2192. \fBAuthor:\fR Alexander B\. Spencer
  2193. .in 0i
  2194. .sp
  2195. .in 1.5i
  2196. .ti -1.5i
  2197. .ta 1.5i
  2198. .ft B
  2199. See Also:    
  2200. .ft R
  2201. FT_CIV2MIL()
  2202. , FT_SYS2MIL()
  2203. , FT_MIL2MIN()
  2204. , FT_MIN2MIL()
  2205. .ta 1.63265i
  2206. .in 0i
  2207. .sp 2
  2208. .ne 20
  2209. .ps +3
  2210. .vs +3
  2211. FT_MIL2MIN()    Convert time in military format to number of minute of day\.
  2212. .br
  2213. .ta
  2214. .in 0.08i
  2215. .ps -3
  2216. .vs -3
  2217. .sp 2
  2218. \fBFT_MIL2MIN()
  2219. Convert time in military format to number of minute of day\.
  2220. .in 0i
  2221. .br
  2222. \l'6.24i'
  2223. .br
  2224. .sp
  2225. .in 0.08i
  2226. \fBSyntax
  2227. .sp
  2228. .in 0.4i
  2229. \fBFT_MIL2MIN( <cMILTIME> ) -> nMINUTE
  2230. .sp
  2231. .in 0.08i
  2232. \fBArguments
  2233. .sp
  2234. .in 0.4i
  2235. .ta 0.96i
  2236. \fB<cMILTIME>\fR    character string of form hhmm, where 0\fB<=hh\fR<24\.
  2237. .br
  2238. .ta
  2239. .sp
  2240. .in 0.08i
  2241. \fBReturns
  2242. .sp
  2243. .in 0.4i
  2244. .ta 1.04i
  2245. <nMINOFDAY>    numeric value representing minute of day\.
  2246. .br
  2247. .ta
  2248. .sp
  2249. .in 0.08i
  2250. \fBDescription
  2251. .sp
  2252. .in 0.4i
  2253. Converts time in military format to number of minute of the day\.
  2254. .sp
  2255. .in 0.08i
  2256. \fBExamples
  2257. .sp
  2258. .in 0.4i
  2259. FT_MIL2MIN( "1729" ) -> 1049
  2260. .sp
  2261. .in 0.08i
  2262. \fBSource:\fR MILTIME\.PRG
  2263. .sp
  2264. \fBAuthor:\fR Alexander B\. Spencer
  2265. .in 0i
  2266. .sp
  2267. .in 1.5i
  2268. .ti -1.5i
  2269. .ta 1.5i
  2270. .ft B
  2271. See Also:    
  2272. .ft R
  2273. FT_MIN2MIL()
  2274. , FT_CIV2MIL()
  2275. , FT_MIL2CIV()
  2276. , FT_SYS2MIL()
  2277. .ta 1.63265i
  2278. .in 0i
  2279. .sp 2
  2280. .ne 20
  2281. .ps +3
  2282. .vs +3
  2283. FT_MIN2DHM()    Convert numeric minutes to days, hours and minutes\.
  2284. .br
  2285. .ta
  2286. .in 0.08i
  2287. .ps -3
  2288. .vs -3
  2289. .sp 2
  2290. \fBFT_MIN2DHM()
  2291. Convert numeric minutes to days, hours and minutes\.
  2292. .in 0i
  2293. .br
  2294. \l'6.24i'
  2295. .br
  2296. .sp
  2297. .in 0.08i
  2298. \fBSyntax
  2299. .sp
  2300. .in 0.4i
  2301. \fBFT_MIN2DHM( <nMinutes> ) -> aDHM_
  2302. .sp
  2303. .in 0.08i
  2304. \fBArguments
  2305. .sp
  2306. .in 0.4i
  2307. .ta 0.96i
  2308. \fB<nMinutes>\fR    the number of minutes\.
  2309. .br
  2310. .ta
  2311. .sp
  2312. .in 0.08i
  2313. \fBReturns
  2314. .sp
  2315. .in 0.4i
  2316. <aDHM_>
  2317. .in 0.64i
  2318. where:
  2319. .in 0.88i
  2320. aDHM_[1] = cDAYS, aDHM_[2] = cHours, aDHM_[3] = cMinutes
  2321. .sp
  2322. .in 0.08i
  2323. \fBDescription
  2324. .sp
  2325. .in 0.4i
  2326. Converts numeric minutes into a character array containing
  2327. days, hours & minutes\.
  2328. .sp
  2329. .in 0.08i
  2330. \fBExamples
  2331. .sp
  2332. .in 0.4i
  2333. aDHM_ = MIN2DHM(16789) -> aDHM_[1] = 11, aDHM_[2] = 15, aDHM_[3] = 49
  2334. .sp
  2335. .in 0.08i
  2336. \fBSource:\fR MIN2DHM\.PRG
  2337. .sp
  2338. \fBAuthor:\fR Alexander B\. Spencer
  2339. .in 0i
  2340. .ta 1.63265i
  2341. .sp 2
  2342. .ne 20
  2343. .ps +3
  2344. .vs +3
  2345. FT_MIN2MIL()    Convert minute of day to military format time\.
  2346. .br
  2347. .ta
  2348. .in 0.08i
  2349. .ps -3
  2350. .vs -3
  2351. .sp 2
  2352. \fBFT_MIN2MIL()
  2353. Convert minute of day to military format time\.
  2354. .in 0i
  2355. .br
  2356. \l'6.24i'
  2357. .br
  2358. .sp
  2359. .in 0.08i
  2360. \fBSyntax
  2361. .sp
  2362. .in 0.4i
  2363. \fBFT_MIN2MIL( <nMINUTE> ) -> cMILTIME
  2364. .sp
  2365. .in 0.08i
  2366. \fBArguments
  2367. .sp
  2368. .in 0.4i
  2369. .ta 0.88i
  2370. \fB<nMINUTE>\fR    numeric integer representing minute of day\.
  2371. .br
  2372. .ta
  2373. .sp
  2374. .in 0.08i
  2375. \fBReturns
  2376. .sp
  2377. .in 0.4i
  2378. .ta 0.96i
  2379. <cMILTIME>    character string of form hhmm, where 0<=hh<24\.
  2380. .br
  2381. .ta
  2382. .sp
  2383. .in 0.08i
  2384. \fBDescription
  2385. .sp
  2386. .in 0.4i
  2387. Converts minute of the day to military format time\.
  2388. .sp
  2389. .in 0.08i
  2390. \fBExamples
  2391. .sp
  2392. .in 0.4i
  2393. FT_MIN2MIL( 279 ) -> 0439
  2394. .sp
  2395. .in 0.08i
  2396. \fBSource:\fR MILTIME\.PRG
  2397. .sp
  2398. \fBAuthor:\fR Alexander B\. Spencer
  2399. .in 0i
  2400. .sp
  2401. .in 1.5i
  2402. .ti -1.5i
  2403. .ta 1.5i
  2404. .ft B
  2405. See Also:    
  2406. .ft R
  2407. FT_MIL2MIN()
  2408. , FT_MIL2CIV()
  2409. , FT_CIV2MIL()
  2410. , FT_SYS2MIL()
  2411. .ta 1.63265i
  2412. .in 0i
  2413. .sp 2
  2414. .ne 20
  2415. .ps +3
  2416. .vs +3
  2417. FT_MONTH()    Return Calendar or Fiscal Month Data
  2418. .br
  2419. .ta
  2420. .in 0.08i
  2421. .ps -3
  2422. .vs -3
  2423. .sp 2
  2424. \fBFT_MONTH()
  2425. Return Calendar or Fiscal Month Data
  2426. .in 0i
  2427. .br
  2428. \l'6.24i'
  2429. .br
  2430. .sp
  2431. .in 0.08i
  2432. \fBSyntax
  2433. .sp
  2434. .in 0.4i
  2435. \fBFT_MONTH( [ <dGivenDate> ], [nMonthNum] ) -> aDateInfo
  2436. .sp
  2437. .in 0.08i
  2438. \fBArguments
  2439. .sp
  2440. .in 0.4i
  2441. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  2442. to current system date if not supplied\.
  2443. .sp
  2444. \fB<nMonthNum>\fR is a number from 1 to 12 signifying a month\.
  2445. Defaults to current month if not supplied\.
  2446. .sp
  2447. .in 0.08i
  2448. \fBReturns
  2449. .sp
  2450. .in 0.4i
  2451. A three element array containing the following data:
  2452. .sp
  2453. .in 0.64i
  2454. .br
  2455. aDateInfo[1] - The year and month as a character string "YYYYMM"
  2456. .br
  2457. aDateInfo[2] - The beginning date of the month
  2458. .br
  2459. aDateInfo[3] - The ending date of the month
  2460. .sp
  2461. .in 0.08i
  2462. \fBDescription
  2463. .sp
  2464. .in 0.4i
  2465. FT_MONTH() returns an array containing data about the month
  2466. containing the given date\.
  2467. .sp
  2468. Normally the return data will be based on a year beginning
  2469. on January 1st with weeks beginning on Sunday\.
  2470. .sp
  2471. The beginning of year date and/or beginning of week day can be
  2472. changed by using FT_DATECNFG(), which will affect all subsequent
  2473. calls to FT_MONTH() until another call to FT_DATECNFG()\.
  2474. .sp
  2475. The beginning of year date and beginning of week day may be reset
  2476. to January 1 and Sunday by calling FT_DATECNFG() with no
  2477. parameters\.
  2478. .sp
  2479. .in 0.08i
  2480. \fBExamples
  2481. .sp
  2482. .in 0.4i
  2483. .br
  2484. // get info about month containing 9/15/90
  2485. .br
  2486. aDateInfo := FT_MONTH( CTOD("09/15/90") )
  2487. .ta 1.36i 1.68i 2.72i
  2488. .br
  2489. ? aDateInfo[1]    //    199009    (9th month)
  2490. .br
  2491. .ta
  2492. .ta 1.36i 1.68i 2.72i
  2493. .br
  2494. ? aDateInfo[2]    //    09/01/90    beginning of month 9
  2495. .br
  2496. .ta
  2497. .ta 1.36i 1.68i 2.72i
  2498. .br
  2499. ? aDateInfo[3]    //    09/30/90    end of week month 9
  2500. .br
  2501. .ta
  2502. .sp
  2503. .br
  2504. // get info about month 5 in year containing 9/15/90
  2505. .br
  2506. aDateInfo := FT_MONTH( CTOD("09/15/90"), 5 )
  2507. .ta 1.36i 1.68i
  2508. .br
  2509. ? aDateInfo[1]    //    199005
  2510. .br
  2511. .ta
  2512. .ta 1.36i 1.68i 2.56i
  2513. .br
  2514. ? aDateInfo[2]    //    05/01/90    beginning of month 5
  2515. .br
  2516. .ta
  2517. .ta 1.36i 1.68i 2.56i
  2518. .br
  2519. ? aDateInfo[3]    //    05/31/90    end of month 5
  2520. .br
  2521. .ta
  2522. .sp
  2523. .br
  2524. // get info about month 5 in current year
  2525. .br
  2526. aDateInfo := FT_MONTH( , 5 )
  2527. .ta 1.36i 1.68i
  2528. .br
  2529. ? aDateInfo[1]    //    199105
  2530. .br
  2531. .ta
  2532. .ta 1.36i 1.68i 2.56i
  2533. .br
  2534. ? aDateInfo[2]    //    05/01/91    beginning of month 5
  2535. .br
  2536. .ta
  2537. .ta 1.36i 1.68i 2.56i
  2538. .br
  2539. ? aDateInfo[3]    //    05/31/91    end of month 5
  2540. .br
  2541. .ta
  2542. .sp
  2543. .in 0.08i
  2544. \fBSource:\fR MONTH\.PRG
  2545. .sp
  2546. \fBAuthor:\fR Jo W\. French dba Practical Computing
  2547. .in 0i
  2548. .sp
  2549. .in 1.5i
  2550. .ti -1.5i
  2551. .ta 1.5i
  2552. .ft B
  2553. See Also:    
  2554. .ft R
  2555. FT_DATECNFG()
  2556. , FT_WEEK()
  2557. , FT_QTR()
  2558. , FT_YEAR()
  2559. .ta 1.63265i
  2560. .in 0i
  2561. .sp 2
  2562. .ne 20
  2563. .ps +3
  2564. .vs +3
  2565. FT_QTR()    Return Calendar or Fiscal Quarter Data\.
  2566. .br
  2567. .ta
  2568. .in 0.08i
  2569. .ps -3
  2570. .vs -3
  2571. .sp 2
  2572. \fBFT_QTR()
  2573. Return Calendar or Fiscal Quarter Data\.
  2574. .in 0i
  2575. .br
  2576. \l'6.24i'
  2577. .br
  2578. .sp
  2579. .in 0.08i
  2580. \fBSyntax
  2581. .sp
  2582. .in 0.4i
  2583. \fBFT_QTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateInfo
  2584. .sp
  2585. .in 0.08i
  2586. \fBArguments
  2587. .sp
  2588. .in 0.4i
  2589. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  2590. to current system date if not supplied\.
  2591. .sp
  2592. \fB<nQtrNum>\fR is a number from 1 to 4 signifying a quarter\.
  2593. Defaults to current quarter if not supplied\.
  2594. .sp
  2595. .in 0.08i
  2596. \fBReturns
  2597. .sp
  2598. .in 0.4i
  2599. A three element array containing the following data:
  2600. .sp
  2601. .in 0.64i
  2602. .br
  2603. aDateInfo[1] - The year and quarter as a character string "YYYYQQ"
  2604. .br
  2605. aDateInfo[2] - The beginning date of the quarter
  2606. .br
  2607. aDateInfo[3] - The ending date of the quarter
  2608. .sp
  2609. .in 0.08i
  2610. \fBDescription
  2611. .sp
  2612. .in 0.4i
  2613. FT_QTR() returns an array containing data about the quarter
  2614. containing the given date\.
  2615. .sp
  2616. Normally the return data will be based on a year beginning
  2617. on January 1st with weeks beginning on Sunday\.
  2618. .sp
  2619. The beginning of year date and/or beginning of week day can be
  2620. changed by using FT_DATECNFG(), which will affect all subsequent
  2621. calls to FT_QTR() until another call to FT_DATECNFG()\.
  2622. .sp
  2623. The beginning of year date and beginning of week day may be reset
  2624. to January 1 and Sunday by calling FT_DATECNFG() with no
  2625. parameters\.
  2626. .sp
  2627. .in 0.08i
  2628. \fBExamples
  2629. .sp
  2630. .in 0.4i
  2631. .br
  2632. // get info about quarter containing 9/15/90
  2633. .br
  2634. aDateInfo := FT_MONTH( CTOD("09/15/90") )
  2635. .ta 1.36i 1.68i 2.72i
  2636. .br
  2637. ? aDateInfo[1]    //    199009    (3rd quarter)
  2638. .br
  2639. .ta
  2640. .ta 1.36i 1.68i 2.72i
  2641. .br
  2642. ? aDateInfo[2]    //    07/01/90    beginning of quarter 3
  2643. .br
  2644. .ta
  2645. .ta 1.36i 1.68i 2.72i
  2646. .br
  2647. ? aDateInfo[3]    //    09/30/90    end of week quarter 3
  2648. .br
  2649. .ta
  2650. .sp
  2651. .br
  2652. // get info about quarter 2 in year containing 9/15/90
  2653. .br
  2654. aDateInfo := FT_MONTH( CTOD("09/15/90"), 2 )
  2655. .ta 1.36i 1.68i
  2656. .br
  2657. ? aDateInfo[1]    //    199002
  2658. .br
  2659. .ta
  2660. .ta 1.36i 1.68i 2.56i
  2661. .br
  2662. ? aDateInfo[2]    //    04/01/90    beginning of quarter 2
  2663. .br
  2664. .ta
  2665. .ta 1.36i 1.68i 2.56i
  2666. .br
  2667. ? aDateInfo[3]    //    06/30/90    end of quarter 2
  2668. .br
  2669. .ta
  2670. .sp
  2671. .br
  2672. // get info about quarter 2 in current year
  2673. .br
  2674. aDateInfo := FT_MONTH( , 2 )
  2675. .ta 1.36i 1.68i
  2676. .br
  2677. ? aDateInfo[1]    //    199102
  2678. .br
  2679. .ta
  2680. .ta 1.36i 1.68i 2.56i
  2681. .br
  2682. ? aDateInfo[2]    //    04/01/91    beginning of quarter 2
  2683. .br
  2684. .ta
  2685. .ta 1.36i 1.68i 2.56i
  2686. .br
  2687. ? aDateInfo[3]    //    06/30/91    end of quarter 2
  2688. .br
  2689. .ta
  2690. .sp
  2691. .in 0.08i
  2692. \fBSource:\fR QTR\.PRG
  2693. .sp
  2694. \fBAuthor:\fR Jo W\. French dba Practical Computing
  2695. .in 0i
  2696. .sp
  2697. .in 1.5i
  2698. .ti -1.5i
  2699. .ta 1.5i
  2700. .ft B
  2701. See Also:    
  2702. .ft R
  2703. FT_DATECNFG()
  2704. , FT_WEEK()
  2705. , FT_MONTH()
  2706. , FT_YEAR()
  2707. .ta 1.63265i
  2708. .in 0i
  2709. .sp 2
  2710. .ne 20
  2711. .ps +3
  2712. .vs +3
  2713. FT_SYS2MIL()    Convert system time to military time format\.
  2714. .br
  2715. .ta
  2716. .in 0.08i
  2717. .ps -3
  2718. .vs -3
  2719. .sp 2
  2720. \fBFT_SYS2MIL()
  2721. Convert system time to military time format\.
  2722. .in 0i
  2723. .br
  2724. \l'6.24i'
  2725. .br
  2726. .sp
  2727. .in 0.08i
  2728. \fBSyntax
  2729. .sp
  2730. .in 0.4i
  2731. \fBFT_SYS2MIL() -> cMILTIME
  2732. .sp
  2733. .in 0.08i
  2734. \fBArguments
  2735. .sp
  2736. .in 0.4i
  2737. none
  2738. .sp
  2739. .in 0.08i
  2740. \fBReturns
  2741. .sp
  2742. .in 0.4i
  2743. .ta 0.96i
  2744. <cMILTIME>    character string of form hhmm, where 0<=hh<24\.
  2745. .br
  2746. .ta
  2747. .sp
  2748. .in 0.08i
  2749. \fBDescription
  2750. .sp
  2751. .in 0.4i
  2752. Return current system time as character string in military format\.
  2753. .sp
  2754. .in 0.08i
  2755. \fBExamples
  2756. .sp
  2757. .in 0.4i
  2758. FT_SYS2MIL() -> 1623
  2759. .sp
  2760. .in 0.08i
  2761. \fBSource:\fR MILTIME\.PRG
  2762. .sp
  2763. \fBAuthor:\fR Alexander B\. Spencer
  2764. .in 0i
  2765. .sp
  2766. .in 1.5i
  2767. .ti -1.5i
  2768. .ta 1.5i
  2769. .ft B
  2770. See Also:    
  2771. .ft R
  2772. FT_MIL2CIV()
  2773. , FT_CIV2MIL()
  2774. .ta 1.63265i
  2775. .in 0i
  2776. .sp 2
  2777. .ne 20
  2778. .ps +3
  2779. .vs +3
  2780. FT_WEEK()    Return calendar or fiscal week data
  2781. .br
  2782. .ta
  2783. .in 0.08i
  2784. .ps -3
  2785. .vs -3
  2786. .sp 2
  2787. \fBFT_WEEK()
  2788. Return calendar or fiscal week data
  2789. .in 0i
  2790. .br
  2791. \l'6.24i'
  2792. .br
  2793. .sp
  2794. .in 0.08i
  2795. \fBSyntax
  2796. .sp
  2797. .in 0.4i
  2798. \fBFT_WEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateinfo
  2799. .sp
  2800. .in 0.08i
  2801. \fBArguments
  2802. .sp
  2803. .in 0.4i
  2804. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  2805. to current system date if not supplied\.
  2806. .sp
  2807. \fB<nWeekNum>\fR is a number from 1 to 53 signifying a week\.
  2808. Defaults to current week if not supplied\.
  2809. .sp
  2810. .in 0.08i
  2811. \fBReturns
  2812. .sp
  2813. .in 0.4i
  2814. A three element array containing the following data:
  2815. .sp
  2816. .in 0.64i
  2817. .br
  2818. aDateInfo[1] - The year and week as a character string "YYYYWW"
  2819. .br
  2820. aDateInfo[2] - The beginning date of the week
  2821. .br
  2822. aDateInfo[3] - The ending date of the week
  2823. .sp
  2824. .in 0.08i
  2825. \fBDescription
  2826. .sp
  2827. .in 0.4i
  2828. FT_WEEK() returns an array containing data about the week
  2829. containing the given date\.
  2830. .sp
  2831. Normally the return data will be based on a year beginning
  2832. on January 1st with weeks beginning on Sunday\.
  2833. .sp
  2834. The beginning of year date and/or beginning of week day can be
  2835. changed by using FT_DATECNFG(), which will affect all subsequent
  2836. calls to FT_WEEK() until another call to FT_DATECNFG()\.
  2837. .sp
  2838. The beginning of year date and beginning of week day may be reset
  2839. to January 1 and Sunday by calling FT_DATECNFG() with no
  2840. parameters\.
  2841. .sp
  2842. .in 0.08i
  2843. \fBExamples
  2844. .sp
  2845. .in 0.4i
  2846. .br
  2847. // get info about week containing 9/15/90
  2848. .br
  2849. aDateInfo := FT_WEEK( CTOD("09/15/90") )
  2850. .ta 1.36i 1.68i 2.72i
  2851. .br
  2852. ? aDateInfo[1]    //    199037    (37th week)
  2853. .br
  2854. .ta
  2855. .ta 1.36i 1.68i 2.72i
  2856. .br
  2857. ? aDateInfo[2]    //    09/09/90    beginning of week 37
  2858. .br
  2859. .ta
  2860. .ta 1.36i 1.68i 2.72i
  2861. .br
  2862. ? aDateInfo[3]    //    09/15/90    end of week 37
  2863. .br
  2864. .ta
  2865. .sp
  2866. .br
  2867. // get info about week 25 in year containing 9/15/90
  2868. .br
  2869. aDateInfo := FT_WEEK( CTOD("09/15/90"), 25 )
  2870. .ta 1.36i 1.68i
  2871. .br
  2872. ? aDateInfo[1]    //    199025
  2873. .br
  2874. .ta
  2875. .ta 1.36i 1.68i 2.56i
  2876. .br
  2877. ? aDateInfo[2]    //    06/17/90    beginning of week 25
  2878. .br
  2879. .ta
  2880. .ta 1.36i 1.68i 2.56i
  2881. .br
  2882. ? aDateInfo[3]    //    06/23/90    end of week 25
  2883. .br
  2884. .ta
  2885. .sp
  2886. .br
  2887. // get info about week 25 in current year
  2888. .br
  2889. aDateInfo := FT_WEEK( , 25 )
  2890. .ta 1.36i 1.68i
  2891. .br
  2892. ? aDateInfo[1]    //    199025
  2893. .br
  2894. .ta
  2895. .ta 1.36i 1.68i 2.56i
  2896. .br
  2897. ? aDateInfo[2]    //    06/16/91    beginning of week 25
  2898. .br
  2899. .ta
  2900. .ta 1.36i 1.68i 2.56i
  2901. .br
  2902. ? aDateInfo[3]    //    06/22/91    end of week 25
  2903. .br
  2904. .ta
  2905. .sp
  2906. .in 0.08i
  2907. \fBSource:\fR WEEK\.PRG
  2908. .sp
  2909. \fBAuthor:\fR Jo W\. French dba Practical Computing
  2910. .in 0i
  2911. .sp
  2912. .in 1.5i
  2913. .ti -1.5i
  2914. .ta 1.5i
  2915. .ft B
  2916. See Also:    
  2917. .ft R
  2918. FT_DATECNFG()
  2919. , FT_MONTH()
  2920. , FT_QTR()
  2921. , FT_YEAR()
  2922. .ta 1.63265i
  2923. .in 0i
  2924. .sp 2
  2925. .ne 20
  2926. .ps +3
  2927. .vs +3
  2928. FT_WORKDAYS()    Return number of work days between two dates
  2929. .br
  2930. .ta
  2931. .in 0.08i
  2932. .ps -3
  2933. .vs -3
  2934. .sp 2
  2935. \fBFT_WORKDAYS()
  2936. Return number of work days between two dates
  2937. .in 0i
  2938. .br
  2939. \l'6.24i'
  2940. .br
  2941. .sp
  2942. .in 0.08i
  2943. \fBSyntax
  2944. .sp
  2945. .in 0.4i
  2946. \fBFT_WORKDAYS( [ <dStart> ], [ <dStop> ] ) -> nDays
  2947. .sp
  2948. .in 0.08i
  2949. \fBArguments
  2950. .sp
  2951. .in 0.4i
  2952. \fB<dStart>\fR is the beginning value for the date range\.
  2953. .sp
  2954. \fB<dStop>\fR is the ending value for the date range\.
  2955. .sp
  2956. .sp
  2957. .in 0.08i
  2958. \fBReturns
  2959. .sp
  2960. .in 0.4i
  2961. The number of work days (Monday through Friday) between two dates\.
  2962. .sp
  2963. .sp
  2964. .in 0.08i
  2965. \fBDescription
  2966. .sp
  2967. .in 0.4i
  2968. FT_WORKDAYS() returns a number indicating the number of work days
  2969. between two dates\.  Work days are considered Monday through Friday\.
  2970. .in 1.36i
  2971. (The five day work week none of us Clipper programmers have\.)
  2972. .sp
  2973. .sp
  2974. .in 0.08i
  2975. \fBExamples
  2976. .sp
  2977. .in 0.32i
  2978. .ta 4.48i
  2979. .br
  2980. ? FT_WorkDays( CTOD("5/16/91"), CTOD("5/20/91") ) // 3    (Th - Mo)
  2981. .br
  2982. .ta
  2983. .ta 4.48i
  2984. .br
  2985. ? FT_WorkDays( CTOD("5/18/91"), CTOD("5/19/91") ) // 0    (Sa - Su)
  2986. .br
  2987. .ta
  2988. .ta 4.48i
  2989. .br
  2990. ? FT_WorkDays( CTOD("5/17/91"), CTOD("5/17/91") ) // 1    (Fr - Fr)
  2991. .br
  2992. .ta
  2993. .sp
  2994. .in 0.08i
  2995. \fBSource:\fR WORKDAYS\.PRG
  2996. .sp
  2997. \fBAuthor:\fR John F\. Kaster
  2998. .in 0i
  2999. .ta 1.63265i
  3000. .sp 2
  3001. .ne 20
  3002. .ps +3
  3003. .vs +3
  3004. FT_WOY()    Find number of week within year
  3005. .br
  3006. .ta
  3007. .in 0.08i
  3008. .ps -3
  3009. .vs -3
  3010. .sp 2
  3011. \fBFT_WOY()
  3012. Find number of week within year
  3013. .in 0i
  3014. .br
  3015. \l'6.24i'
  3016. .br
  3017. .sp
  3018. .in 0.08i
  3019. \fBSyntax
  3020. .sp
  3021. .in 0.4i
  3022. \fBFT_WOY( <dDate> ) -> <nResult>
  3023. .sp
  3024. .in 0.08i
  3025. \fBArguments
  3026. .sp
  3027. .in 0.4i
  3028. \fB<dDate>\fR is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
  3029. .sp
  3030. .in 0.08i
  3031. \fBReturns
  3032. .sp
  3033. .in 0.4i
  3034. Return numeric position of week within the year or NIL if
  3035. parameter does not conform\.
  3036. .sp
  3037. .in 0.08i
  3038. \fBDescription
  3039. .sp
  3040. .in 0.4i
  3041. Considers a full week as starting on Sunday, ending on Saturday\.
  3042. First week of year (week 1) may start on any day, and thus
  3043. .in 0.56i
  3044. contain any number of days\.
  3045. .in 0.4i
  3046. Final week of year (week 53) may contain any number of days\.
  3047. Handles dates with CENTURY ON|OFF, to allow for 21st century\.
  3048. Date validation must be external to this function\.
  3049. .sp
  3050. .in 0.08i
  3051. \fBExamples
  3052. .sp
  3053. .in 0.4i
  3054. These code fragments find the week number, given a date\.
  3055. .sp
  3056. .br
  3057. // literal character date
  3058. .ta 0.56i
  3059. .br
  3060. dDate    := CTOD("01/01/91")
  3061. .br
  3062. .ta
  3063. .ta 2.96i
  3064. .br
  3065. nWkNum := FT_WOY(dDate)    // result:  1
  3066. .br
  3067. .ta
  3068. .sp
  3069. .br
  3070. // presume DOS date to be 01/06/91
  3071. .ta 2.96i
  3072. .br
  3073. nWkNum := FT_WOY(DATE())    // result:  2
  3074. .br
  3075. .ta
  3076. .sp
  3077. .br
  3078. // date input
  3079. .ta 0.56i
  3080. .br
  3081. cDate    := SPACE(8)
  3082. .br
  3083. .ta
  3084. .ta 2.96i
  3085. .br
  3086. @ 4,10 get cDate PICT "##/##/##"    // input 07/04/91
  3087. .br
  3088. .ta
  3089. .br
  3090. READ
  3091. .ta 2.96i
  3092. .br
  3093. nWkNum := FT_WOY(CTOD(cDate))    // result: 27
  3094. .br
  3095. .ta
  3096. .sp
  3097. .br
  3098. // last day of year
  3099. .ta 3.04i
  3100. .br
  3101. nWkNum := FT_WOY(CTOD("12/31/91"))    // result: 53
  3102. .br
  3103. .ta
  3104. .sp
  3105. For a demonstration of this function, compile and link the
  3106. program WOY\.PRG in the Nanforum Toolkit source code\.
  3107. .sp
  3108. .in 0.08i
  3109. \fBSource:\fR WOY\.PRG
  3110. .sp
  3111. \fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
  3112. .in 0i
  3113. .ta 1.63265i
  3114. .sp 2
  3115. .ne 20
  3116. .ps +3
  3117. .vs +3
  3118. FT_YEAR()    Return calendar or fiscal year data
  3119. .br
  3120. .ta
  3121. .in 0.08i
  3122. .ps -3
  3123. .vs -3
  3124. .sp 2
  3125. \fBFT_YEAR()
  3126. Return calendar or fiscal year data
  3127. .in 0i
  3128. .br
  3129. \l'6.24i'
  3130. .br
  3131. .sp
  3132. .in 0.08i
  3133. \fBSyntax
  3134. .sp
  3135. .in 0.4i
  3136. \fBFT_YEAR( [ <dGivenDate> ] ) -> aDateInfo
  3137. .sp
  3138. .in 0.08i
  3139. \fBArguments
  3140. .sp
  3141. .in 0.4i
  3142. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  3143. to current system date if not supplied\.
  3144. .sp
  3145. .in 0.08i
  3146. \fBReturns
  3147. .sp
  3148. .in 0.4i
  3149. A three element array containing the following data:
  3150. .sp
  3151. .in 0.64i
  3152. .br
  3153. aDateInfo[1] - The year as a character string "YYYY"
  3154. .br
  3155. aDateInfo[2] - The beginning date of the year
  3156. .br
  3157. aDateInfo[3] - The ending date of the year
  3158. .sp
  3159. .in 0.08i
  3160. \fBDescription
  3161. .sp
  3162. .in 0.4i
  3163. FT_YEAR() returns an array containing data about the year
  3164. containing the given date\.
  3165. .sp
  3166. Normally the return data will be based on a year beginning
  3167. on January 1st\.
  3168. .sp
  3169. The beginning of year date can be changed by using FT_DATECNFG(),
  3170. which will affect all subsequent calls to FT_YEAR() until another
  3171. call to FT_DATECNFG()\.
  3172. .sp
  3173. The beginning of year date may be reset to January 1 by calling
  3174. FT_DATECNFG() with no parameters\.
  3175. .sp
  3176. .in 0.08i
  3177. \fBExamples
  3178. .sp
  3179. .in 0.4i
  3180. .br
  3181. // Get info about year containing 9/15/90, assuming default
  3182. .br
  3183. // beginning of year is January 1st\.
  3184. .br
  3185. aDateInfo := FT_YEAR( Ctod("09/15/90") )
  3186. .ta 1.36i 1.68i
  3187. .br
  3188. ? aDateInfo[1]    //    1990
  3189. .br
  3190. .ta
  3191. .ta 1.36i 1.68i 2.72i
  3192. .br
  3193. ? aDateInfo[2]    //    01/01/90    beginning of year
  3194. .br
  3195. .ta
  3196. .ta 1.36i 1.68i 2.72i
  3197. .br
  3198. ? aDateInfo[3]    //    12/31/90    end of year
  3199. .br
  3200. .ta
  3201. .sp
  3202. .br
  3203. // get info about current year (1991)\.
  3204. .br
  3205. aDateInfo := FT_YEAR()
  3206. .ta 1.36i 1.68i
  3207. .br
  3208. ? aDateInfo[1]    //    1991
  3209. .br
  3210. .ta
  3211. .ta 1.36i 1.68i 2.56i
  3212. .br
  3213. ? aDateInfo[2]    //    01/01/91    beginning of year
  3214. .br
  3215. .ta
  3216. .ta 1.36i 1.68i 2.56i
  3217. .br
  3218. ? aDateInfo[3]    //    12/31/91    end of year
  3219. .br
  3220. .ta
  3221. .sp
  3222. .in 0.08i
  3223. \fBSource:\fR YEAR\.PRG
  3224. .sp
  3225. \fBAuthor:\fR Jo W\. French dba Practical Computing
  3226. .in 0i
  3227. .sp
  3228. .in 1.5i
  3229. .ti -1.5i
  3230. .ta 1.5i
  3231. .ft B
  3232. See Also:    
  3233. .ft R
  3234. FT_DATECNFG()
  3235. , FT_WEEK()
  3236. , FT_MONTH()
  3237. , FT_QTR()
  3238.