home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-21 | 51.7 KB | 3,238 lines |
- .de }n
- .bp
- .sp .5i
- ..
- .wh -.8i }n
- .sp .5i
- .po -.4i
- .ll 7.5i
- .ps 9
- .vs 9
- .in 0i
- .ta 1.63265i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ACCTADJ() Adjust beginning or ending fiscal pd\. dates to acctg\. dates
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ACCTADJ()
- Adjust beginning or ending fiscal pd\. dates to acctg\. dates
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any valid format\.
- Defaults to DATE() if not supplied\.
- .sp
- \fB<lIsEnd>\fR is a logical variable\. \.F\. = adjust for beginning of
- period mode, \.T\. = adjust for end of period mode\. Defaults to
- beginning of period mode\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- An adjusted date dependent upon mode and work week start day\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Called by other FT_ACCT\.\. functions\. The algorithm is:
- .sp
- Beginning of period mode:
- .sp
- .in 0.64i
- If dGivenDate is in last 3 days of work week
- .in 0.88i
- Return next week\'s start date
- .in 0.64i
- Else
- .in 0.88i
- Return this week\'s start date
- .in 0.64i
- Endif
- .sp
- .in 0.4i
- End of period mode:
- .sp
- .in 0.64i
- If dGivenDate is in last 4 days of work week
- .in 0.88i
- Return this week\'s end date
- .in 0.64i
- Else
- .in 0.88i
- Return prior week\'s end date
- .in 0.64i
- Endif
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- Beginning of period mode (lIsEnd == \.F\.)
- .sp
- .in 0.56i
- .ta 2.32i
- dDate := Ctod( "01/31/91" ) // In last 3 days of work week
- .br
- .ta
- .ta 2.32i
- ? FT_ACCTADJ( dDate ) // 02/03/91 (next week\'s start)
- .br
- .ta
- .sp
- .ta 2.32i
- dDate := Ctod( "03/31/91" ) // Not in last 3 days of work week
- .br
- .ta
- .ta 2.32i
- ? FT_ACCTADJ( dDate ) // 03/31/91 (this week\'s start)
- .br
- .ta
- .sp
- .in 0.4i
- End of period mode (lIsEnd == \.T\.)
- .sp
- .in 0.56i
- .ta 2.32i
- dDate := Ctod( "01/31/91" ) // In last 4 days of work week
- .br
- .ta
- .ta 2.32i
- ? FT_ACCTADJ( dDate, \.T\. ) // 02/02/91 (this week\'s end)
- .br
- .ta
- .sp
- .ta 2.32i
- dDate := Ctod( "03/31/91" ) // Not in last 4 days of work week
- .br
- .ta
- .ta 2.32i
- ? FT_ACCTADJ( dDate, \.T\. ) // 03/30/91 (prior week\'s end)
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR ACCTADJ\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_DAYTOBOW()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ACCTMONTH() Return accounting month data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ACCTMONTH()
- Return accounting month data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ACCTMONTH( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- \fB<nMonthNum>\fR is a number from 1 to 12 signifying a month\.
- Defaults to current month if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year and month as a character string "YYYYMM"
- .br
- aDateInfo[2] - The beginning date of the accounting month
- .br
- aDateInfo[3] - The ending date of the accounting month
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_ACCTMONTH() creates an array containing data about the
- accounting month containing the given date\.
- .sp
- An accounting period has the following characteristics:
- .sp
- If the first week of the period contains 4 or more \'work\'
- days, it is included in the period; otherwise, the first
- week was included in the prior period\.
- .sp
- If the last week of the period contains 4 or more \'work\'
- days it is included in the period; otherwise, the last week
- is included in the next period\. This results in 13 week
- \'quarters\' and 4 or 5 week \'months\'\. Every 5 or 6 years, a
- \'quarter\' will contain 14 weeks and the year will contain 53
- weeks\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // get info about accounting month containing 9/15/90
- .br
- aDateInfo := FT_ACCTMONTH( Ctod("09/15/90") )
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[1] // 199009 (9th month)
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[2] // 09/02/90 beginning of month 9
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[3] // 09/29/90 end of month 9
- .br
- .ta
- .sp
- .br
- // get info about accounting month 5 in year containing 9/15/90
- .br
- aDateInfo := FT_ACCTMONTH( Ctod("09/15/90"), 5 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199005
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 04/29/89 beginning of month 5
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 06/02/90 end of month 5
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR ACCTMNTH\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_ACCTWEEK()
- , FT_ACCTQTR()
- , FT_ACCTYEAR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ACCTQTR() Return accounting quarter data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ACCTQTR()
- Return accounting quarter data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ACCTQTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- \fB<nQtrNum>\fR is a number from 1 to 4 signifying a quarter\.
- Defaults to current quarter if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year and qtr\. as a character string "YYYYQQ"
- .br
- aDateInfo[2] - The beginning date of the accounting quarter
- .br
- aDateInfo[3] - The ending date of the accounting quarter
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_ACCTQTR() creates an array containing data about the
- accounting quarter containing the given date\.
- .sp
- An accounting period has the following characteristics:
- .sp
- If the first week of the period contains 4 or more \'work\'
- days, it is included in the period; otherwise, the first
- week was included in the prior period\.
- .sp
- If the last week of the period contains 4 or more \'work\'
- days it is included in the period; otherwise, the last week
- is included in the next period\. This results in 13 week
- \'quarters\' and 4 or 5 week \'months\'\. Every 5 or 6 years, a
- \'quarter\' will contain 14 weeks and the year will contain 53
- weeks\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // get info about accounting month containing 9/15/90
- .br
- aDateInfo := FT_ACCTQTR( CTOD("09/15/90") )
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[1] // 199003 (3rd quarter)
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[2] // 07/01/90 beginning of quarter 3
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[3] // 09/29/90 end of quarter 3
- .br
- .ta
- .sp
- .br
- // get info about accounting qtr\. 2 in year containing 9/15/90
- .br
- aDateInfo := FT_ACCTQTR( CTOD("09/15/90"), 2 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199002
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 04/01/89 beginning of quarter 2
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 06/30/90 end of quarter 2
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR ACCTQTR\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_ACCTWEEK()
- , FT_ACCTMONTH()
- , FT_ACCTYEAR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ACCTWEEK() Return accounting week data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ACCTWEEK()
- Return accounting week data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ACCTWEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- \fB<nWeekNum>\fR is a number from 1 to 52 signifying a week\.
- Defaults to current week if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year and week as a character string "YYYYWW"
- .br
- aDateInfo[2] - The beginning date of the accounting week
- .br
- aDateInfo[3] - The ending date of the accounting week
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_ACCTWEEK() returns an array containing data about the
- accounting week containing the given date\.
- .sp
- An accounting period has the following characteristics:
- .sp
- If the first week of the period contains 4 or more \'work\'
- days, it is included in the period; otherwise, the first
- week was included in the prior period\.
- .sp
- If the last week of the period contains 4 or more \'work\'
- days it is included in the period; otherwise, the last week
- is included in the next period\. This results in 13 week
- \'quarters\' and 4 or 5 week \'months\'\. Every 5 or 6 years, a
- \'quarter\' will contain 14 weeks and the year will contain 53
- weeks\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // get info about accounting week containing 9/15/90
- .br
- aDateInfo := FT_ACCTWEEK( CTOD("09/15/90") )
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[1] // 199037 (37th week)
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[2] // 09/09/90 beginning of week 37
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[3] // 09/15/90 end of week 37
- .br
- .ta
- .sp
- .br
- // get info about accounting week 25 in year containing 9/15/90
- .br
- aDateInfo := FT_ACCTWEEK( CTOD("09/15/90"), 25 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199025
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 06/17/89 beginning of week 25
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 06/23/90 end of week 25
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR ACCTWEEK\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_ACCTMONTH()
- , FT_ACCTQTR()
- , FT_ACCTYEAR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ACCTYEAR() Return accounting year data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ACCTYEAR()
- Return accounting year data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ACCTYEAR( [ <dGivenDate> ] ) -> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year as a character string "YYYY"
- .br
- aDateInfo[2] - The beginning date of the accounting year
- .br
- aDateInfo[3] - The ending date of the accounting year
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_ACCTYEAR() creates an array containing data about the
- accounting year containing the given date\.
- .sp
- An accounting period has the following characteristics:
- .sp
- If the first week of the period contains 4 or more \'work\'
- days, it is included in the period; otherwise, the first
- week was included in the prior period\.
- .sp
- If the last week of the period contains 4 or more \'work\'
- days it is included in the period; otherwise, the last week
- is included in the next period\. This results in 13 week
- \'quarters\' and 4 or 5 week \'months\'\. Every 5 or 6 years, a
- \'quarter\' will contain 14 weeks and the year will contain 53
- weeks\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // get info about accounting year containing 9/15/90
- .br
- aDateInfo := FT_ACCTYEAR( CTOD("09/15/90") )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 1990
- .br
- .ta
- .ta 1.36i 1.68i 2.64i
- .br
- ? aDateInfo[2] // 12/31/89 beginning of year
- .br
- .ta
- .ta 1.36i 1.68i 2.64i
- .br
- ? aDateInfo[3] // 12/29/90 end of year
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR ACCTYEAR\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_ACCTWEEK()
- , FT_ACCTMONTH()
- , FT_ACCTQTR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ADDWKDY() Return true number of days to add given number of workdays
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ADDWKDY()
- Return true number of days to add given number of workdays
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ADDWKDY( <dStart>, <nWorkDays> ) -> nTrueDays
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .br
- \fB<dStart>\fR = date to start adding from
- .br
- \fB<nWorkDays>\fR = number of workdays to add
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- <nTrueDays> = Number of actual days to add to <dStart> in
- .in 1.52i
- order to add the required <nWorkDays>
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.48i
- Let\'s say you are given the problem:
- .sp
- .in 0.72i
- "All invoices are due 10 working days from the date they
- are printed\. Please display the due date on the invoice\."
- .sp
- .in 0.48i
- .ta 1.84i
- When is the due date? Assuming you are printing the invoices
- .br
- .ta
- today, your answer is:
- .sp
- .in 0.88i
- dDueDate := DATE() + ft_addWkDay( DATE(), 10 )
- .sp
- .in 0.48i
- A work day is defined as Monday through Friday\. Unfortunately
- this routine does _not_ account for holidays\.
- .sp
- This documentation was written by Glenn Scott so if it\'s wrong,
- blame him\.
- .sp
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.48i
- .br
- // Postdate 5 working days from the first of January
- .br
- dPost := CTOD("01/01/91")
- .ta 2.72i
- .br
- dPost += FT_ADDWKDY( dPost, 5 ) // returns 7 true days
- .br
- .ta
- .ta 2.64i 2.96i
- .br
- ? dPost // 01/08/91
- .br
- .ta
- .sp
- .sp
- .in 0.08i
- \fBSource:\fR WDA\.PRG
- .sp
- \fBAuthor:\fR Eric Splaver
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_WORKDAYS()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_CALENDAR() Display date/time calendar, find a date, return calendar dat
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_CALENDAR()
- Display date/time calendar, find a date, return calendar dat
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_CALENDAR ( [ <nRow> ], [ <nCol> ], [ <cColor> ], [ <lShadow> ] ,
- .in 1.52i
- \fB[ <lShowHelp> ] ) -> aRetVal
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .sp
- .in 0.4i
- \fB<nRow>\fR is an optional screen row for calendar display,
- .in 0.96i
- default row 1\.
- .sp
- .in 0.4i
- \fB<nCol>\fR is an optional screen col for calendar display,
- .in 0.96i
- default col 63\.
- .sp
- .in 0.4i
- \fB<cColor>\fR is an optional color string for displayed messages,
- .in 1.12i
- default is bright white text over green background\.
- .sp
- .in 0.4i
- \fB<lShadow>\fR is an optional logical variable\. If true (\.T\.),
- .in 1.2i
- it uses FT_SHADOW() to add a transparent shadow
- to the display, default (\.F\.)\.
- .sp
- .in 0.4i
- \fB<lShowHelp>\fR is an optional logical variable\. If true, uses
- .in 1.36i
- .ta 1.6i
- FT_XBOX to display a four line help message
- .br
- .ta
- if the F1 key is pressed, default (\.F\.)\.
- .sp
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- .ta 0.72i
- aRetVal is an 8 element array containing date, month, day, year,
- .br
- .ta
- .in 1.12i
- month (in character format), day of the week, julian day
- and current time\.
- .sp
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_CALENDAR() simply displays today\'s date, time and julian
- day in a two line display with an optional box shadow\. Cursor keys may
- be used to page through the calendar by day, week, month or year
- increments\. Returns an 8 element array of calendar data:
- .sp
- .ta 0.72i
- Element Value
- .br
- .ta
- .ta 0.72i
- [1] Date in current date format\.
- .br
- .ta
- .ta 0.72i
- [2] Numeric month number\.
- .br
- .ta
- .ta 0.72i
- [3] Numeric day number\.
- .br
- .ta
- .ta 0.72i
- [4] Numeric year number\.
- .br
- .ta
- .ta 0.72i
- [5] Month in character format\.
- .br
- .ta
- .ta 0.72i
- [6] Day of the week in character format\.
- .br
- .ta
- .ta 0.72i
- [7] Numeric Julian day\.
- .br
- .ta
- .ta 0.72i
- [8] Current time in time format\.
- .br
- .ta
- .sp
- WARNING: FT_CALENDAR uses FT_SHADOW and FT_XBOX
- .in 1.12i
- from the Nanforum Toolkit!
- .sp
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .sp
- .in 0.24i
- .br
- LOCAL aRetVal[8]
- .br
- CLS
- .br
- aRetVal := FT_CALENDAR (10,40,\'W+/RB\',\.T\.,\.T\.)
- .ta 1.36i
- ?aRetVal[1] // Result: 04/20/91
- .br
- .ta
- .ta 1.36i 2.4i
- ?aRetVal[2] // Result: 4
- .br
- .ta
- .ta 1.36i
- ?aRetVal[3] // Result: 20
- .br
- .ta
- .ta 1.36i
- ?aRetVal[4] // Result: 1991
- .br
- .ta
- .ta 1.36i
- ?aRetVal[5] // Result: April
- .br
- .ta
- .ta 1.36i
- ?aRetVal[6] // Result: Saturday
- .br
- .ta
- .ta 1.36i 2.8i
- ?aRetVal[7] // Result: 110
- .br
- .ta
- .ta 1.36i
- ?aRetVal[8] // Result: 12:45:20
- .br
- .ta
- .sp
- .sp
- .in 0.08i
- \fBSource:\fR CALENDAR\.PRG
- .sp
- \fBAuthor:\fR Isa Asudeh
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DAYOFYR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_CIV2MIL() Convert usual civilian format time to military time\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_CIV2MIL()
- Convert usual civilian format time to military time\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_CIV2MIL( <cCIVTIME> ) -> cMILTIME
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .ta 0.96i
- \fB<cCIVTIME>\fR character string of form hh:mm (am,pm,n or m),
- .br
- .ta
- .in 0.64i
- where 0\fB<hh\fR<12\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- .ta 0.96i
- <cMILTIME> character string of form hhmm, where 0<=hh<24\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Converts time from 12-hour civilian format to military\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- FT_CIV2MIL( " 5:40 pm" ) -> 1740
- .sp
- FT_CIV2MIL( " 5:40 am" ) -> 0540
- .sp
- FT_CIV2MIL( "12:00 n" ) -> 1200
- .sp
- FT_CIV2MIL( "12:00 m" ) -> 0000
- .sp
- Caution: leading blanks are irrelevant; p,a,n,m must be preceded by
- .in 1.2i
- one and only one space\.
- .sp
- .in 0.08i
- \fBSource:\fR MILTIME\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_MIL2CIV()
- , FT_SYS2MIL()
- , FT_MIL2MIN()
- , FT_MIN2MIL()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_DATECNFG() Set beginning of year/week for FT_ date functions
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_DATECNFG()
- Set beginning of year/week for FT_ date functions
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_DATECNFG( [ <cFYStart> ], [ <nDow> ] ) -> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<cFYStart>\fR is a character date string in the user\'s system date
- format, i\.e\., the same as the user would enter for CTOD()\. If
- this argument is NIL, the current value is unchanged\.
- .sp
- Note: The year portion of the date string must be present and
- be a valid year; however, it has no real meaning\.
- .sp
- \fB<nDow>\fR is a number from 1 to 7 (1 = Sunday) indicating the
- desired start of a work week\. If this argument is NIL,
- the current value is unchanged\.
- .sp
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A 2-element array containing the following information:
- .sp
- .in 0.64i
- aDateInfo[1] - an ANSI date string indicating the beginning
- .in 1.84i
- date of the year\. Only the month and day are
- meaningful\.
- .sp
- .in 0.64i
- aDateInfo[2] - the number of the first day of the week
- .in 1.84i
- (1 = Sunday)
- .sp
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_DATECNFG() is called internally by many of the date functions
- in the library to determine the beginning of year date and
- beginning of week day\.
- .sp
- The default beginning of the year is January 1st and the default
- beginning of the week is Sunday (day 1)\. Either or both of these
- settings may be changed by calling FT_DATECNFG() with the proper
- arguments\. They will retain their values for the duration of the
- program or until they are changed again by a subsequent call to
- FT_DATECNFG()\.
- .sp
- It is not necessary to call FT_DATECNFG() unless you need to
- change the defaults\.
- .sp
- FT_DATECNFG() affects the following library functions:
- .sp
- .in 0.56i
- .ta 1.28i 2.88i
- FT_WEEK() FT_ACCTWEEK() FT_DAYTOBOW()
- .br
- .ta
- .ta 1.28i 2.88i
- FT_MONTH() FT_ACCTMONTH() FT_DAYOFYR()
- .br
- .ta
- .ta 1.28i 2.88i
- FT_QTR() FT_ACCTQTR() FT_ACCTADJ()
- .br
- .ta
- .ta 1.28i
- FT_YEAR() FT_ACCTYEAR()
- .br
- .ta
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.56i
- // Configure library date functions to begin year on
- .ta 0.32i
- // July 1st\.
- .br
- .ta
- .sp
- .ta 2.16i
- FT_DATECNFG("07/01/80") // year is insignificant
- .br
- .ta
- .sp
- // Examples of return values:
- .sp
- .ta 0.32i 3.44i 4.48i
- // System date format: American aArray[1] aArray[2]
- .br
- .ta
- .sp
- .ta 2.96i 3.28i 4.64i
- aArray := FT_DATECNFG() // \'1980\.01\.01\' 1 (Sun\.)
- .br
- .ta
- .ta 2.96i 3.28i 4.64i
- aArray := FT_DATECNFG(\'07/01/80\') // \'1980\.07\.01\' 1 (Sun\.)
- .br
- .ta
- .ta 3.28i 4.64i
- aArray := FT_DATECNFG(\'07/01/80\', 2) // \'1980\.07\.01\' 2 (Mon\.)
- .br
- .ta
- .ta 2.96i 3.28i 4.64i
- aArray := FT_DATECNFG( , 2 ) // \'1980\.01\.01\' 2 (Mon\.)
- .br
- .ta
- .sp
- .ta 0.32i
- // System date format: British
- .br
- .ta
- .sp
- .ta 3.28i 4.64i
- aArray := FT_DATECNFG(\'01/07/80\', 2) // \'1980\.07\.01\' 2 (Mon\.)
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR DATECNFG\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_ACCTADJ()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_DAYOFYR() Return calendar, fiscal or accounting day data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_DAYOFYR()
- Return calendar, fiscal or accounting day data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_DAYOFYR( [ <dGivenDate> ], [ <nDayNum> ], [ <lIsAcct> ] )
- .in 0.96i
- \fB-> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any valid format\. Defaults
- to current system date if not supplied\.
- .sp
- \fB<nDayNum>\fR is a number from 1 to 371, signifying a day of a year\.
- Defaults to current day if not supplied\.
- .sp
- \fB<lIsAcct>\fR is a logical which specifies the type of year to base
- the return value on: \.F\. = calendar or fiscal year,
- \.T\. = accounting year\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- If <nDayNum> is specified:
- .sp
- .br
- aDateInfo[1] - The date of the specified day number
- .br
- aDateInfo[2] - The beginning date of the year
- .br
- aDateInfo[3] - The ending date of the year
- .sp
- If <nDayNum> is not specified:
- .sp
- .br
- aDateInfo[1] - The year and day as a character string "YYYYDDD"
- .br
- aDateInfo[2] - The beginning date of the year
- .br
- aDateInfo[3] - The ending date of the year
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_DAYOFYR() returns an array containing data about a day in the
- calendar or fiscal year containing the given date\.
- .sp
- The beginning of year date defaults to January 1st but may be
- changed with FT_DATECNFG()\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- aDateInfo := FT_DAYOFYR( CTOD("03/31/91") )
- .ta 1.76i 2.88i
- ? aDateInfo[1] // 1991090 (90th day of year 1991)
- .br
- .ta
- .ta 1.76i
- ? aDateInfo[2] // 01/01/91
- .br
- .ta
- .ta 1.76i
- ? aDateInfo[3] // 12/31/91
- .br
- .ta
- .sp
- .ta 2.8i
- aDateInfo := FT_DAYOFYR( , 90 ) // assume current date is 3/31/91
- .br
- .ta
- .ta 1.76i 2.96i
- ? aDateInfo[1] // 03/31/91 (90th day of year)
- .br
- .ta
- .ta 1.76i
- ? aDateInfo[2] // 01/01/91
- .br
- .ta
- .ta 1.76i
- ? aDateInfo[3] // 12/31/91
- .br
- .ta
- .sp
- aDateInfo := FT_DAYOFYR( , 90, \.T\. )
- .ta 1.76i 2.96i
- ? aDateInfo[1] // 03/29/91 (90th day of accounting year)
- .br
- .ta
- .ta 1.76i 2.96i
- ? aDateInfo[2] // 12/30/90 (1st day of accounting year)
- .br
- .ta
- .ta 1.76i 2.96i
- ? aDateInfo[3] // 12/28/91 (last day of accounting year)
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR DAYOFYR\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_DAYTOBOW() Calculate no\. of days between date and beginning of week
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_DAYTOBOW()
- Calculate no\. of days between date and beginning of week
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_DAYTOBOW( [ <dGivenDate> ] ) -> nDays
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any valid date format\.
- Defaults to current date if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A positive number of days to beginning of week, range 0 to 6\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_DAYTOBOW() returns the number of days to the beginning of the
- week\. Normally this will be one less than the value that
- would be returned by the Clipper function DOW(), unless the
- day for the beginning of the week has been changed with
- FT_DATECNFG()\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- dDate := CTOD( "09/15/90" )
- .sp
- .ta 2.32i
- ? DOW( dDate ) // Saturday
- .br
- .ta
- .ta 2.32i
- ? CDOW( dDate ) // 7
- .br
- .ta
- .ta 2.32i
- ? FT_DAYTOBOW( dDate ) // 6
- .br
- .ta
- .sp
- .ta 3.12i
- .br
- // change beginning of week to Friday (yeah!)
- .br
- .ta
- .br
- FT_DATECNFG( , 6 )
- .ta 2.32i
- ? DOW( dDate ) // Saturday
- .br
- .ta
- .ta 2.32i
- ? CDOW( dDate ) // 7
- .br
- .ta
- .ta 2.32i
- ? FT_DAYTOBOW( dDate ) // 1
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR DAYTOBOW\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_ACCTWEEK()
- , FT_WEEK()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_DOY() Find number of day within year
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_DOY()
- Find number of day within year
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_DOY( <dDate> ) -> <nResult>
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dDate>\fR is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- Return numeric position of day within the year\.
- Return NIL if parameter does not conform\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Finds the day number, considering 01/01 as day 1
- Handles dates with CENTURY ON|OFF, to allow for 21st century\.
- Date validation must be external to this function\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- These code fragments find the day number, given a date\.
- .sp
- .br
- // literal character date
- .ta 0.56i
- .br
- dDate := CTOD("01/01/91")
- .br
- .ta
- .ta 3.04i
- .br
- nDayNum := FT_DOY(dDate) // result: 1
- .br
- .ta
- .sp
- .br
- // presume DOS date to be 01/06/91
- .ta 3.04i
- .br
- nDayNum := FT_DOY(DATE()) // result: 6
- .br
- .ta
- .sp
- .br
- // date input
- .ta 0.56i
- .br
- cDate := SPACE(8)
- .br
- .ta
- .ta 3.04i
- .br
- @ 4,10 get cDate PICT "##/##/##" // input 07/04/91
- .br
- .ta
- .br
- READ
- .ta 3.04i
- .br
- nDayNum := FT_DOY(CTOD(cDate)) // result: 185
- .br
- .ta
- .sp
- .br
- // last day of year
- .ta 3.12i
- .br
- nDayNum := FT_DOY(CTOD("12/31/91")) // result: 365
- .br
- .ta
- .sp
- For a demonstration of this function, compile and link the
- program WOY\.PRG in the Nanforum Toolkit source code\.
- .sp
- .in 0.08i
- \fBSource:\fR WOY\.PRG
- .sp
- \fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
- .in 0i
- .ta 1.63265i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_EASTER() Return the date of Easter
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_EASTER()
- Return the date of Easter
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_EASTER( <xYear> ) -> dEdate
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- xYear can be a character, date or numeric describing the year
- for which you wish to receive the date of Easter\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- The actual date that Easter occurs\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Returns the date of Easter for any year after 1582 up to Clipper\'s
- limit which the manual states is 9999, but the Guide agrees with
- the actual imposed limit of 2999\.
- .sp
- This function can be useful in calender type programs that indicate
- when holidays occur\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .ta 2.56i
- dEdate := FT_EASTER( 1990 ) && returns 04/15/1990
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR EASTER\.PRG
- .sp
- \fBAuthor:\fR Paul Tucker
- .in 0i
- .ta 1.63265i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ELAPMIN() Return difference, in minutes, between two mil format times\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ELAPMIN()
- Return difference, in minutes, between two mil format times\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ELAPMIN( <cTIME1>, <cTIME2> ) -> nMINUTES
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .ta 1.44i
- \fB<cTIME1, cTIME2>\fR character strings of military form "hhmm",
- .br
- .ta
- .in 0.72i
- where 0\fB<=hh\fR<24\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- <nMINUTES>
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Finds the arithmetic difference between time two times
- (time 2 - time 1)\.
- If time 2 is smaller than time 1, a NEGATIVE value is returned\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .ta 2.64i
- .br
- FT_ELAPMIN( "1718", "2040" ) -> 322
- .br
- .ta
- .br
- FT_ELAPMIN( "2040", "1718" ) -> -322
- .sp
- .in 0.08i
- \fBSource:\fR ELAPMIL\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_ELTIME()
- , FT_MIL2MIN()
- , FT_MIN2MIL()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ELAPSED() Return elapsed time between two days and/or times
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ELAPSED()
- Return elapsed time between two days and/or times
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ELAPSED([ <dStart> ], [ <dEnd> ], ;
- .in 1.28i
- \fB<cTimeStart>, <cTimeEnd>) -> aTimedata
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dStart>\fR is any valid date in any date format\. Defaults to DATE()\.
- .sp
- \fB<dEnd>\fR is any valid date in any date format\. Defaults to DATE()\.
- .sp
- \fB<cTimeStart>\fR is a valid Time string of the format \'hh:mm:ss\' where
- hh is hours in 24-hour format\.
- .sp
- \fB<cTimeEnd>\fR is a valid Time string of the format \'hh:mm:ss\' where
- hh is hours in 24-hour format\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A two-dimensional array containing elapsed time data\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_ELAPSED() calculates the elapsed time between two Date/Time events\.
- .sp
- It returns an array which contains the following data:
- .sp
- .ta 1.12i 2.56i 4.72i
- aRetVal[1,1] Integer Days aRetVal[1,2] Total Days (nn\.nnnn)
- .br
- .ta
- .ta 1.12i 2.56i 4.72i
- aRetVal[2,1] Integer Hours aRetVal[2,2] Total Hours (nn\.nnnn)
- .br
- .ta
- .ta 1.12i 2.56i
- aRetVal[3,1] Integer Minutes aRetVal[3,2] Total Minutes (nn\.nnnn)
- .br
- .ta
- .ta 1.12i 2.56i
- aRetVal[4,1] Integer Seconds aRetVal[4,2] Total Seconds (nn)
- .br
- .ta
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- FT_ELAPSED(CTOD(\'11/28/90\'), CTOD(\'11/30/90\'), \'08:00:00\', \'12:10:30\')
- will return:
- .sp
- .ta 1.36i 2.64i 4.16i 4.8i
- aRetVal[1,1] -> 2 (Days) aRetVal[1,2] -> 2\.1740 Days
- .br
- .ta
- .ta 1.36i 2.64i 4.08i 4.8i
- aRetVal[2,1] -> 4 (Hours) aRetVal[2,2] -> 52\.1750 Hours
- .br
- .ta
- .ta 2.64i 4.8i
- aRetVal[3,1] -> 10 (Minutes) aRetVal[3,2] -> 3130\.5000 Minutes
- .br
- .ta
- .ta 2.64i 4.8i
- aRetVal[4,1] -> 30 (Seconds) aRetVal[4,2] -> 187830 Seconds
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR ELAPSED\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .ta 1.63265i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_ELTIME() Compute difference between times in hours, minutes, seconds\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_ELTIME()
- Compute difference between times in hours, minutes, seconds\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_ELTIME( <cTime1>, <cTime2> ) -> cDiff
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .ta 1.44i
- \fB<cTime1, cTime2>\fR character strings representing times in
- .br
- .ta
- .in 0.64i
- hh:mm:ss format\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- .ta 0.72i
- <cDiff> character string representing time difference in
- .br
- .ta
- .in 0.64i
- hh:mm:ss format\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Return the absolute difference between two times in hh:mm:ss format
- in character hours, minutes and seconds (hh:mm:ss)\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- FT_ELTIME( "22:40:12", "23:55:17" ) -> 01:15:05
- .br
- FT_ELTIME( "23:55:17", "22:40:12" ) -> 01:15:05
- .sp
- .in 0.08i
- \fBSource:\fR ELTIME\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_ELAPMIN()
- , FT_MIL2MIN()
- , FT_MIN2MIL()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_FDAY() Return first day of the month
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_FDAY()
- Return first day of the month
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_FDAY( [ <dDateToChk> ] ) -> dFirstDay
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dDateToChk>\fR is a date within a month for which you want to find
- the first date of that month\. If not passed or is an incorrect type,
- defaults to current system date\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A Clipper date value representing the first date of the month\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- This function will return the first day of the month of the date
- passed, or the first day of the current month if no argument is
- supplied\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- dDate := CTOD( "09/15/90" )
- .ta 2.48i
- ? FT_FDAY( dDate ) // 09/01/90
- .br
- .ta
- .ta 2.48i 3.52i
- ? FT_FDAY() // 03/01/91 (current month)
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR FIRSTDAY\.PRG
- .sp
- \fBAuthor:\fR Jeff Bryant
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_LDAY()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_LDAY() Return last day of the month
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_LDAY()
- Return last day of the month
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_LDAY( [ <dDateToChk> ] ) -> dLastDay
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dDateToChk>\fR is a date within a month for which you want to find
- the last date of that month\. If not passed or is an incorrect
- type, defaults to current system date\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A Clipper date value representing the last date of the month\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- This function will return the last day of the month of the date
- passed, or the last day of the current month if no argument is
- supplied\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- dDate := CTOD( "09/15/90" )
- .ta 2.48i
- ? FT_LDAY( dDate ) // 09/30/90
- .br
- .ta
- .ta 2.48i 3.52i
- ? FT_LDAY() // 03/31/91 (current month)
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR LASTDAY\.PRG
- .sp
- \fBAuthor:\fR Mike Schinkel
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_FDAY()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_MADD() Add or subtract months to/from a date
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_MADD()
- Add or subtract months to/from a date
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_MADD( [ <dGivenDate> ], [ <nAddMonths> ], [ <lMakeEOM> ] )
- .in 0.72i
- \fB-> dDate
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults to
- current system date if not supplied\.
- .sp
- \fB<nAddMonths>\fR is the number of months to be added or subtracted\.
- Defaults to 0 if not supplied\.
- .sp
- \fB<lMakeEOM>\fR is a logical variable indicating whether or not to
- .in 0.56i
- force the returned date to the last date of the month\. It only
- affects the returned date if \fB<dGivenDate>\fR is an end-of-month date\.
- .in 0.4i
- Defaults to false except for month of February\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A date\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_MADD() adds or subtracts months to/from a given date\.
- .sp
- If MakeEOM is passed and dGivenDate is the last day of a month,
- if will return the EOM of calculated month\. Otherwise it will
- return the same day as the day of the passed date\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- dDate := CTOD( "09/15/90" )
- .ta 2.32i
- ? FT_MADD( dDate, 1 ) // 10/15/90
- .br
- .ta
- .ta 2.32i
- ? FT_MADD( dDate, -2 ) // 07/15/90
- .br
- .ta
- .sp
- // force EOM
- dDate := CTOD( "04/30/91" )
- .ta 2.32i
- ? FT_MADD( dDate, 1 ) // 05/30/91
- .br
- .ta
- .ta 2.32i 3.36i
- ? FT_MADD( dDate, 1, \.T\. ) // 05/31/91 <- forced EOM
- .br
- .ta
- .ta 2.32i
- ? FT_MADD( dDate, 2 ) // 06/30/91
- .br
- .ta
- .ta 2.32i 3.36i
- ? FT_MADD( dDate, 2, \.T\. ) // 06/30/91 <- June only has 30 days
- .br
- .ta
- .ta 2.32i
- ? FT_MADD( dDate, 3 ) // 07/30/91
- .br
- .ta
- .ta 2.32i 3.36i
- ? FT_MADD( dDate, 3, \.T\. ) // 07/31/91 <- forced EOM
- .br
- .ta
- .sp
- .sp
- .in 0.08i
- \fBSource:\fR MADD\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DAYOFYR()
- , FT_DAYTOBOW()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_MIL2CIV() Convert time in military format to civilian format\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_MIL2CIV()
- Convert time in military format to civilian format\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_MIL2CIV( <cCIVTIME> ) -> dMILTIME
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .ta 0.96i
- \fB<cMILTIME>\fR character string of form hhmm, where 0\fB<=hh\fR<24\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- .ta 0.96i
- <cCIVTIME> character string of form hh:mm (am,pm,n or m),
- .br
- .ta
- .in 0.64i
- where 0<hh<12\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Converts time from military to civilian format
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .ta 2i
- FT_MIL2CIV( "1640" ) -> 4:40 pm
- .br
- .ta
- .sp
- .ta 2i
- FT_MIL2CIV( "0440" ) -> 4:40 am
- .br
- .ta
- .sp
- FT_MIL2CIV( "1200" ) -> 12:00 n
- .sp
- FT_MIL2CIV( "0000" ) and FT_MIL2CIV( "2400" ) -> 12:00 m
- .sp
- Caution: leading blanks are irrelevant\.
- .sp
- .in 0.08i
- \fBSource:\fR MILTIME\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_CIV2MIL()
- , FT_SYS2MIL()
- , FT_MIL2MIN()
- , FT_MIN2MIL()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_MIL2MIN() Convert time in military format to number of minute of day\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_MIL2MIN()
- Convert time in military format to number of minute of day\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_MIL2MIN( <cMILTIME> ) -> nMINUTE
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .ta 0.96i
- \fB<cMILTIME>\fR character string of form hhmm, where 0\fB<=hh\fR<24\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- .ta 1.04i
- <nMINOFDAY> numeric value representing minute of day\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Converts time in military format to number of minute of the day\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- FT_MIL2MIN( "1729" ) -> 1049
- .sp
- .in 0.08i
- \fBSource:\fR MILTIME\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_MIN2MIL()
- , FT_CIV2MIL()
- , FT_MIL2CIV()
- , FT_SYS2MIL()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_MIN2DHM() Convert numeric minutes to days, hours and minutes\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_MIN2DHM()
- Convert numeric minutes to days, hours and minutes\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_MIN2DHM( <nMinutes> ) -> aDHM_
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .ta 0.96i
- \fB<nMinutes>\fR the number of minutes\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- <aDHM_>
- .in 0.64i
- where:
- .in 0.88i
- aDHM_[1] = cDAYS, aDHM_[2] = cHours, aDHM_[3] = cMinutes
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Converts numeric minutes into a character array containing
- days, hours & minutes\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- aDHM_ = MIN2DHM(16789) -> aDHM_[1] = 11, aDHM_[2] = 15, aDHM_[3] = 49
- .sp
- .in 0.08i
- \fBSource:\fR MIN2DHM\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .ta 1.63265i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_MIN2MIL() Convert minute of day to military format time\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_MIN2MIL()
- Convert minute of day to military format time\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_MIN2MIL( <nMINUTE> ) -> cMILTIME
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- .ta 0.88i
- \fB<nMINUTE>\fR numeric integer representing minute of day\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- .ta 0.96i
- <cMILTIME> character string of form hhmm, where 0<=hh<24\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Converts minute of the day to military format time\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- FT_MIN2MIL( 279 ) -> 0439
- .sp
- .in 0.08i
- \fBSource:\fR MILTIME\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_MIL2MIN()
- , FT_MIL2CIV()
- , FT_CIV2MIL()
- , FT_SYS2MIL()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_MONTH() Return Calendar or Fiscal Month Data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_MONTH()
- Return Calendar or Fiscal Month Data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_MONTH( [ <dGivenDate> ], [nMonthNum] ) -> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- \fB<nMonthNum>\fR is a number from 1 to 12 signifying a month\.
- Defaults to current month if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year and month as a character string "YYYYMM"
- .br
- aDateInfo[2] - The beginning date of the month
- .br
- aDateInfo[3] - The ending date of the month
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_MONTH() returns an array containing data about the month
- containing the given date\.
- .sp
- Normally the return data will be based on a year beginning
- on January 1st with weeks beginning on Sunday\.
- .sp
- The beginning of year date and/or beginning of week day can be
- changed by using FT_DATECNFG(), which will affect all subsequent
- calls to FT_MONTH() until another call to FT_DATECNFG()\.
- .sp
- The beginning of year date and beginning of week day may be reset
- to January 1 and Sunday by calling FT_DATECNFG() with no
- parameters\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // get info about month containing 9/15/90
- .br
- aDateInfo := FT_MONTH( CTOD("09/15/90") )
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[1] // 199009 (9th month)
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[2] // 09/01/90 beginning of month 9
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[3] // 09/30/90 end of week month 9
- .br
- .ta
- .sp
- .br
- // get info about month 5 in year containing 9/15/90
- .br
- aDateInfo := FT_MONTH( CTOD("09/15/90"), 5 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199005
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 05/01/90 beginning of month 5
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 05/31/90 end of month 5
- .br
- .ta
- .sp
- .br
- // get info about month 5 in current year
- .br
- aDateInfo := FT_MONTH( , 5 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199105
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 05/01/91 beginning of month 5
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 05/31/91 end of month 5
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR MONTH\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_WEEK()
- , FT_QTR()
- , FT_YEAR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_QTR() Return Calendar or Fiscal Quarter Data\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_QTR()
- Return Calendar or Fiscal Quarter Data\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_QTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- \fB<nQtrNum>\fR is a number from 1 to 4 signifying a quarter\.
- Defaults to current quarter if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year and quarter as a character string "YYYYQQ"
- .br
- aDateInfo[2] - The beginning date of the quarter
- .br
- aDateInfo[3] - The ending date of the quarter
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_QTR() returns an array containing data about the quarter
- containing the given date\.
- .sp
- Normally the return data will be based on a year beginning
- on January 1st with weeks beginning on Sunday\.
- .sp
- The beginning of year date and/or beginning of week day can be
- changed by using FT_DATECNFG(), which will affect all subsequent
- calls to FT_QTR() until another call to FT_DATECNFG()\.
- .sp
- The beginning of year date and beginning of week day may be reset
- to January 1 and Sunday by calling FT_DATECNFG() with no
- parameters\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // get info about quarter containing 9/15/90
- .br
- aDateInfo := FT_MONTH( CTOD("09/15/90") )
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[1] // 199009 (3rd quarter)
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[2] // 07/01/90 beginning of quarter 3
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[3] // 09/30/90 end of week quarter 3
- .br
- .ta
- .sp
- .br
- // get info about quarter 2 in year containing 9/15/90
- .br
- aDateInfo := FT_MONTH( CTOD("09/15/90"), 2 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199002
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 04/01/90 beginning of quarter 2
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 06/30/90 end of quarter 2
- .br
- .ta
- .sp
- .br
- // get info about quarter 2 in current year
- .br
- aDateInfo := FT_MONTH( , 2 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199102
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 04/01/91 beginning of quarter 2
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 06/30/91 end of quarter 2
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR QTR\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_WEEK()
- , FT_MONTH()
- , FT_YEAR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_SYS2MIL() Convert system time to military time format\.
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_SYS2MIL()
- Convert system time to military time format\.
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_SYS2MIL() -> cMILTIME
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- none
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- .ta 0.96i
- <cMILTIME> character string of form hhmm, where 0<=hh<24\.
- .br
- .ta
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Return current system time as character string in military format\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- FT_SYS2MIL() -> 1623
- .sp
- .in 0.08i
- \fBSource:\fR MILTIME\.PRG
- .sp
- \fBAuthor:\fR Alexander B\. Spencer
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_MIL2CIV()
- , FT_CIV2MIL()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_WEEK() Return calendar or fiscal week data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_WEEK()
- Return calendar or fiscal week data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_WEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateinfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- \fB<nWeekNum>\fR is a number from 1 to 53 signifying a week\.
- Defaults to current week if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year and week as a character string "YYYYWW"
- .br
- aDateInfo[2] - The beginning date of the week
- .br
- aDateInfo[3] - The ending date of the week
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_WEEK() returns an array containing data about the week
- containing the given date\.
- .sp
- Normally the return data will be based on a year beginning
- on January 1st with weeks beginning on Sunday\.
- .sp
- The beginning of year date and/or beginning of week day can be
- changed by using FT_DATECNFG(), which will affect all subsequent
- calls to FT_WEEK() until another call to FT_DATECNFG()\.
- .sp
- The beginning of year date and beginning of week day may be reset
- to January 1 and Sunday by calling FT_DATECNFG() with no
- parameters\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // get info about week containing 9/15/90
- .br
- aDateInfo := FT_WEEK( CTOD("09/15/90") )
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[1] // 199037 (37th week)
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[2] // 09/09/90 beginning of week 37
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[3] // 09/15/90 end of week 37
- .br
- .ta
- .sp
- .br
- // get info about week 25 in year containing 9/15/90
- .br
- aDateInfo := FT_WEEK( CTOD("09/15/90"), 25 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199025
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 06/17/90 beginning of week 25
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 06/23/90 end of week 25
- .br
- .ta
- .sp
- .br
- // get info about week 25 in current year
- .br
- aDateInfo := FT_WEEK( , 25 )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 199025
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 06/16/91 beginning of week 25
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 06/22/91 end of week 25
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR WEEK\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_MONTH()
- , FT_QTR()
- , FT_YEAR()
- .ta 1.63265i
- .in 0i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_WORKDAYS() Return number of work days between two dates
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_WORKDAYS()
- Return number of work days between two dates
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_WORKDAYS( [ <dStart> ], [ <dStop> ] ) -> nDays
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dStart>\fR is the beginning value for the date range\.
- .sp
- \fB<dStop>\fR is the ending value for the date range\.
- .sp
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- The number of work days (Monday through Friday) between two dates\.
- .sp
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_WORKDAYS() returns a number indicating the number of work days
- between two dates\. Work days are considered Monday through Friday\.
- .in 1.36i
- (The five day work week none of us Clipper programmers have\.)
- .sp
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.32i
- .ta 4.48i
- .br
- ? FT_WorkDays( CTOD("5/16/91"), CTOD("5/20/91") ) // 3 (Th - Mo)
- .br
- .ta
- .ta 4.48i
- .br
- ? FT_WorkDays( CTOD("5/18/91"), CTOD("5/19/91") ) // 0 (Sa - Su)
- .br
- .ta
- .ta 4.48i
- .br
- ? FT_WorkDays( CTOD("5/17/91"), CTOD("5/17/91") ) // 1 (Fr - Fr)
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR WORKDAYS\.PRG
- .sp
- \fBAuthor:\fR John F\. Kaster
- .in 0i
- .ta 1.63265i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_WOY() Find number of week within year
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_WOY()
- Find number of week within year
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_WOY( <dDate> ) -> <nResult>
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dDate>\fR is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- Return numeric position of week within the year or NIL if
- parameter does not conform\.
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- Considers a full week as starting on Sunday, ending on Saturday\.
- First week of year (week 1) may start on any day, and thus
- .in 0.56i
- contain any number of days\.
- .in 0.4i
- Final week of year (week 53) may contain any number of days\.
- Handles dates with CENTURY ON|OFF, to allow for 21st century\.
- Date validation must be external to this function\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- These code fragments find the week number, given a date\.
- .sp
- .br
- // literal character date
- .ta 0.56i
- .br
- dDate := CTOD("01/01/91")
- .br
- .ta
- .ta 2.96i
- .br
- nWkNum := FT_WOY(dDate) // result: 1
- .br
- .ta
- .sp
- .br
- // presume DOS date to be 01/06/91
- .ta 2.96i
- .br
- nWkNum := FT_WOY(DATE()) // result: 2
- .br
- .ta
- .sp
- .br
- // date input
- .ta 0.56i
- .br
- cDate := SPACE(8)
- .br
- .ta
- .ta 2.96i
- .br
- @ 4,10 get cDate PICT "##/##/##" // input 07/04/91
- .br
- .ta
- .br
- READ
- .ta 2.96i
- .br
- nWkNum := FT_WOY(CTOD(cDate)) // result: 27
- .br
- .ta
- .sp
- .br
- // last day of year
- .ta 3.04i
- .br
- nWkNum := FT_WOY(CTOD("12/31/91")) // result: 53
- .br
- .ta
- .sp
- For a demonstration of this function, compile and link the
- program WOY\.PRG in the Nanforum Toolkit source code\.
- .sp
- .in 0.08i
- \fBSource:\fR WOY\.PRG
- .sp
- \fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
- .in 0i
- .ta 1.63265i
- .sp 2
- .ne 20
- .ps +3
- .vs +3
- FT_YEAR() Return calendar or fiscal year data
- .br
- .ta
- .in 0.08i
- .ps -3
- .vs -3
- .sp 2
- \fBFT_YEAR()
- Return calendar or fiscal year data
- .in 0i
- .br
- \l'6.24i'
- .br
- .sp
- .in 0.08i
- \fBSyntax
- .sp
- .in 0.4i
- \fBFT_YEAR( [ <dGivenDate> ] ) -> aDateInfo
- .sp
- .in 0.08i
- \fBArguments
- .sp
- .in 0.4i
- \fB<dGivenDate>\fR is any valid date in any date format\. Defaults
- to current system date if not supplied\.
- .sp
- .in 0.08i
- \fBReturns
- .sp
- .in 0.4i
- A three element array containing the following data:
- .sp
- .in 0.64i
- .br
- aDateInfo[1] - The year as a character string "YYYY"
- .br
- aDateInfo[2] - The beginning date of the year
- .br
- aDateInfo[3] - The ending date of the year
- .sp
- .in 0.08i
- \fBDescription
- .sp
- .in 0.4i
- FT_YEAR() returns an array containing data about the year
- containing the given date\.
- .sp
- Normally the return data will be based on a year beginning
- on January 1st\.
- .sp
- The beginning of year date can be changed by using FT_DATECNFG(),
- which will affect all subsequent calls to FT_YEAR() until another
- call to FT_DATECNFG()\.
- .sp
- The beginning of year date may be reset to January 1 by calling
- FT_DATECNFG() with no parameters\.
- .sp
- .in 0.08i
- \fBExamples
- .sp
- .in 0.4i
- .br
- // Get info about year containing 9/15/90, assuming default
- .br
- // beginning of year is January 1st\.
- .br
- aDateInfo := FT_YEAR( Ctod("09/15/90") )
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 1990
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[2] // 01/01/90 beginning of year
- .br
- .ta
- .ta 1.36i 1.68i 2.72i
- .br
- ? aDateInfo[3] // 12/31/90 end of year
- .br
- .ta
- .sp
- .br
- // get info about current year (1991)\.
- .br
- aDateInfo := FT_YEAR()
- .ta 1.36i 1.68i
- .br
- ? aDateInfo[1] // 1991
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[2] // 01/01/91 beginning of year
- .br
- .ta
- .ta 1.36i 1.68i 2.56i
- .br
- ? aDateInfo[3] // 12/31/91 end of year
- .br
- .ta
- .sp
- .in 0.08i
- \fBSource:\fR YEAR\.PRG
- .sp
- \fBAuthor:\fR Jo W\. French dba Practical Computing
- .in 0i
- .sp
- .in 1.5i
- .ti -1.5i
- .ta 1.5i
- .ft B
- See Also:
- .ft R
- FT_DATECNFG()
- , FT_WEEK()
- , FT_MONTH()
- , FT_QTR()
-