2010-07-14 14:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbnf/acctyear.prg
* contrib/hbnf/byteneg.prg
* contrib/hbnf/isshare.prg
* contrib/hbnf/sinkey.prg
* contrib/hbnf/kspeed.c
* contrib/hbnf/prtscr.c
* contrib/hbnf/descendn.c
* contrib/hbnf/peek.c
* contrib/hbnf/scancode.prg
* contrib/hbnf/vidmode.prg
* contrib/hbnf/nwsem.prg
* contrib/hbnf/acctadj.prg
* contrib/hbnf/week.prg
* contrib/hbnf/vidcur.prg
* contrib/hbnf/iamidle.c
* contrib/hbnf/miltime.prg
* contrib/hbnf/prtesc.prg
* contrib/hbnf/acctmnth.prg
* contrib/hbnf/proper.c
* contrib/hbnf/savearr.prg
* contrib/hbnf/madd.prg
* contrib/hbnf/rand1.prg
* contrib/hbnf/dispmsg.prg
* contrib/hbnf/fttext.c
* contrib/hbnf/mouse1.prg
* contrib/hbnf/settime.prg
* contrib/hbnf/page.prg
* contrib/hbnf/restsets.prg
* contrib/hbnf/byt2bit.prg
* contrib/hbnf/setkeys.c
* contrib/hbnf/month.prg
* contrib/hbnf/byt2hex.prg
* contrib/hbnf/findith.prg
* contrib/hbnf/at2.prg
* contrib/hbnf/acctweek.prg
* contrib/hbnf/dispc.c
* contrib/hbnf/gcd.prg
* contrib/hbnf/pegs.prg
* contrib/hbnf/min2dhm.prg
* contrib/hbnf/acctqtr.prg
* contrib/hbnf/numlock.c
* contrib/hbnf/dosver.prg
* contrib/hbnf/nooccur.prg
* contrib/hbnf/dayofyr.prg
* contrib/hbnf/metaph.prg
* contrib/hbnf/ontick.c
* contrib/hbnf/menu1.prg
* contrib/hbnf/byteand.prg
* contrib/hbnf/sqzn.prg
* contrib/hbnf/bytexor.prg
* contrib/hbnf/ftidle.c
* contrib/hbnf/workdays.prg
* contrib/hbnf/byteor.prg
* contrib/hbnf/asum.prg
* contrib/hbnf/shift.c
* contrib/hbnf/sleep.prg
* contrib/hbnf/wda.prg
* contrib/hbnf/woy.prg
* contrib/hbnf/aavg.prg
* contrib/hbnf/any2any.prg
* contrib/hbnf/origin.c
* contrib/hbnf/mouse.c
* contrib/hbnf/chdir.c
* contrib/hbnf/adessort.prg
* contrib/hbnf/setdate.prg
* contrib/hbnf/netpv.prg
* contrib/hbnf/amedian.prg
* contrib/hbnf/blink.prg
* contrib/hbnf/stod.c
* contrib/hbnf/vertmenu.prg
* contrib/hbnf/linked.prg
* contrib/hbnf/qtr.prg
* contrib/hbnf/aredit.prg
* contrib/hbnf/n2color.c
* contrib/hbnf/alt.c
* contrib/hbnf/xbox.prg
* contrib/hbnf/ftround.prg
* contrib/hbnf/hex2dec.prg
* contrib/hbnf/getver.c
* contrib/hbnf/nwuid.prg
* contrib/hbnf/dectobin.prg
* contrib/hbnf/aemaxlen.prg
* contrib/hbnf/bitset.prg
* contrib/hbnf/nwlstat.prg
* contrib/hbnf/invclr.prg
* contrib/hbnf/ctrl.c
* contrib/hbnf/popadder.prg
* contrib/hbnf/lastday.prg
* contrib/hbnf/tempfile.prg
* contrib/hbnf/diskfunc.prg
* contrib/hbnf/scregion.prg
* contrib/hbnf/d2e.prg
* contrib/hbnf/mouse2.prg
* contrib/hbnf/ftisprn.c
* contrib/hbnf/pickday.prg
* contrib/hbnf/firstday.prg
* contrib/hbnf/daytobow.prg
* contrib/hbnf/anomatch.prg
* contrib/hbnf/menutonf.prg
* contrib/hbnf/ftattr.c
* contrib/hbnf/pvid.prg
* contrib/hbnf/isbiton.prg
* contrib/hbnf/color2n.c
* contrib/hbnf/isbit.prg
* contrib/hbnf/datecnfg.prg
* contrib/hbnf/cntryset.prg
* contrib/hbnf/putkey.c
* contrib/hbnf/getenvrn.c
* contrib/hbnf/easter.prg
* contrib/hbnf/bytenot.prg
* contrib/hbnf/ntow.prg
* contrib/hbnf/aeminlen.prg
* contrib/hbnf/poke.c
* contrib/hbnf/floptst.prg
* contrib/hbnf/pchr.prg
* contrib/hbnf/savesets.prg
* contrib/hbnf/tbwhile.prg
* contrib/hbnf/mkdir.c
* contrib/hbnf/year.prg
* contrib/hbnf/caplock.c
* contrib/hbnf/rmdir.c
* contrib/hbnf/calendar.prg
* contrib/hbnf/e2d.prg
* contrib/hbnf/elapsed.prg
* contrib/hbnf/sysmem.prg
* contrib/hbnf/bitclr.prg
* contrib/hbnf/eltime.prg
* contrib/hbnf/aading.prg
* contrib/hbnf/dfile.prg
* contrib/hbnf/elapmil.prg
* contrib/hbnf/setlastk.c
* contrib/hbnf/pending.prg
* contrib/hbnf/clrsel.prg
- Stripped NFDOC/HBDOC from source code.
This commit is contained in:
@@ -16,6 +16,142 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-07-14 14:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbnf/acctyear.prg
|
||||
* contrib/hbnf/byteneg.prg
|
||||
* contrib/hbnf/isshare.prg
|
||||
* contrib/hbnf/sinkey.prg
|
||||
* contrib/hbnf/kspeed.c
|
||||
* contrib/hbnf/prtscr.c
|
||||
* contrib/hbnf/descendn.c
|
||||
* contrib/hbnf/peek.c
|
||||
* contrib/hbnf/scancode.prg
|
||||
* contrib/hbnf/vidmode.prg
|
||||
* contrib/hbnf/nwsem.prg
|
||||
* contrib/hbnf/acctadj.prg
|
||||
* contrib/hbnf/week.prg
|
||||
* contrib/hbnf/vidcur.prg
|
||||
* contrib/hbnf/iamidle.c
|
||||
* contrib/hbnf/miltime.prg
|
||||
* contrib/hbnf/prtesc.prg
|
||||
* contrib/hbnf/acctmnth.prg
|
||||
* contrib/hbnf/proper.c
|
||||
* contrib/hbnf/savearr.prg
|
||||
* contrib/hbnf/madd.prg
|
||||
* contrib/hbnf/rand1.prg
|
||||
* contrib/hbnf/dispmsg.prg
|
||||
* contrib/hbnf/fttext.c
|
||||
* contrib/hbnf/mouse1.prg
|
||||
* contrib/hbnf/settime.prg
|
||||
* contrib/hbnf/page.prg
|
||||
* contrib/hbnf/restsets.prg
|
||||
* contrib/hbnf/byt2bit.prg
|
||||
* contrib/hbnf/setkeys.c
|
||||
* contrib/hbnf/month.prg
|
||||
* contrib/hbnf/byt2hex.prg
|
||||
* contrib/hbnf/findith.prg
|
||||
* contrib/hbnf/at2.prg
|
||||
* contrib/hbnf/acctweek.prg
|
||||
* contrib/hbnf/dispc.c
|
||||
* contrib/hbnf/gcd.prg
|
||||
* contrib/hbnf/pegs.prg
|
||||
* contrib/hbnf/min2dhm.prg
|
||||
* contrib/hbnf/acctqtr.prg
|
||||
* contrib/hbnf/numlock.c
|
||||
* contrib/hbnf/dosver.prg
|
||||
* contrib/hbnf/nooccur.prg
|
||||
* contrib/hbnf/dayofyr.prg
|
||||
* contrib/hbnf/metaph.prg
|
||||
* contrib/hbnf/ontick.c
|
||||
* contrib/hbnf/menu1.prg
|
||||
* contrib/hbnf/byteand.prg
|
||||
* contrib/hbnf/sqzn.prg
|
||||
* contrib/hbnf/bytexor.prg
|
||||
* contrib/hbnf/ftidle.c
|
||||
* contrib/hbnf/workdays.prg
|
||||
* contrib/hbnf/byteor.prg
|
||||
* contrib/hbnf/asum.prg
|
||||
* contrib/hbnf/shift.c
|
||||
* contrib/hbnf/sleep.prg
|
||||
* contrib/hbnf/wda.prg
|
||||
* contrib/hbnf/woy.prg
|
||||
* contrib/hbnf/aavg.prg
|
||||
* contrib/hbnf/any2any.prg
|
||||
* contrib/hbnf/origin.c
|
||||
* contrib/hbnf/mouse.c
|
||||
* contrib/hbnf/chdir.c
|
||||
* contrib/hbnf/adessort.prg
|
||||
* contrib/hbnf/setdate.prg
|
||||
* contrib/hbnf/netpv.prg
|
||||
* contrib/hbnf/amedian.prg
|
||||
* contrib/hbnf/blink.prg
|
||||
* contrib/hbnf/stod.c
|
||||
* contrib/hbnf/vertmenu.prg
|
||||
* contrib/hbnf/linked.prg
|
||||
* contrib/hbnf/qtr.prg
|
||||
* contrib/hbnf/aredit.prg
|
||||
* contrib/hbnf/n2color.c
|
||||
* contrib/hbnf/alt.c
|
||||
* contrib/hbnf/xbox.prg
|
||||
* contrib/hbnf/ftround.prg
|
||||
* contrib/hbnf/hex2dec.prg
|
||||
* contrib/hbnf/getver.c
|
||||
* contrib/hbnf/nwuid.prg
|
||||
* contrib/hbnf/dectobin.prg
|
||||
* contrib/hbnf/aemaxlen.prg
|
||||
* contrib/hbnf/bitset.prg
|
||||
* contrib/hbnf/nwlstat.prg
|
||||
* contrib/hbnf/invclr.prg
|
||||
* contrib/hbnf/ctrl.c
|
||||
* contrib/hbnf/popadder.prg
|
||||
* contrib/hbnf/lastday.prg
|
||||
* contrib/hbnf/tempfile.prg
|
||||
* contrib/hbnf/diskfunc.prg
|
||||
* contrib/hbnf/scregion.prg
|
||||
* contrib/hbnf/d2e.prg
|
||||
* contrib/hbnf/mouse2.prg
|
||||
* contrib/hbnf/ftisprn.c
|
||||
* contrib/hbnf/pickday.prg
|
||||
* contrib/hbnf/firstday.prg
|
||||
* contrib/hbnf/daytobow.prg
|
||||
* contrib/hbnf/anomatch.prg
|
||||
* contrib/hbnf/menutonf.prg
|
||||
* contrib/hbnf/ftattr.c
|
||||
* contrib/hbnf/pvid.prg
|
||||
* contrib/hbnf/isbiton.prg
|
||||
* contrib/hbnf/color2n.c
|
||||
* contrib/hbnf/isbit.prg
|
||||
* contrib/hbnf/datecnfg.prg
|
||||
* contrib/hbnf/cntryset.prg
|
||||
* contrib/hbnf/putkey.c
|
||||
* contrib/hbnf/getenvrn.c
|
||||
* contrib/hbnf/easter.prg
|
||||
* contrib/hbnf/bytenot.prg
|
||||
* contrib/hbnf/ntow.prg
|
||||
* contrib/hbnf/aeminlen.prg
|
||||
* contrib/hbnf/poke.c
|
||||
* contrib/hbnf/floptst.prg
|
||||
* contrib/hbnf/pchr.prg
|
||||
* contrib/hbnf/savesets.prg
|
||||
* contrib/hbnf/tbwhile.prg
|
||||
* contrib/hbnf/mkdir.c
|
||||
* contrib/hbnf/year.prg
|
||||
* contrib/hbnf/caplock.c
|
||||
* contrib/hbnf/rmdir.c
|
||||
* contrib/hbnf/calendar.prg
|
||||
* contrib/hbnf/e2d.prg
|
||||
* contrib/hbnf/elapsed.prg
|
||||
* contrib/hbnf/sysmem.prg
|
||||
* contrib/hbnf/bitclr.prg
|
||||
* contrib/hbnf/eltime.prg
|
||||
* contrib/hbnf/aading.prg
|
||||
* contrib/hbnf/dfile.prg
|
||||
* contrib/hbnf/elapmil.prg
|
||||
* contrib/hbnf/setlastk.c
|
||||
* contrib/hbnf/pending.prg
|
||||
* contrib/hbnf/clrsel.prg
|
||||
- Stripped NFDOC/HBDOC from source code.
|
||||
|
||||
2010-07-14 14:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* include/hbextern.ch
|
||||
* src/rtl/hbdoc.prg
|
||||
@@ -310,7 +446,7 @@
|
||||
* contrib/hbnf/rmdir.c
|
||||
* contrib/hbnf/setlastk.c
|
||||
! Fixed NFDOC formatting.
|
||||
; TODO: Strip docs.
|
||||
; TODO: Strip docs. [DONE]
|
||||
|
||||
2010-07-14 12:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbct/screen2.c
|
||||
|
||||
@@ -22,54 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_AADDITION()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Add elements unique of source array to target array
|
||||
* $SYNTAX$
|
||||
* FT_AADDITION( <aList1>, <aList2> [, <lTrimmer> [, <lCaseSens> ] ] ) ;
|
||||
* -> aNewArray
|
||||
* $ARGUMENTS$
|
||||
* <aList1> is the primary array.
|
||||
*
|
||||
* <aList2> is the secondary array.
|
||||
*
|
||||
* <lTrimmer> is a logical value denoting whether leading or
|
||||
* trailing spaces should be included in the
|
||||
* comparison. If .T., then ignores spaces in
|
||||
* comparison, defaults to .T., .F. includes spaces.
|
||||
*
|
||||
* <lCaseSens> is a logical value denoting case sensitivity.
|
||||
* If .T., then comparison is sensitive to case,
|
||||
* defaults to .T., .F. ignores case.
|
||||
* $RETURNS$
|
||||
* An array of the union of aList1 and aList2.
|
||||
* $DESCRIPTION$
|
||||
* This function will add the elements unique of aList2 with aList1.
|
||||
* It returns a new array including all the elements of aList1
|
||||
* plus the unique elements of aList2.
|
||||
* $EXAMPLES$
|
||||
* aList1 := {"apple", "orange", "pear"}
|
||||
* aList2 := {"apple ", "banana", "PEAR"}
|
||||
*
|
||||
* FT_AADDITION( aList1, aList2 )
|
||||
* // ignores spaces, sensitive to case
|
||||
* // returns {"apple","orange","pear","banana","PEAR"}
|
||||
*
|
||||
* FT_AADDITION( aList1, aList2, , .F. )
|
||||
* // ignores spaces, not sensitive to case
|
||||
* // returns {"apple","orange","pear","banana"}
|
||||
*
|
||||
* FT_AADDITION( aList1, aList2, .F., .F. )
|
||||
* // sensitive to spaces, not sensitive to case
|
||||
* // returns {"apple","orange","pear","apple ","banana"}
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
FUNCTION MAIN()
|
||||
@@ -109,7 +61,6 @@ FUNCTION MAIN()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
FUNCTION FT_AADDITION( aList1, aList2, lTrimmer, lCaseSens )
|
||||
|
||||
LOCAL nElement, nPos, bScanCode
|
||||
@@ -148,7 +99,6 @@ FUNCTION FT_AADDITION( aList1, aList2, lTrimmer, lCaseSens )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
|
||||
// Add the unique elements of aList2 to aList1.
|
||||
FOR nElement := 1 TO LEN( aList2 )
|
||||
|
||||
|
||||
@@ -24,42 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_AAVG()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Average numeric values in an array
|
||||
* $SYNTAX$
|
||||
* FT_AAVG( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nAverage
|
||||
* $ARGUMENTS$
|
||||
* <aArray> is the array containing the elements to be averaged.
|
||||
*
|
||||
* <nStartIndex> is the first array item to include,
|
||||
* defaults to first element.
|
||||
*
|
||||
* <nEndIndex> is the last array element to include,
|
||||
* defaults to all elements.
|
||||
* $RETURNS$
|
||||
* The average of the specified array elements.
|
||||
* $DESCRIPTION$
|
||||
* This function is used to get a numeric average of selected or all
|
||||
* elements of an array.
|
||||
*
|
||||
* This routine requires FT_ASUM().
|
||||
* $EXAMPLES$
|
||||
* FT_AAVG(aSubTotals) // Get Average of Entire Array
|
||||
*
|
||||
* FT_AAVG(aSubTotals, 5) // Get Average of 5th Element On
|
||||
*
|
||||
* FT_AAVG(aSubTotals, , 10) // Get Average of 1st 10 Elements
|
||||
*
|
||||
* FT_AAVG(aSubTotals, 5, 10) // Get Average of Elements 5-10
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#define FORCE_BETWEEN(x,y,z) (y := MAX(MIN(y,z),x))
|
||||
#define IS_NOT_ARRAY(x) (VALTYPE(x) != "A")
|
||||
|
||||
@@ -68,8 +32,6 @@
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
|
||||
FUNCTION FT_AAVG(aArray, nStartIndex, nEndIndex)
|
||||
|
||||
DEFAULT nStartIndex TO 1, ;
|
||||
|
||||
@@ -31,64 +31,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ACCTADJ()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Adjust beginning or ending fiscal pd. dates to acctg. dates
|
||||
* $SYNTAX$
|
||||
* FT_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any valid format.
|
||||
* Defaults to DATE() if not supplied.
|
||||
*
|
||||
* <lIsEnd> is a logical variable. .F. = adjust for beginning of
|
||||
* period mode, .T. = adjust for end of period mode. Defaults to
|
||||
* beginning of period mode.
|
||||
* $RETURNS$
|
||||
* An adjusted date dependent upon mode and work week start day.
|
||||
* $DESCRIPTION$
|
||||
* Called by other FT_ACCT.. functions. The algorithm is:
|
||||
*
|
||||
* Beginning of period mode:
|
||||
*
|
||||
* If dGivenDate is in last 3 days of work week
|
||||
* Return next week's start date
|
||||
* Else
|
||||
* Return this week's start date
|
||||
* Endif
|
||||
*
|
||||
* End of period mode:
|
||||
*
|
||||
* If dGivenDate is in last 4 days of work week
|
||||
* Return this week's end date
|
||||
* Else
|
||||
* Return prior week's end date
|
||||
* Endif
|
||||
* $EXAMPLES$
|
||||
* Beginning of period mode (lIsEnd == .F.)
|
||||
*
|
||||
* dDate := Ctod( "01/31/91" ) // In last 3 days of work week
|
||||
* ? FT_ACCTADJ( dDate ) // 02/03/91 (next week's start)
|
||||
*
|
||||
* dDate := Ctod( "03/31/91" ) // Not in last 3 days of work week
|
||||
* ? FT_ACCTADJ( dDate ) // 03/31/91 (this week's start)
|
||||
*
|
||||
* End of period mode (lIsEnd == .T.)
|
||||
*
|
||||
* dDate := Ctod( "01/31/91" ) // In last 4 days of work week
|
||||
* ? FT_ACCTADJ( dDate, .T. ) // 02/02/91 (this week's end)
|
||||
*
|
||||
* dDate := Ctod( "03/31/91" ) // Not in last 4 days of work week
|
||||
* ? FT_ACCTADJ( dDate, .T. ) // 03/30/91 (prior week's end)
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG() FT_DAYTOBOW()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_ACCTADJ(dGivenDate, lIsEnd)
|
||||
|
||||
LOCAL nTemp
|
||||
|
||||
@@ -27,60 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ACCTMONTH()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return accounting month data
|
||||
* $SYNTAX$
|
||||
* FT_ACCTMONTH( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any date format. Defaults
|
||||
* to current system date if not supplied.
|
||||
*
|
||||
* <nMonthNum> is a number from 1 to 12 signifying a month.
|
||||
* Defaults to current month if not supplied.
|
||||
* $RETURNS$
|
||||
* A three element array containing the following data:
|
||||
*
|
||||
* aDateInfo[1] - The year and month as a character string "YYYYMM"
|
||||
* aDateInfo[2] - The beginning date of the accounting month
|
||||
* aDateInfo[3] - The ending date of the accounting month
|
||||
* $DESCRIPTION$
|
||||
* FT_ACCTMONTH() creates an array containing data about the
|
||||
* accounting month containing the given date.
|
||||
*
|
||||
* An accounting period has the following characteristics:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* // get info about accounting month containing 9/15/90
|
||||
* aDateInfo := FT_ACCTMONTH( Ctod("09/15/90") )
|
||||
* ? aDateInfo[1] // 199009 (9th month)
|
||||
* ? aDateInfo[2] // 09/02/90 beginning of month 9
|
||||
* ? aDateInfo[3] // 09/29/90 end of month 9
|
||||
*
|
||||
* // get info about accounting month 5 in year containing 9/15/90
|
||||
* aDateInfo := FT_ACCTMONTH( Ctod("09/15/90"), 5 )
|
||||
* ? aDateInfo[1] // 199005
|
||||
* ? aDateInfo[2] // 04/29/89 beginning of month 5
|
||||
* ? aDateInfo[3] // 06/02/90 end of month 5
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG() FT_ACCTWEEK() FT_ACCTQTR() FT_ACCTYEAR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_ACCTMONTH(dGivenDate,nMonthNum)
|
||||
LOCAL nYTemp, nMTemp, lIsMonth, aRetVal
|
||||
|
||||
|
||||
@@ -27,60 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ACCTQTR()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return accounting quarter data
|
||||
* $SYNTAX$
|
||||
* FT_ACCTQTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any date format. Defaults
|
||||
* to current system date if not supplied.
|
||||
*
|
||||
* <nQtrNum> is a number from 1 to 4 signifying a quarter.
|
||||
* Defaults to current quarter if not supplied.
|
||||
* $RETURNS$
|
||||
* A three element array containing the following data:
|
||||
*
|
||||
* aDateInfo[1] - The year and qtr. as a character string "YYYYQQ"
|
||||
* aDateInfo[2] - The beginning date of the accounting quarter
|
||||
* aDateInfo[3] - The ending date of the accounting quarter
|
||||
* $DESCRIPTION$
|
||||
* FT_ACCTQTR() creates an array containing data about the
|
||||
* accounting quarter containing the given date.
|
||||
*
|
||||
* An accounting period has the following characteristics:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* // get info about accounting month containing 9/15/90
|
||||
* aDateInfo := FT_ACCTQTR( CTOD("09/15/90") )
|
||||
* ? aDateInfo[1] // 199003 (3rd quarter)
|
||||
* ? aDateInfo[2] // 07/01/90 beginning of quarter 3
|
||||
* ? aDateInfo[3] // 09/29/90 end of quarter 3
|
||||
*
|
||||
* // get info about accounting qtr. 2 in year containing 9/15/90
|
||||
* aDateInfo := FT_ACCTQTR( CTOD("09/15/90"), 2 )
|
||||
* ? aDateInfo[1] // 199002
|
||||
* ? aDateInfo[2] // 04/01/89 beginning of quarter 2
|
||||
* ? aDateInfo[3] // 06/30/90 end of quarter 2
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG() FT_ACCTWEEK() FT_ACCTMONTH() FT_ACCTYEAR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_ACCTQTR(dGivenDate,nQtrNum)
|
||||
LOCAL nYTemp, nQTemp, lIsQtr, aRetVal
|
||||
|
||||
|
||||
@@ -27,60 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ACCTWEEK()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return accounting week data
|
||||
* $SYNTAX$
|
||||
* FT_ACCTWEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any date format. Defaults
|
||||
* to current system date if not supplied.
|
||||
*
|
||||
* <nWeekNum> is a number from 1 to 52 signifying a week.
|
||||
* Defaults to current week if not supplied.
|
||||
* $RETURNS$
|
||||
* A three element array containing the following data:
|
||||
*
|
||||
* aDateInfo[1] - The year and week as a character string "YYYYWW"
|
||||
* aDateInfo[2] - The beginning date of the accounting week
|
||||
* aDateInfo[3] - The ending date of the accounting week
|
||||
* $DESCRIPTION$
|
||||
* FT_ACCTWEEK() returns an array containing data about the
|
||||
* accounting week containing the given date.
|
||||
*
|
||||
* An accounting period has the following characteristics:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* // get info about accounting week containing 9/15/90
|
||||
* aDateInfo := FT_ACCTWEEK( CTOD("09/15/90") )
|
||||
* ? aDateInfo[1] // 199037 (37th week)
|
||||
* ? aDateInfo[2] // 09/09/90 beginning of week 37
|
||||
* ? aDateInfo[3] // 09/15/90 end of week 37
|
||||
*
|
||||
* // get info about accounting week 25 in year containing 9/15/90
|
||||
* aDateInfo := FT_ACCTWEEK( CTOD("09/15/90"), 25 )
|
||||
* ? aDateInfo[1] // 199025
|
||||
* ? aDateInfo[2] // 06/17/89 beginning of week 25
|
||||
* ? aDateInfo[3] // 06/23/90 end of week 25
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG() FT_ACCTMONTH() FT_ACCTQTR() FT_ACCTYEAR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_ACCTWEEK(dGivenDate,nWeekNum)
|
||||
|
||||
LOCAL nTemp, lIsWeek, aRetVal
|
||||
|
||||
@@ -27,51 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ACCTYEAR()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return accounting year data
|
||||
* $SYNTAX$
|
||||
* FT_ACCTYEAR( [ <dGivenDate> ] ) -> aDateInfo
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any date format. Defaults
|
||||
* to current system date if not supplied.
|
||||
* $RETURNS$
|
||||
* A three element array containing the following data:
|
||||
*
|
||||
* aDateInfo[1] - The year as a character string "YYYY"
|
||||
* aDateInfo[2] - The beginning date of the accounting year
|
||||
* aDateInfo[3] - The ending date of the accounting year
|
||||
* $DESCRIPTION$
|
||||
* FT_ACCTYEAR() creates an array containing data about the
|
||||
* accounting year containing the given date.
|
||||
*
|
||||
* An accounting period has the following characteristics:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* // get info about accounting year containing 9/15/90
|
||||
* aDateInfo := FT_ACCTYEAR( CTOD("09/15/90") )
|
||||
* ? aDateInfo[1] // 1990
|
||||
* ? aDateInfo[2] // 12/31/89 beginning of year
|
||||
* ? aDateInfo[3] // 12/29/90 end of year
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG() FT_ACCTWEEK() FT_ACCTMONTH() FT_ACCTQTR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_ACCTYEAR(dGivenDate)
|
||||
|
||||
LOCAL nYTemp, aRetVal
|
||||
|
||||
@@ -24,40 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ADESSORT()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Sort an array in descending order
|
||||
* $SYNTAX$
|
||||
* FT_ADESSORT( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> aSorted
|
||||
* $ARGUMENTS$
|
||||
* <aArray> is the array to be sorted
|
||||
*
|
||||
* <nStartIndex> is the first array item to include in the sort,
|
||||
* defaults to first element
|
||||
*
|
||||
* <nEndIndex> is the last array element to include in the sort,
|
||||
* defaults to all elements
|
||||
* $RETURNS$
|
||||
* The array, sorted in descending order.
|
||||
* $DESCRIPTION$
|
||||
* This function is used to sort an array in descending order, i.e., Z-A
|
||||
* $EXAMPLES$
|
||||
* FT_ADESSORT(aNames) // Sort the Entire Array
|
||||
*
|
||||
* FT_ADESSORT(aNames, 5) // Sort from the 5th Element On
|
||||
*
|
||||
* FT_ADESSORT(aNames, , 10) // Sort the 1st 10 Elements
|
||||
*
|
||||
* FT_ADESSORT(aNames, 5, 10) // Sort Elements 5-10
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
@@ -69,7 +35,6 @@
|
||||
<Param1> := iif(VALTYPE(<Param1>) == <Type1>,<Param1>,<Def1>) ;
|
||||
[; <ParamN> := iif(VALTYPE(<ParamN>) == <TypeN>,<ParamN>,<DefN>)]
|
||||
|
||||
|
||||
#define FORCE_BETWEEN(x,y,z) (y := MAX(MIN(y,z),x))
|
||||
|
||||
FUNCTION FT_ADESSORT(aArray, nStartIndex, nEndIndex)
|
||||
|
||||
@@ -22,52 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_AEMAXLEN()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Find longest element within an array
|
||||
* $SYNTAX$
|
||||
* FT_AEMAXLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) ;
|
||||
* -> nMaxlen
|
||||
* $ARGUMENTS$
|
||||
* <aArray> is the array containing the elements to be measured.
|
||||
*
|
||||
* <nDimension> is the array dimension to be measured,
|
||||
* defaults to first dimension.
|
||||
*
|
||||
* <nStart> is the starting array element to include,
|
||||
* defaults to first array element.
|
||||
*
|
||||
* <nCount> is the number of array elements to process from
|
||||
* from <nStart>, defaults to remaining elements
|
||||
* in array.
|
||||
* $RETURNS$
|
||||
* The length of the longest size element of an array.
|
||||
* $DESCRIPTION$
|
||||
* This function will measure each element of an array
|
||||
* dimension and return the longest element.
|
||||
* $EXAMPLES$
|
||||
* FT_AEMAXLEN(aArray) // Measure the 1st dimension of an Array
|
||||
*
|
||||
* FT_AEMAXLEN(aArray,2) // Measure the 2nd dimension of an Array
|
||||
*
|
||||
* FT_AEMAXLEN(aArray,2,,9) // Measure Elements 1-9 of the
|
||||
* 2nd dimension or subarray
|
||||
*
|
||||
* FT_AEMAXLEN(aArray,3,5,9) // Measure Elements 5-9 of the
|
||||
* 3rd dimension or subarray
|
||||
*
|
||||
* FT_AEMAXLEN(aArray,3,5) // Measure Elements 5 to last in the
|
||||
* 3rd dimension or subarray
|
||||
* $SEEALSO$
|
||||
* FT_AEMINLEN()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
FUNCTION MAIN()
|
||||
@@ -97,7 +51,6 @@ FUNCTION MAIN()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
FUNCTION FT_AEmaxlen( aArray, nDimension, nStart, nCount )
|
||||
|
||||
LOCAL i, nLast, cType, nMaxlen := 0
|
||||
|
||||
@@ -22,49 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_AEMINLEN()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Find shortest element within an array
|
||||
* $SYNTAX$
|
||||
* FT_AEMINLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] )
|
||||
* -> nMinlen
|
||||
* $ARGUMENTS$
|
||||
* <aArray> is the array containing the elements to be measured.
|
||||
*
|
||||
* <nDimension> is the array dimension to be measured,
|
||||
* defaults to first dimension.
|
||||
*
|
||||
* <nStart> is the starting array element to include,
|
||||
* defaults to first array element.
|
||||
*
|
||||
* <nCount> is the number of array elements to process from
|
||||
* from <nStart>, defaults to remaining elements
|
||||
* in array.
|
||||
* $RETURNS$
|
||||
* The length of the shortest size element of an array.
|
||||
* $DESCRIPTION$
|
||||
* This function will measure each element of an array
|
||||
* dimension and return the shortest element.
|
||||
* $EXAMPLES$
|
||||
* FT_AEMINLEN(aArray) // Measure the 1st dimension of an Array
|
||||
*
|
||||
* FT_AEMINLEN(aArray,2) // Measure the 2nd dimension of an Array
|
||||
*
|
||||
* FT_AEMINLEN(aArray,2,,9) // Measure Elements 1-9 of 2nd dimension
|
||||
*
|
||||
* FT_AEMINLEN(aArray,3,5,9) // Measure Elements 5-9 of 3rd dimension
|
||||
*
|
||||
* FT_AEMINLEN(aArray,3,5) // Measure Elements 5 to end of 3rd dimension
|
||||
* $SEEALSO$
|
||||
* FT_AEMAXLEN()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
FUNCTION MAIN()
|
||||
@@ -97,7 +54,6 @@ FUNCTION MAIN()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
FUNCTION FT_AEminlen( aArray, nDimension, nStart, nCount )
|
||||
|
||||
LOCAL i, nLast, cType, nMinlen := 65519
|
||||
|
||||
@@ -34,34 +34,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ALT()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Determine status of the Alt key
|
||||
* $SYNTAX$
|
||||
* FT_ALT() -> lValue
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* .T. if Alt key is pressed, .F. if otherwise.
|
||||
* $DESCRIPTION$
|
||||
* This function is useful for times you need to know whether or not the
|
||||
* Alt key is pressed, such as during a MemoEdit().
|
||||
* $EXAMPLES$
|
||||
* IF FT_ALT()
|
||||
* @24, 0 say "Alt"
|
||||
* ELSE
|
||||
* @24, 0 say " "
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_CAPLOCK() FT_CTRL() FT_NUMLOCK() FT_PRTSCR() FT_SHIFT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapigt.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
|
||||
@@ -24,46 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_AMEDIAN()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Find middle value in array, or average of two middle values
|
||||
* $SYNTAX$
|
||||
* FT_AMEDIAN( <aArray> [, <nStart> [, <nEnd> ] ] )
|
||||
* -> nMedian
|
||||
* $ARGUMENTS$
|
||||
* <aArray> is the array containing the elements to be averaged.
|
||||
*
|
||||
* <nStart> is the first array element to include,
|
||||
* defaults to first element.
|
||||
*
|
||||
* <nEnd> is the last array element to include,
|
||||
* defaults to last element.
|
||||
* $RETURNS$
|
||||
* The median average of the array elements
|
||||
* $DESCRIPTION$
|
||||
* This function sorts the elements of a numeric array and
|
||||
* then returns the value in the middle element of the sorted
|
||||
* array. If there is no exact middle value, then it returns
|
||||
* the average of the two middle values. Half of the elements
|
||||
* are > median and half are < median. A median average may
|
||||
* more reflect a more useful average when there are extreme
|
||||
* values in the set.
|
||||
* $EXAMPLES$
|
||||
* FT_AMEDIAN( aArray ) // Return Median for entire array
|
||||
*
|
||||
* FT_AMEDIAN( aArray, 2) // Return Median for elements from 2 to end
|
||||
*
|
||||
* FT_AMEDIAN( aArray, ,9) // Return Median for 1st 9 elements
|
||||
*
|
||||
* FT_AMEDIAN( aArray,8,40 ) // Return Median for elements 8 to 40
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
#include "directry.ch"
|
||||
@@ -94,7 +54,6 @@ FUNCTION MAIN()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define FORCE_BETWEEN(x,y,z) (y := MAX(MIN(y,z),x))
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
@@ -102,7 +61,6 @@ FUNCTION MAIN()
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
FUNCTION FT_AMEDIAN( aArray, nStart, nEnd )
|
||||
|
||||
LOCAL nTemplen, aTemparray, nMiddle1, nMiddle2, nMedian
|
||||
|
||||
@@ -24,50 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ANOMATCHES()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Find the number of array elements meeting a condition
|
||||
* $SYNTAX$
|
||||
* FT_ANOMATCHES( <aArray>, <bCompareBlock> ;
|
||||
* [, <nStartIndex> [, <nEndIndex> ] ] ) -> nNoOfMatches
|
||||
* $ARGUMENTS$
|
||||
* <aArray> is the array to be searched
|
||||
*
|
||||
* <bCompareBlock> is a code block containing the expression for
|
||||
* the array elements to be tested with. Each element is passed
|
||||
* as a parameter to the block. If the block returns .T., the
|
||||
* number of matches will be incremented by one.
|
||||
*
|
||||
* <nStartIndex> is the first array item to include in the search,
|
||||
* defaults to first element.
|
||||
*
|
||||
* <nEndIndex> is the last array element to include in the search,
|
||||
* defaults to all elements.
|
||||
* $RETURNS$
|
||||
* The number of elements that cause the code block to return .T.
|
||||
* $DESCRIPTION$
|
||||
* This function returns the number of array elements that, when passed
|
||||
* to the supplied code block, cause that code block to return a .T. value.
|
||||
* $EXAMPLES$
|
||||
* // Search the Entire Array
|
||||
* FT_ANOMATCHES(aTries, { | x | x <= 100 } )
|
||||
*
|
||||
* // Search from the 5th Element On
|
||||
* FT_ANOMATCHES(aCodes, { | x | UPPER(x) == cCurrentCode }, 5)
|
||||
*
|
||||
* // Search the 1st 10 Elements
|
||||
* FT_ANOMATCHES(aDates, { | x | IS_BETWEEN(DATE()-7,x,DATE() + 7) }, 10)
|
||||
*
|
||||
* // Search Elements 5-10
|
||||
* FT_ANOMATCHES(aNames, { | x | x <= cLastGoodName }, 5, 10)
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#define FORCE_BETWEEN(x,y,z) (y := MAX(MIN(y,z),x))
|
||||
|
||||
#command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
|
||||
@@ -24,41 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_XTOY()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Convert from any data type to any other data type
|
||||
* $SYNTAX$
|
||||
* FT_XTOY( <xValueToConvert>, <cTypeToConvertTo> ;
|
||||
* [, <lWantYesNo> ] ) -> xResult
|
||||
* $ARGUMENTS$
|
||||
* <xValueToConvert> is the value to convert.
|
||||
*
|
||||
* <cTypeToConvertTo> is the type of value to convert to
|
||||
* ("C","D","L","N","A" or "B").
|
||||
*
|
||||
* <lWantYesNo> is a logical to signal if 'Y' or 'N' is to be returned
|
||||
* if Converting a logical, otherwise '.T.' or '.F.' will be returned
|
||||
* for logicals.
|
||||
* $RETURNS$
|
||||
* The original value converted to the new type.
|
||||
* $DESCRIPTION$
|
||||
* This function converts a value of character, date, numeric, logical,
|
||||
* array or code block type to any of the other type. While it is
|
||||
* guaranteed to return a value of the correct type, that value may not
|
||||
* be meaningful (i.e., converting from a code block returns an EMPTY()
|
||||
* value of the desired type).
|
||||
* $EXAMPLES$
|
||||
* nNumericValue := FT_XTOY(cInputValue, "N")
|
||||
* IF (FT_XTOY(nInputValue, "L"))
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#define BLOCKIFY(x) { || x }
|
||||
#define IS_CHAR(x) (VALTYPE(x) == "C")
|
||||
#define IS_DATE(x) (VALTYPE(x) == "D")
|
||||
@@ -95,7 +60,6 @@
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo)
|
||||
|
||||
DEFAULT lWantYesNo TO FALSE
|
||||
@@ -110,7 +74,6 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo)
|
||||
CASE cTypeToConvertTo == "D" .AND.; // They Want a Date
|
||||
IS_NOT_DATE(xValueToConvert)
|
||||
|
||||
|
||||
xValueToConvert := iif(IS_CHAR(xValueToConvert), ;
|
||||
; // Convert from a Character
|
||||
CTOD(xValueToConvert), ;
|
||||
@@ -126,7 +89,6 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo)
|
||||
CASE cTypeToConvertTo == "N" .AND.; // They Want a Number
|
||||
IS_NOT_NUMERIC(xValueToConvert)
|
||||
|
||||
|
||||
xValueToConvert := iif(IS_CHAR(xValueToConvert), ;
|
||||
; // Convert from a Character
|
||||
VAL(xValueToConvert), ;
|
||||
@@ -142,7 +104,6 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo)
|
||||
CASE cTypeToConvertTo == "L" .AND.; // They Want a Logical
|
||||
IS_NOT_LOGICAL(xValueToConvert)
|
||||
|
||||
|
||||
xValueToConvert := iif(IS_CHAR(xValueToConvert), ;
|
||||
; // Convert from a Character
|
||||
UPPER(xValueToConvert) == iif(lWantYesNo,"Y",".T."), ;
|
||||
@@ -158,13 +119,11 @@ FUNCTION FT_XTOY(xValueToConvert, cTypeToConvertTo, lWantYesNo)
|
||||
CASE cTypeToConvertTo == "A" .AND.; // They Want an Array
|
||||
IS_NOT_ARRAY(xValueToConvert)
|
||||
|
||||
|
||||
xValueToConvert := { xValueToConvert }
|
||||
|
||||
CASE cTypeToConvertTo == "B" .AND.; // They Want a Code Block
|
||||
IS_NOT_CODE_BLOCK(xValueToConvert)
|
||||
|
||||
|
||||
xValueToConvert := BLOCKIFY(xValueToConvert)
|
||||
|
||||
ENDCASE
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Some notes:
|
||||
@@ -42,79 +40,6 @@
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_AREDIT()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* 2 dimensional array editing function using TBrowse
|
||||
* $SYNTAX$
|
||||
* FT_AREDIT( <nTop>, <nLeft>, <nBottom>, <nRight>, <Array Name>, ;
|
||||
* <nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) -> xElement
|
||||
* $ARGUMENTS$
|
||||
* <nTop>, <nLeft>, <nBottom>, <nRight> are coordinates for TBrowse
|
||||
*
|
||||
* <Array Name> is name of 2 dimensional to array edit
|
||||
*
|
||||
* <nElem> is pointer for element in array
|
||||
*
|
||||
* <aHeadings> is array of column headings
|
||||
*
|
||||
* <aBlocks> is array of blocks describing each array element
|
||||
*
|
||||
* [ <bGetFunc> ] is get editing function for handling individual elements
|
||||
* $RETURNS$
|
||||
* Value of element positioned on when exit FT_AREDIT()
|
||||
* The type of this value depends on what is displayed.
|
||||
* $DESCRIPTION$
|
||||
* This function allows you to position yourself in an array,
|
||||
* add and delete rows with the <F7> and <F8> keys,
|
||||
* and pass a UDF with information to edit the individual gets.
|
||||
* $EXAMPLES$
|
||||
* FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks)
|
||||
*
|
||||
* This example will allow you to browse a 2 dimensional array
|
||||
* But you can't edit it since there is no GetBlock UDF
|
||||
* It allows the user to hit ENTER to select an element or ESC to
|
||||
* return 0
|
||||
*
|
||||
* * This second example shows how to edit a 2 dimensional array
|
||||
* * as might be done to edit an invoice
|
||||
*
|
||||
* LOCAL i, ar[3, 26], aBlocks[3], aHeadings[3]
|
||||
* LOCAL nElem := 1, bGetFunc
|
||||
*
|
||||
* * Set up two dimensional array "ar"
|
||||
*
|
||||
* FOR i = 1 TO 26
|
||||
* ar[1, i] := i // 1 -> 26 Numeric
|
||||
* ar[2, i] := CHR(i+64) // "A" -> "Z" Character
|
||||
* ar[3, i] := CHR(91-i) // "Z" -> "A" Character
|
||||
* NEXT i
|
||||
*
|
||||
* * SET UP aHeadings Array for column headings
|
||||
*
|
||||
* aHeadings := { "Numbers", "Letters", "Reverse" }
|
||||
*
|
||||
* * Need to set up individual array blocks for each TBrowse column
|
||||
*
|
||||
* aBlocks[1] := {|| STR(ar[1, nElem], 2) } // prevent default 10 spaces
|
||||
* aBlocks[2] := {|| ar[2, nElem] }
|
||||
* aBlocks[3] := {|| ar[3, nElem] }
|
||||
*
|
||||
* * set up TestGet() as the passed Get Function so FT_ArEdit knows how
|
||||
* * to edit the individual gets.
|
||||
*
|
||||
* bGetFunc := { | b, ar, nDim, nElem | TestGet(b, ar, nDim, nElem) }
|
||||
* SetColor( "N/W, W/N, , , W/N" )
|
||||
* CLEAR SCREEN
|
||||
* FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc)
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "inkey.ch"
|
||||
|
||||
* Default heading, column, footer separators
|
||||
|
||||
@@ -24,41 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ASUM()
|
||||
* $CATEGORY$
|
||||
* Array
|
||||
* $ONELINER$
|
||||
* Sum the elements of an array
|
||||
* $SYNTAX$
|
||||
* FT_ASUM( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) -> nSum
|
||||
* $ARGUMENTS$
|
||||
* <aArray> is the array containing the elements to be summed.
|
||||
*
|
||||
* <nStartIndex> is the first array item to include,
|
||||
* defaults to first element.
|
||||
*
|
||||
* <nEndIndex> is the last array element to include,
|
||||
* defaults to all elements.
|
||||
* $RETURNS$
|
||||
* The sum of the elements of the array or the lengths of the elements.
|
||||
* $DESCRIPTION$
|
||||
* This function is to sum the elements of a numeric array or to sum the
|
||||
* lengths of a character array.
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FT_ASUM(aSubTotals) // Sum the Entire Array
|
||||
*
|
||||
* FT_ASUM(aSubTotals, 5) // Sum from the 5th Element On
|
||||
*
|
||||
* FT_ASUM(aSubTotals, , 10) // Sum the 1st 10 Elements
|
||||
*
|
||||
* FT_ASUM(aSubTotals, 5, 10) // Sum Elements 5-10
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#define CASE_AT(x,y,z) z[AT(x,y)+1]
|
||||
#define FORCE_BETWEEN(x,y,z) (y := MAX(MIN(y,z),x))
|
||||
#define IS_CHAR(x) (VALTYPE(x) == "C")
|
||||
@@ -68,7 +33,6 @@
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
[; <ParamN> := iif(<ParamN> == NIL,<DefN>,<ParamN>)]
|
||||
|
||||
|
||||
FUNCTION FT_ASUM(aArray, nStartIndex, nEndIndex)
|
||||
|
||||
LOCAL nSumTotal := 0 // Array Sum
|
||||
|
||||
@@ -27,46 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_AT2()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Find position of the nth occurrence of a substring
|
||||
* $SYNTAX$
|
||||
* FT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
|
||||
* $ARGUMENTS$
|
||||
* <cSearch> is the character substring to search for.
|
||||
*
|
||||
* <cTarget> is the character string to search.
|
||||
*
|
||||
* <nOccurs> is the occurrence of cSearch to look for,
|
||||
* defaults to 1.
|
||||
*
|
||||
* <lCaseSens> is a logical value denoting case sensitivity.
|
||||
* If .F., then search is NOT sensitive to case,
|
||||
* defaults to .T.
|
||||
* $RETURNS$
|
||||
* The position of the nth occurrence of a substring
|
||||
* $DESCRIPTION$
|
||||
* This function will find the nth occurrence of a substring
|
||||
* within a string.
|
||||
* $EXAMPLES$
|
||||
* cSearch := "t"
|
||||
* cTarget := "This is the day that the Lord has made."
|
||||
*
|
||||
* FT_AT2( cSearch, cTarget ) // Returns ( 9 )
|
||||
*
|
||||
* FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 )
|
||||
*
|
||||
* FT_AT2( cSearch, cTarget, 2, .F. ) // Returns ( 9 )
|
||||
* $SEEALSO$
|
||||
* FT_FINDITH(), FT_RAT2()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
FUNCTION MAIN()
|
||||
@@ -95,7 +55,6 @@ FUNCTION MAIN()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
FUNCTION FT_AT2( cSearch, cTarget, nOccurs, lCaseSens )
|
||||
|
||||
LOCAL nCount, nPos, nPos2 := 0
|
||||
@@ -133,50 +92,10 @@ FUNCTION FT_AT2( cSearch, cTarget, nOccurs, lCaseSens )
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
|
||||
NEXT
|
||||
|
||||
RETURN nPos2
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_RAT2()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Find position of the reversed nth occurrence of a substring
|
||||
* $SYNTAX$
|
||||
* FT_RAT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
|
||||
* $ARGUMENTS$
|
||||
* <cSearch> is the character substring to search for.
|
||||
*
|
||||
* <cTarget> is the character string to search.
|
||||
*
|
||||
* <nOccurs> is the occurrence of cSearch to look for,
|
||||
* defaults to 1.
|
||||
*
|
||||
* <lCaseSens> is a logical value denoting case sensitivity.
|
||||
* If .F., then search is NOT sensitive to case,
|
||||
* defaults to .T.
|
||||
* $RETURNS$
|
||||
* The position of the nth occurrence of a reversed substring
|
||||
* $DESCRIPTION$
|
||||
* This function will find the nth occurrence of a reversed
|
||||
* substring within a string.
|
||||
* $EXAMPLES$
|
||||
* cSearch := "t"
|
||||
* cTarget := "This is the day that the Lord has made."
|
||||
*
|
||||
* FT_RAT2( cSearch, cTarget ) // Returns ( 22 )
|
||||
*
|
||||
* FT_RAT2( cSearch, cTarget, 2 ) // Returns ( 20 )
|
||||
*
|
||||
* FT_RAT2( cSearch, cTarget, 2, .F. ) // Returns ( 22 )
|
||||
* $SEEALSO$
|
||||
* FT_FINDITH(), FT_AT2()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_RAT2( cSearch, cTarget, nOccurs, lCaseSens )
|
||||
LOCAL nCount, nPos, nPos2 := 0
|
||||
LOCAL cSubstr := cTarget
|
||||
|
||||
@@ -24,52 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BITCLR()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Clear (reset) selected bit in a byte
|
||||
* $SYNTAX$
|
||||
* FT_BITCLR( <cByte>, <nBitPos> ) -> cByte
|
||||
* $ARGUMENTS$
|
||||
* <cByte> is a character from CHR(0) to CHR(255).
|
||||
*
|
||||
* <nBitPos> is a number from 0 to 7 conforming to standard
|
||||
* right-to-left bit numbering convention and representing the
|
||||
* position of the bit within the byte.
|
||||
* $RETURNS$
|
||||
* Returns new byte, with designated bit cleared (reset).
|
||||
* If parameters are faulty, returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* In effect, ANDs argument byte with a byte that has all bits set except
|
||||
* the target bit. If bit is already clear (0), it remains clear.
|
||||
* Note: Calls FT_ISBIT() which is also in this Library.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code would clear bit 4 in a byte represented by CHR(115):
|
||||
*
|
||||
* cNewByte := FT_BITCLR( CHR(115), 4 )
|
||||
* ? ASC( cNewbyte ) // result: 99
|
||||
* ? cNewByte // result: 'c'
|
||||
*
|
||||
* This code would clear bit 5 in the byte represented by letter 'A':
|
||||
*
|
||||
* FT_BITCLR( 'A', 5 ) // result: 'A', since
|
||||
* // bit 5 already clear
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BITSET() FT_ISBIT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BITCLR(cInbyte, nBitpos)
|
||||
|
||||
LOCAL cByte
|
||||
|
||||
@@ -24,54 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BITSET()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Set selected bit in a byte
|
||||
* $SYNTAX$
|
||||
* FT_BITSET( <cByte>, <nBitPos> ) -> cByte
|
||||
* $ARGUMENTS$
|
||||
* <cByte> is a character from CHR(0) to CHR(255).
|
||||
*
|
||||
* <nBitPos> is a number from 0 to 7 conforming to standard right-to-left
|
||||
* bit numbering convention and representing the position of the bit
|
||||
* within the byte.
|
||||
* $RETURNS$
|
||||
* Returns new byte, with designated bit set. If parameters are faulty,
|
||||
* returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* In effect, ORs argument byte with a byte that has only the target bit
|
||||
* set. If bit is already set, it remains set.
|
||||
* Note: Calls FT_ISBIT() which is also in this Library.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code would set bit 4 in a byte represented by CHR(107):
|
||||
*
|
||||
* cNewbyte := FT_BITSET( CHR(107), 4 )
|
||||
* ? ASC( cNewbyte ) // result: 123
|
||||
* ? cNewbyte // result: '{'
|
||||
*
|
||||
*
|
||||
* This code would set bit 5 in the byte represented by the letter 'A'.
|
||||
*
|
||||
* ? FT_BITSET( 'A', 5 ) // result: 'a'
|
||||
* // bit 5 set
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BITCLR() FT_ISBIT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BITSET(cInByte, nBitpos)
|
||||
|
||||
LOCAL cByte
|
||||
|
||||
@@ -24,35 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BLINK()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Display a blinking message on the screen
|
||||
* $SYNTAX$
|
||||
* FT_BLINK( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <cMsg> is the string to blink.
|
||||
*
|
||||
* <nRow> is an optional screen row for @...SAY, default current.
|
||||
*
|
||||
* <nCol> is an optional screen col for @...say, default current.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* A quick way to blink a msg on screen in the CURRENT colors.
|
||||
* Restores colors on return.
|
||||
* $EXAMPLES$
|
||||
* FT_BLINK( "WAIT", 5, 10 ) // Blinks "WAIT" in current colors @ 5,10
|
||||
*
|
||||
* @5,10 SAY "WAIT - Printing Report"
|
||||
* FT_BLINK( "..." ) // Blink "..." after wait message...
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
FUNCTION MAIN()
|
||||
FT_BLINK( "WAIT", 5, 10 )
|
||||
|
||||
@@ -24,49 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BYT2BIT()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Convert byte to string of 1's and 0's
|
||||
* $SYNTAX$
|
||||
* FT_BYT2BIT( <cByte> ) -> cBitPattern
|
||||
* $ARGUMENTS$
|
||||
* <cByte> is the byte to convert.
|
||||
* $RETURNS$
|
||||
* 9-character string, consisting of 1's and 0's, representing bits 0
|
||||
* through 7 of parameter byte, with space between bits 3 and 4. Returns
|
||||
* NIL if parameters are faulty.
|
||||
* $DESCRIPTION$
|
||||
* Can be used to show results of bit manipulation, both before and after.
|
||||
* Binary representation follows right-to-left convention of bit position
|
||||
* numbering, 0 through 7. Space between high and low nibbles for clarity
|
||||
* and easy comparison to hexadecimal notation.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* These three code lines perform a bitwise AND on bytes with values of
|
||||
* CHR(20) and CHR(36), and deliver the result as a string in binary (bit)
|
||||
* format.
|
||||
*
|
||||
* ? FT_BYT2BIT(CHR(20)) // byte1: '0001 0100'
|
||||
* ? FT_BYT2BIT(CHR(36)) // byte2: '0010 0100'
|
||||
*
|
||||
* ? FT_BYT2BIT(FT_BYTEAND(CHR(20), CHR(36)))
|
||||
* // result: '0000 0100'
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BYT2HEX()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BYT2BIT(cByte)
|
||||
|
||||
local nCounter, xBitstring
|
||||
|
||||
@@ -24,46 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BYT2HEX()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Convert byte to hexadecimal version of its binary value
|
||||
* $SYNTAX$
|
||||
* FT_BYT2HEX( cByte ) -> cHexValue
|
||||
* $ARGUMENTS$
|
||||
* <cByte> is the byte to convert.
|
||||
* $RETURNS$
|
||||
* Three-character string, consisting of two digits of hexadecimal
|
||||
* notation and letter 'h' to signify hex. Returns NIL if parameters are
|
||||
* faulty.
|
||||
* $DESCRIPTION$
|
||||
* Can be used to show results of bit manipulation, both before and after.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* These three code lines perform a bitwise AND on bytes with values of
|
||||
* CHR(20) and CHR(36), and deliver the result as a string in hexadecimal
|
||||
* format, using 'h' to signify hexadecimal.
|
||||
*
|
||||
* ? FT_BYT2HEX(CHR(20)) // byte1: '14h'
|
||||
* ? FT_BYT2HEX(CHR(36)) // byte2: '24h'
|
||||
*
|
||||
* ? FT_BYT2HEX(FT_BYTEAND(CHR(20), CHR(36)))
|
||||
* // result: '04h'
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BYT2BIT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BYT2HEX(cByte)
|
||||
|
||||
local cHexTable := "0123456789ABCDEF"
|
||||
|
||||
@@ -24,47 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BYTEAND()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Perform bit-wise AND on two ASCII characters (bytes)
|
||||
* $SYNTAX$
|
||||
* FT_BYTEAND( <cByte1>, <cByte2> ) -> cByte
|
||||
* $ARGUMENTS$
|
||||
* <cByte1> and <cByte2> are characters from CHR(0) TO CHR(255).
|
||||
* May be passed in CHR() form, as character literals, or as expressions
|
||||
* evaluating to CHR() values.
|
||||
* $RETURNS$
|
||||
* Returns resulting byte, in CHR() form. If parameters are faulty,
|
||||
* returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* Can be used for any bit-wise masking operation. In effect, this is a
|
||||
* bit-by-bit AND operation. Equivalent to AND assembler instruction.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code would mask out the high nibble (four most significant bits)
|
||||
* of the byte represented by chr(123) and leave the low nibble bits as in
|
||||
* the parameter byte.
|
||||
*
|
||||
* cNewbyte := FT_BYTEAND( CHR(123), CHR(15) )
|
||||
* ? asc(cNewByte) // result: 11
|
||||
* ? cNewByte // result: non-printable character
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BYTEAND(cByte1, cByte2)
|
||||
|
||||
LOCAL nCounter, cNewByte
|
||||
|
||||
@@ -24,44 +24,5 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BYTENEG()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Perform bit-wise negation on an ASCII character
|
||||
* $SYNTAX$
|
||||
* FT_BYTENEG( <cByte> ) -> cNewByte
|
||||
* $ARGUMENTS$
|
||||
* <cByte> is a character from CHR(0) to CHR(255).
|
||||
* May be passed in CHR() form, as character literal, or
|
||||
* as expression evaluating to CHR() value.
|
||||
* $RETURNS$
|
||||
* Returns resulting byte, in CHR() form. If parameters are faulty,
|
||||
* returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* Can be used for bit-wise byte manipulation. In effect, this is a
|
||||
* bit-by-bit NEG (two's complement) operation. Equivalent to NEG
|
||||
* assembler instruction.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code performs a bit-wise NEG on byte represented by CHR(32):
|
||||
*
|
||||
* cNewByte := FT_BYTENOT(CHR(32))
|
||||
* ? asc(cNewByte) // result: 224
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BYTEOR() FT_BYTEXOR() FT_BYTENOT() FT_BYTEAND()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
FUNCTION FT_BYTENEG(cByte)
|
||||
RETURN iif(valtype(cByte) != "C", NIL, chr((256 - asc(cByte)) % 256))
|
||||
|
||||
@@ -25,45 +25,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BYTENOT()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Perform bit-wise NOT on an ASCII character (byte)
|
||||
* $SYNTAX$
|
||||
* FT_BYTENOT( <cByte> ) -> cNewByte
|
||||
* $ARGUMENTS$
|
||||
* <cByte> is a character from CHR(0) to CHR(255).
|
||||
* May be passed in CHR() form, as character literal, or
|
||||
* as expression evaluating to CHR() value.
|
||||
* $RETURNS$
|
||||
* Returns resulting byte, in CHR() form. If parameters are faulty,
|
||||
* returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* Can be used for bitwise byte manipulation. In effect, this is a
|
||||
* bit-by-bit NOT (one's complement) operation. Equivalent to the
|
||||
* NOT assembler instruction.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code performs a bitwise NOT on byte represented by CHR(32):
|
||||
*
|
||||
* cNewByte := FT_BYTENOT( CHR(32) )
|
||||
* ? ASC( cNewByte ) // result: 223
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BYTEOR() FT_BYTEXOR() FT_BYTENEG() FT_BYTEAND()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BYTENOT(cByte)
|
||||
|
||||
LOCAL nCounter, cNewByte
|
||||
|
||||
@@ -24,45 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BYTEOR()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Perform bit-wise OR on two ASCII characters (bytes)
|
||||
* $SYNTAX$
|
||||
* FT_BYTEOR( <cByte1>, <cByte2> ) -> cNewByte
|
||||
* $ARGUMENTS$
|
||||
* <cByte1> and <cByte2> are characters from CHR(0) TO CHR(255).
|
||||
* May be passed in CHR() form, as character literals, or as
|
||||
* expressions evaluating to CHR() values.
|
||||
* $RETURNS$
|
||||
* Returns resulting byte, in CHR() form. If parameters are faulty,
|
||||
* returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* Can be used for bit-wise byte manipulation. In effect, this is a
|
||||
* bit-by-bit OR operation. Equivalent to OR assembler instruction.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code performs a bit-wise OR on two bytes represented
|
||||
* by CHR(20) and CHR(10):
|
||||
*
|
||||
* cNewByte := FT_BYTEOR( CHR(20), CHR(10) )
|
||||
* ? ASC( cNewByte ) // result: 30
|
||||
* ? cNewByte // result: non-printable character
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BYTEXOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BYTEOR(cByte1, cByte2)
|
||||
|
||||
LOCAL nCounter, cNewByte
|
||||
|
||||
@@ -27,45 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_BYTEXOR()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Perform bit-wise XOR on two ASCII characters (bytes)
|
||||
* $SYNTAX$
|
||||
* FT_BYTEXOR( <cByte1>, <cByte2> ) -> cNewByte
|
||||
* $ARGUMENTS$
|
||||
* <cByte1> and <cByte2> are characters from CHR(0) to CHR(255).
|
||||
* May be passed in CHR() form, as character literals, or
|
||||
* as expressions evaluating to CHR() values.
|
||||
* $RETURNS$
|
||||
* Returns resulting byte, in CHR() form. If parameters are faulty,
|
||||
* returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* Can be used for bit-wise byte manipulation. In effect, this is a
|
||||
* bit-by-bit XOR operation. Equivalent to XOR assembler instruction.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code performs a bit-wise XOR on two bytes represented
|
||||
* by CHR(32) and CHR(55):
|
||||
*
|
||||
* cNewByte := FT_BYTEXOR( CHR(32), CHR(55) )
|
||||
* ? ASC( cNewByte ) // result: 23
|
||||
* ? cNewByte // result: non-printable character
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BYTEOR() FT_BYTENOT() FT_BYTENEG() FT_BYTEAND()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_BYTEXOR(cByte1, cByte2)
|
||||
|
||||
LOCAL nCounter, cNewByte
|
||||
|
||||
@@ -21,81 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_CALENDAR()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Display date/time calendar, find a date, return calendar data.
|
||||
* $SYNTAX$
|
||||
* FT_CALENDAR ( [ <nRow> ], [ <nCol> ], [ <cColor> ], [ <lShadow> ] ,
|
||||
* [ <lShowHelp> ] ) -> aRetVal
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* <nRow> is an optional screen row for calendar display,
|
||||
* default row 1.
|
||||
*
|
||||
* <nCol> is an optional screen col for calendar display,
|
||||
* default col 63.
|
||||
*
|
||||
* <cColor> is an optional color string for displayed messages,
|
||||
* default is bright white text over green background.
|
||||
*
|
||||
* <lShadow> is an optional logical variable. If true (.T.),
|
||||
* it uses FT_SHADOW() to add a transparent shadow
|
||||
* to the display, default (.F.).
|
||||
*
|
||||
* <lShowHelp> is an optional logical variable. If true, uses
|
||||
* FT_XBOX to display a four line help message
|
||||
* if the F1 key is pressed, default (.F.).
|
||||
*
|
||||
* $RETURNS$
|
||||
* aRetVal is an 8 element array containing date, month, day, year,
|
||||
* month (in character format), day of the week, julian day
|
||||
* and current time.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
* 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:
|
||||
*
|
||||
* Element Value
|
||||
* [1] Date in current date format.
|
||||
* [2] Numeric month number.
|
||||
* [3] Numeric day number.
|
||||
* [4] Numeric year number.
|
||||
* [5] Month in character format.
|
||||
* [6] Day of the week in character format.
|
||||
* [7] Numeric Julian day.
|
||||
* [8] Current time in time format.
|
||||
*
|
||||
* WARNING: FT_CALENDAR uses FT_SHADOW and FT_XBOX
|
||||
* from the Nanforum Toolkit!
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* LOCAL aRetVal[8]
|
||||
* CLS
|
||||
* aRetVal := FT_CALENDAR (10,40,'W+/RB',.T.,.T.)
|
||||
* ?aRetVal[1] // Result: 04/20/91
|
||||
* ?aRetVal[2] // Result: 4
|
||||
* ?aRetVal[3] // Result: 20
|
||||
* ?aRetVal[4] // Result: 1991
|
||||
* ?aRetVal[5] // Result: April
|
||||
* ?aRetVal[6] // Result: Saturday
|
||||
* ?aRetVal[7] // Result: 110
|
||||
* ?aRetVal[8] // Result: 12:45:20
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_DAYOFYR()
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "setcurs.ch"
|
||||
|
||||
#ifdef FT_TEST
|
||||
@@ -119,7 +44,6 @@
|
||||
RETURN NIL
|
||||
#endif
|
||||
|
||||
|
||||
#include "inkey.ch"
|
||||
|
||||
FUNCTION FT_CALENDAR (nRow, nCol, cColor, lShadow, lShowHelp)
|
||||
|
||||
@@ -32,36 +32,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_CAPLOCK()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Determine and optionally change the status of CapLock key
|
||||
* $SYNTAX$
|
||||
* FT_CAPLOCK([ <lNewSetting> ]) -> lCurrentSetting
|
||||
* $ARGUMENTS$
|
||||
* <lNewSetting> is optional and if supplied is the new setting
|
||||
* for the CapLock key. Specify .T. to turn CapLock on, or .F. to
|
||||
* turn it off.
|
||||
* $RETURNS$
|
||||
* .T. if CapLock is set, .F. if it isn't set. The value returned
|
||||
* represents the setting in effect prior to any changes that might
|
||||
* by made by <lNewSetting>.
|
||||
* $DESCRIPTION$
|
||||
* This function is useful if you need to know or set the status of the
|
||||
* CapLock key for some reason.
|
||||
* $EXAMPLES$
|
||||
* IF FT_CAPLOCK()
|
||||
* Qout( "CapLock is active" )
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_ALT() FT_CTRL() FT_NUMLOCK() FT_PRTSCR() FT_SHIFT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapigt.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
|
||||
@@ -23,37 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_CHDIR()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Change the current directory
|
||||
* $SYNTAX$
|
||||
* FT_CHDIR( <cDirName> ) -> nResult
|
||||
* $ARGUMENTS$
|
||||
* <cDirName> is the name of the desired directory.
|
||||
* $RETURNS$
|
||||
* 0 if successful
|
||||
* 3 if path not found
|
||||
* 99 if invalid parameters passed
|
||||
* $DESCRIPTION$
|
||||
* Use this function if you prefer to change the active directory
|
||||
* instead of relying on the SET PATH command.
|
||||
*
|
||||
* The source code is written to adhere to Turbo Assembler's IDEAL mode.
|
||||
* To use another assembler, you will need to rearrange the PROC and
|
||||
* SEGMENT directives, and also the ENDP and ENDS directives (a very
|
||||
* minor task).
|
||||
* $EXAMPLES$
|
||||
* FT_CHDIR( "C:\clipper" )
|
||||
* FT_CHDIR( "\" )
|
||||
* FT_CHDIR( "..\source" )
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*This is the Original FT_CHDIR() code
|
||||
IDEAL
|
||||
MODEL HUGE
|
||||
|
||||
@@ -24,108 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ClrSel()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* User Selectable Colour Routine
|
||||
* $SYNTAX$
|
||||
* FT_ClrSel( <aClrData>, [ <lClrMode> ], [ <cTestChr> ] -> aClrData
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* <aClrData> is an array of subarrays, with each subarray containing
|
||||
* information about the colour settings.
|
||||
*
|
||||
* The subarray has the following structure:
|
||||
*
|
||||
* [1] cName is the name of this colour setting i.e. "Pick List"
|
||||
* Maximum length is 20 bytes
|
||||
*
|
||||
* [2] cClrStr is the current colour string
|
||||
* Default is "W/N,N/W,N/N,N/N,N/W"
|
||||
*
|
||||
* If Setting type is "M" (Menu) the colours are...
|
||||
* 1. Prompt Colour
|
||||
* 2. Message Colour
|
||||
* 3. HotKey Colour
|
||||
* 4. LightBar Colour
|
||||
* 5. LightBar HotKey Colour
|
||||
*
|
||||
* Note: While there are many ways to code the individual
|
||||
* colour combinations, they should be in the same
|
||||
* format that gets returned from SETCOLOR(), so
|
||||
* the defaults can be found in the colour palette.
|
||||
*
|
||||
* foreground [+] / background [*]
|
||||
* i.e. "GR+/BG*, N/W*, N+/N, , W/N"
|
||||
*
|
||||
* [3] cType is the type of colour setting
|
||||
* Default is "W" (Window)
|
||||
*
|
||||
* T = Title Only 1 colour element
|
||||
* D = Desktop Background colour and character
|
||||
* M = Menu For FT_Menuto() style menus
|
||||
* W = Window Windows with radio buttons
|
||||
* G = Get For use with @ SAY...
|
||||
* B = Browse For tBrowse() and *dbEdit()
|
||||
* A = aChoice Pick-lists etc...
|
||||
*
|
||||
* W/G/B/A are functionally the same but will provide
|
||||
* a more appropriate test display.
|
||||
*
|
||||
* [4] cFillChar is the character (for desktop background only)
|
||||
* Default is CHR(177) "±±±±±±±±±±±±±±"
|
||||
*
|
||||
*
|
||||
* <lClrMode> .T. use colour palette
|
||||
* .F. use monochrome palette
|
||||
*
|
||||
* Default is the ISCOLOR() setting
|
||||
*
|
||||
* <cTestChr> 2 Byte character string for colour test display
|
||||
*
|
||||
* Default is the CHR(254)+CHR(254) "þþ"
|
||||
*
|
||||
* $RETURNS$
|
||||
* An array identical to the one passed, with new selected colours
|
||||
* $DESCRIPTION$
|
||||
* This function allows users to select their own colour combinations
|
||||
* for all the different types of screen I/O in a typical application.
|
||||
* This facilitates an easy implementation of Ted Means' replacement
|
||||
* of the @..PROMPT/MENU TO found in the NanForum Toolkit. If you are
|
||||
* not using FT_MENUTO(), you can specify "A" for setting type and have
|
||||
* a normal colour string returned.
|
||||
* $EXAMPLES$
|
||||
* LOCAL aClrs := {}
|
||||
* LOCAL lColour := ISCOLOR()
|
||||
* LOCAL cChr := CHR(254) + CHR(254)
|
||||
*
|
||||
* SET SCOREBOARD Off
|
||||
* SETBLINK( .F. ) // Allow bright backgrounds
|
||||
*
|
||||
* *.... a typical application might have the following different settings
|
||||
* * normally these would be stored in a .dbf/.dbv
|
||||
* aClrs := {;
|
||||
* { "Desktop", "N/BG", "D", "±" }, ;
|
||||
* { "Title", "N/W", "T" }, ;
|
||||
* { "Top Menu", "N/BG,N/W,W+/BG,W+/N,GR+/N", "M" }, ;
|
||||
* { "Sub Menu", "W+/N*,GR+/N*,GR+/N*,W+/R,G+/R","M" }, ;
|
||||
* { "Standard Gets", "W/B, W+/N,,, W/N", "G" }, ;
|
||||
* { "Nested Gets", "N/BG, W+/N,,, W/N", "G" }, ;
|
||||
* { "Help", "N/G, W+/N,,, W/N", "W" }, ;
|
||||
* { "Error Messages", "W+/R*,N/GR*,,,N/R*", "W" }, ;
|
||||
* { "Database Query", "N/BG, N/GR*,,,N+/BG", "B" }, ;
|
||||
* { "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } ;
|
||||
* }
|
||||
*
|
||||
* aClrs := FT_ClrSel( aClrs, lColour, cChr )
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*
|
||||
* File Contents
|
||||
*
|
||||
|
||||
@@ -24,38 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_SETCENTURY()
|
||||
* $CATEGORY$
|
||||
* Environment
|
||||
* $ONELINER$
|
||||
* Check/Set the CENTURY Setting
|
||||
* $SYNTAX$
|
||||
* FT_SETCENTURY( [ <lNewSetState> ] ) -> <lOldState>
|
||||
* $ARGUMENTS$
|
||||
* lNewSetState - Boolean to Set CENTURY
|
||||
* .F. - Toggle CENTURY off
|
||||
* .T. - Toggle CENTURY on
|
||||
* If not specified, leave CENTURY as is
|
||||
* $RETURNS$
|
||||
* The state of the CENTURY setting upon entry to the routine
|
||||
* $DESCRIPTION$
|
||||
* This function returns the state (ON/OFF, TRUE/FALSE) of the CENTURY
|
||||
* and optionally sets it ON or OFF.
|
||||
* $EXAMPLES$
|
||||
* lOldState := FT_SETCENTURY() // Get current CENTURY Setting
|
||||
*
|
||||
* lOldState := FT_SETCENTURY(.T.) // Get the current CENTURY Setting
|
||||
* // and turn it on (set it to TRUE)
|
||||
*
|
||||
* lOldState := FT_SETCENTURY(.F.) // Get the current CENTURY Setting
|
||||
* // and turn it off (set it to FALSE)
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#define IS_LOGICAL(x) (VALTYPE(x) == "L")
|
||||
|
||||
FUNCTION FT_SETCENTURY(lNewSetState)
|
||||
|
||||
@@ -22,35 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_COLOR2N()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Returns the numeric complement of a Clipper color string
|
||||
* $SYNTAX$
|
||||
* FT_COLOR2N( <cColor> ) -> nValue
|
||||
* $ARGUMENTS$
|
||||
* <cColor> is a Clipper color string
|
||||
* $RETURNS$
|
||||
* The numeric complement of a color string or 0 if passed color
|
||||
* is invalid.
|
||||
* $DESCRIPTION$
|
||||
* This function is useful when calling other functions that expect
|
||||
* a numeric color parameter. It is often more convenient to pass
|
||||
* a converted color string than having to calculate or look up the
|
||||
* corresponding number.
|
||||
* $EXAMPLES$
|
||||
* nColor := FT_COLOR2N( "gr+/b" ) // returns 30
|
||||
*
|
||||
* FT_SETATTR( 0, 0, 10, 10, nColor )
|
||||
* $SEEALSO$
|
||||
* FT_N2COLOR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapigt.h"
|
||||
|
||||
|
||||
@@ -31,34 +31,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_CTRL()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Determine status of the Ctrl key
|
||||
* $SYNTAX$
|
||||
* FT_CTRL() -> lValue
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* .T. if Ctrl key is pressed, .F. if otherwise.
|
||||
* $DESCRIPTION$
|
||||
* This function is useful for times you need to know whether or not
|
||||
* the Ctrl key is pressed, such as during a MemoEdit().
|
||||
* $EXAMPLES$
|
||||
* IF FT_CTRL()
|
||||
* @24, 0 say "Ctrl"
|
||||
* ELSE
|
||||
* @24, 0 say " "
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_CAPLOCK() FT_NUMLOCK() FT_PRTSCR() FT_SHIFT() FT_ALT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapigt.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
|
||||
@@ -24,42 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_D2E()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Convert decimal to scientific notation
|
||||
* $SYNTAX$
|
||||
* FT_D2E( <nDec>, <nPrecision> ) -> <cNumE>
|
||||
* $ARGUMENTS$
|
||||
* <nDec> Decimal number to convert
|
||||
*
|
||||
* <nPrecision> Number of decimal places in result.
|
||||
* Defaults to 6 decimal places.
|
||||
* $RETURNS$
|
||||
* <cNumE> A string representing a number in
|
||||
* scientific notation
|
||||
* $DESCRIPTION$
|
||||
* Given a decimal number and the desired precision,
|
||||
* a string representing the equivalent in scientific
|
||||
* notation is returned.
|
||||
* $EXAMPLES$
|
||||
* ? FT_D2E( 12.345, 2 )
|
||||
* -> 1.23E1
|
||||
*
|
||||
* ? FT_D2E( -12.345, 3 )
|
||||
* -> -1.235E1
|
||||
*
|
||||
* ? FT_D2E( 0.00000543, 2 )
|
||||
* -> 5.43E-6
|
||||
* $SEEALSO$
|
||||
* FT_E2D()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#define log10( num ) log( num ) / log( 10 )
|
||||
#define DEFAULT_PRECISION 6
|
||||
#command DEFAULT <p> TO <val> => <p> := iif( <p> == NIL, <val>, <p> )
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifdef FT_TEST
|
||||
********************************************************************
|
||||
*
|
||||
@@ -168,7 +167,6 @@
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
* DEMO Monthly Calendar function.
|
||||
* nType : 0 = FT_MONTH, 1 = FT_ACCTMONTH
|
||||
*
|
||||
@@ -231,81 +229,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DATECNFG()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Set beginning of year/week for FT_ date functions
|
||||
* $SYNTAX$
|
||||
* FT_DATECNFG( [ <cFYStart> ], [ <nDow> ] ) -> aDateInfo
|
||||
* $ARGUMENTS$
|
||||
* <cFYStart> 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.
|
||||
*
|
||||
* Note: The year portion of the date string must be present and
|
||||
* be a valid year; however, it has no real meaning.
|
||||
*
|
||||
* <nDow> 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.
|
||||
*
|
||||
* $RETURNS$
|
||||
* A 2-element array containing the following information:
|
||||
*
|
||||
* aDateInfo[1] - an ANSI date string indicating the beginning
|
||||
* date of the year. Only the month and day are
|
||||
* meaningful.
|
||||
*
|
||||
* aDateInfo[2] - the number of the first day of the week
|
||||
* (1 = Sunday)
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
* 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.
|
||||
*
|
||||
* 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().
|
||||
*
|
||||
* It is not necessary to call FT_DATECNFG() unless you need to
|
||||
* change the defaults.
|
||||
*
|
||||
* FT_DATECNFG() affects the following library functions:
|
||||
*
|
||||
* FT_WEEK() FT_ACCTWEEK() FT_DAYTOBOW()
|
||||
* FT_MONTH() FT_ACCTMONTH() FT_DAYOFYR()
|
||||
* FT_QTR() FT_ACCTQTR() FT_ACCTADJ()
|
||||
* FT_YEAR() FT_ACCTYEAR()
|
||||
* $EXAMPLES$
|
||||
* // Configure library date functions to begin year on
|
||||
* // July 1st.
|
||||
*
|
||||
* FT_DATECNFG("07/01/80") // year is insignificant
|
||||
*
|
||||
* // Examples of return values:
|
||||
*
|
||||
* // System date format: American aArray[1] aArray[2]
|
||||
*
|
||||
* aArray := FT_DATECNFG() // '1980.01.01' 1 (Sun.)
|
||||
* aArray := FT_DATECNFG('07/01/80') // '1980.07.01' 1 (Sun.)
|
||||
* aArray := FT_DATECNFG('07/01/80', 2) // '1980.07.01' 2 (Mon.)
|
||||
* aArray := FT_DATECNFG( , 2 ) // '1980.01.01' 2 (Mon.)
|
||||
*
|
||||
* // System date format: British
|
||||
*
|
||||
* aArray := FT_DATECNFG('01/07/80', 2) // '1980.07.01' 2 (Mon.)
|
||||
* $SEEALSO$
|
||||
* FT_ACCTADJ()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_DATECNFG( cFYStart ,nDow )
|
||||
|
||||
STATIC aDatePar := { "1980.01.01", 1 }
|
||||
|
||||
@@ -27,66 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DAYOFYR()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return calendar, fiscal or accounting day data
|
||||
* $SYNTAX$
|
||||
* FT_DAYOFYR( [ <dGivenDate> ], [ <nDayNum> ], [ <lIsAcct> ] )
|
||||
* -> aDateInfo
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any valid format. Defaults
|
||||
* to current system date if not supplied.
|
||||
*
|
||||
* <nDayNum> is a number from 1 to 371, signifying a day of a year.
|
||||
* Defaults to current day if not supplied.
|
||||
*
|
||||
* <lIsAcct> is a logical which specifies the type of year to base
|
||||
* the return value on: .F. = calendar or fiscal year,
|
||||
* .T. = accounting year.
|
||||
* $RETURNS$
|
||||
* A three element array containing the following data:
|
||||
*
|
||||
* If <nDayNum> is specified:
|
||||
*
|
||||
* aDateInfo[1] - The date of the specified day number
|
||||
* aDateInfo[2] - The beginning date of the year
|
||||
* aDateInfo[3] - The ending date of the year
|
||||
*
|
||||
* If <nDayNum> is not specified:
|
||||
*
|
||||
* aDateInfo[1] - The year and day as a character string "YYYYDDD"
|
||||
* aDateInfo[2] - The beginning date of the year
|
||||
* aDateInfo[3] - The ending date of the year
|
||||
* $DESCRIPTION$
|
||||
* FT_DAYOFYR() returns an array containing data about a day in the
|
||||
* calendar or fiscal year containing the given date.
|
||||
*
|
||||
* The beginning of year date defaults to January 1st but may be
|
||||
* changed with FT_DATECNFG().
|
||||
* $EXAMPLES$
|
||||
* aDateInfo := FT_DAYOFYR( CTOD("03/31/91") )
|
||||
* ? aDateInfo[1] // 1991090 (90th day of year 1991)
|
||||
* ? aDateInfo[2] // 01/01/91
|
||||
* ? aDateInfo[3] // 12/31/91
|
||||
*
|
||||
* aDateInfo := FT_DAYOFYR( , 90 ) // assume current date is 3/31/91
|
||||
* ? aDateInfo[1] // 03/31/91 (90th day of year)
|
||||
* ? aDateInfo[2] // 01/01/91
|
||||
* ? aDateInfo[3] // 12/31/91
|
||||
*
|
||||
* aDateInfo := FT_DAYOFYR( , 90, .T. )
|
||||
* ? aDateInfo[1] // 03/29/91 (90th day of accounting year)
|
||||
* ? aDateInfo[2] // 12/30/90 (1st day of accounting year)
|
||||
* ? aDateInfo[3] // 12/28/91 (last day of accounting year)
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_DAYOFYR( dGivenDate, nDayNum, lIsAcct)
|
||||
LOCAL lIsDay, nTemp, aRetVal
|
||||
|
||||
|
||||
@@ -27,43 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DAYTOBOW()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Calculate no. of days between date and beginning of week
|
||||
* $SYNTAX$
|
||||
* FT_DAYTOBOW( [ <dGivenDate> ] ) -> nDays
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any valid date format.
|
||||
* Defaults to current date if not supplied.
|
||||
* $RETURNS$
|
||||
* A positive number of days to beginning of week, range 0 to 6.
|
||||
* $DESCRIPTION$
|
||||
* 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().
|
||||
* $EXAMPLES$
|
||||
* dDate := CTOD( "09/15/90" )
|
||||
*
|
||||
* ? DOW( dDate ) // 7
|
||||
* ? CDOW( dDate ) // Saturday
|
||||
* ? FT_DAYTOBOW( dDate ) // 6
|
||||
*
|
||||
* // change beginning of week to Friday (yeah!)
|
||||
* FT_DATECNFG( , 6 )
|
||||
* ? DOW( dDate ) // 7
|
||||
* ? CDOW( dDate ) // Saturday
|
||||
* ? FT_DAYTOBOW( dDate ) // 1
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG() FT_ACCTWEEK() FT_WEEK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_DAYTOBOW( dGivenDate )
|
||||
|
||||
LOCAL nRetVal, nDOW_Start
|
||||
|
||||
@@ -24,28 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DEC2BIN()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Convert decimal to binary
|
||||
* $SYNTAX$
|
||||
* FT_DEC2BIN( <nNum> ) -> cBinaryNumber
|
||||
* $ARGUMENTS$
|
||||
* <nNum> is the numeric expression to be converted.
|
||||
* $RETURNS$
|
||||
* A character string representing <nNum> in binary format.
|
||||
* $DESCRIPTION$
|
||||
* This function can be used in conjunction with any bit-wise
|
||||
* operations.
|
||||
* $EXAMPLES$
|
||||
* QOut( FT_DEC2BIN(255) ) // "11111111"
|
||||
* QOut( FT_DEC2BIN(2) ) // "00000010"
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
FUNCTION MAIN
|
||||
|
||||
@@ -21,30 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_Descend()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Create a descending index key value
|
||||
* $SYNTAX$
|
||||
* FT_Descend( <exp> ) -> <value>
|
||||
* $ARGUMENTS$
|
||||
* <exp> is any expression of character, numeric, date, or logical type.
|
||||
* $RETURNS$
|
||||
* The inverse of <exp>
|
||||
* $DESCRIPTION$
|
||||
* This function is a replacement for CA-Cl*pper's Descend() function,
|
||||
* which is known to produce memory corruption occassionally.
|
||||
* $EXAMPLES$
|
||||
* ? FT_Descend( 1 ) // Returns -1
|
||||
* $SEEALSO$
|
||||
* FT_XTOY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
THREAD static nHandle := 0
|
||||
|
||||
#ifdef FT_TEST
|
||||
@@ -83,64 +81,6 @@ THREAD static nHandle := 0
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DFSETUP()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Set up parameters for FT_DISPFILE()
|
||||
* $SYNTAX$
|
||||
* FT_DFSETUP( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ;
|
||||
* <nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>, ;
|
||||
* <lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) -> nResult
|
||||
* $ARGUMENTS$
|
||||
* <cInFile> - text file to display (full path and filename)
|
||||
* <nTop> - upper row of window
|
||||
* <nLeft> - left col of window
|
||||
* <nBottom> - lower row of window
|
||||
* <nRight> - right col of window
|
||||
* <nStart> - line to place highlight at startup
|
||||
* <nCNormal> - normal text color (numeric attribute)
|
||||
* <nCHighlight> - text highlight color (numeric attribute)
|
||||
* <cExitKeys> - terminating key list (each byte of string is a
|
||||
* key code)
|
||||
* <lBrowse> - act-like-a-browse-routine flag
|
||||
* <nColSkip> - col increment for left/right arrows
|
||||
* <nRMargin> - right margin - anything to right is truncated
|
||||
* <nBuffSize> - size of the paging buffer
|
||||
* $RETURNS$
|
||||
* 0 if successful, FError() code if not
|
||||
* $DESCRIPTION$
|
||||
* Note: make sure you allocate a buffer large enough to hold enough
|
||||
* data for the number of lines that you have in the window. Use the
|
||||
* following formula as a guideline:
|
||||
*
|
||||
* buffer size = (# of line) + 1 * RMargin
|
||||
*
|
||||
* This is the smallest you should make the buffer. For normal use,
|
||||
* 4096 bytes is recommended
|
||||
* $EXAMPLES$
|
||||
* @ 4,9 TO 11,71
|
||||
*
|
||||
* FT_DFSETUP("test.txt", 5, 10, 10, 70, 1, 7, 15,;
|
||||
* "AaBb" + Chr(143), .T., 5, 132, 4096)
|
||||
*
|
||||
* cKey = FT_DISPFILE()
|
||||
*
|
||||
* FT_DFCLOSE()
|
||||
*
|
||||
* @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']'
|
||||
* $SEEALSO$
|
||||
* FT_DISPFILE() FT_DFCLOSE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function FT_DFSETUP(cInFile, nTop, nLeft, nBottom, nRight,;
|
||||
nStart, nCNormal, nCHighlight, cExitKeys,;
|
||||
lBrowse, nColSkip, nRMargin, nBuffSize )
|
||||
@@ -182,42 +122,6 @@ function FT_DFSETUP(cInFile, nTop, nLeft, nBottom, nRight,;
|
||||
|
||||
return (rval)
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DFCLOSE()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Close file displayed by FT_DISPFILE()
|
||||
* $SYNTAX$
|
||||
* FT_DFCLOSE() -> NIL
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Closes the file opened by FT_DFSETUP()
|
||||
* $EXAMPLES$
|
||||
* @ 4,9 TO 11,71
|
||||
*
|
||||
* FT_DFSETUP("test.txt", 5, 10, 10, 70, 1, 7, 15,;
|
||||
* "AaBb" + Chr(143), .T., 5, 132, 4096)
|
||||
*
|
||||
* cKey = FT_DISPFILE()
|
||||
*
|
||||
* FT_DFCLOSE()
|
||||
*
|
||||
* @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']'
|
||||
* $SEEALSO$
|
||||
* FT_DFSETUP() FT_DISPFILE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
function FT_DFCLOSE()
|
||||
|
||||
if ( nHandle > 0 )
|
||||
|
||||
@@ -39,66 +39,14 @@
|
||||
RETURN NIL
|
||||
#endif
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DSKSIZE()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Return the maximum capacity of a fixed disk
|
||||
* $SYNTAX$
|
||||
* FT_DSKSIZE( [ <cDrive> ] ) -> nMaxCapacity
|
||||
* $ARGUMENTS$
|
||||
* <cDrive> is the fixed disk to query. If no drive is sent, the
|
||||
* operation will be performed on the default drive. Send without
|
||||
* the ":".
|
||||
* $RETURNS$
|
||||
* An integer representing the maximum disk capacity in bytes.
|
||||
* $DESCRIPTION$
|
||||
* Function utilizing FT_INT86() to return Maximum Disk Size.
|
||||
* Uses FT_INT86() through the internal function _ftDiskInfo().
|
||||
* $EXAMPLES$
|
||||
* ? FT_DSKSIZE() // Maximum capacity for default drive
|
||||
* ? FT_DSKSIZE( "D" ) // Maximum capacity for Drive D:
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_DSKSIZE( cDrive )
|
||||
local nDrive
|
||||
nDrive := iif( cDrive == NIL, 0, at( upper(cDrive), DRVTABLE ) )
|
||||
|
||||
Return DISKSPACE(nDrive,3)
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DSKFREE()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Return the amount of available disk space
|
||||
* $SYNTAX$
|
||||
* FT_DSKFREE( [ <cDrive> ] ) -> nSpaceAvail
|
||||
* $ARGUMENTS$
|
||||
* <cDrive> is the fixed disk to query. If no parameter is passed
|
||||
* the operation will be performed on the default drive. Do not
|
||||
* include the ":".
|
||||
* $RETURNS$
|
||||
* Integer representing the available disk space in bytes.
|
||||
* $DESCRIPTION$
|
||||
* Function to return the available space on the passed
|
||||
* drive letter or the default drive if no drive is passed.
|
||||
*
|
||||
* Uses FT_INT86() through the internal function _ftDiskInfo().
|
||||
* $EXAMPLES$
|
||||
* ? FT_DSKFREE() // Returns free space on default drive.
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
FUNCTION FT_DSKFREE( cDrive )
|
||||
local nDrive
|
||||
nDrive := iif( cDrive == NIL, 0, at( upper(cDrive), DRVTABLE ) )
|
||||
|
||||
|
||||
RETURN DISKSPACE(nDrive,1)
|
||||
|
||||
@@ -101,7 +101,6 @@ char *vseg; /* video segment variable */
|
||||
|
||||
/* prototypes */
|
||||
|
||||
|
||||
static void chattr(int x, int y, int len, int attr);
|
||||
static HB_FOFFSET getblock( HB_FOFFSET offset );
|
||||
static void buff_align(void);
|
||||
@@ -114,8 +113,6 @@ static void lineup(void);
|
||||
static void filetop(void);
|
||||
static void filebot(void);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* chattr() replace the color attribute with a new one starting at
|
||||
* location x, y and going for length len.
|
||||
@@ -134,9 +131,6 @@ static void chattr(int x, int y, int len, int attr)
|
||||
*vmem = (char) attr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* function getblock() reads the text file and returns the a block.
|
||||
* the variables offset and buffsize tell it where to start reading and
|
||||
@@ -183,11 +177,6 @@ static HB_FOFFSET getblock( HB_FOFFSET offset )
|
||||
return hb_fsSeekLarge( infile, 0, FS_RELATIVE ) - buffbot;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* buff_align makes sure the buffer top and bottom variables point
|
||||
* to actual complete lines of text.
|
||||
@@ -239,10 +228,6 @@ static void buff_align()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* win_align takes the value for wintop and then figures out where
|
||||
* winbot would be. if winbot would extend past the end of the
|
||||
@@ -286,10 +271,6 @@ static void win_align()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* this routine displays the actual text in the window. This is done
|
||||
* by taking each line and placing it in a string. the screen line
|
||||
@@ -304,7 +285,6 @@ static void disp_update(int offset)
|
||||
int line, col, pos, i;
|
||||
char *vmem;
|
||||
|
||||
|
||||
bRefresh = HB_FALSE;
|
||||
line = 0;
|
||||
|
||||
@@ -353,10 +333,6 @@ static void disp_update(int offset)
|
||||
hb_gtRest( sline, scol, eline, ecol, vseg );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* move the window pointers so that a new window's worth of information
|
||||
* is visible. it adjusts the pointers within the buffer and if necessary
|
||||
@@ -404,10 +380,6 @@ static void winup()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* move the window pointers so that a new window's worth of information
|
||||
* is visible. it adjusts the pointers within the buffer and if necessary
|
||||
@@ -457,10 +429,6 @@ static void windown()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* move the cursor one line down */
|
||||
|
||||
static void linedown()
|
||||
@@ -471,10 +439,6 @@ static void linedown()
|
||||
windown();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* move the cursor one line up */
|
||||
|
||||
static void lineup()
|
||||
@@ -485,10 +449,6 @@ static void lineup()
|
||||
winup();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* go to the top of the file */
|
||||
|
||||
static void filetop()
|
||||
@@ -508,10 +468,6 @@ static void filetop()
|
||||
win_align();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* goto the bottom of the file */
|
||||
|
||||
static void filebot()
|
||||
@@ -531,7 +487,6 @@ static void filebot()
|
||||
win_align();
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( _FT_DFINIT )
|
||||
{
|
||||
int rval;
|
||||
@@ -560,7 +515,6 @@ HB_FUNC( _FT_DFINIT )
|
||||
buffer = (char *) hb_xalloc(buffsize); /* allocate memory */
|
||||
lbuff = (char *) hb_xalloc(maxlin + 1); /* for buffers */
|
||||
|
||||
|
||||
bIsAllocated = !(buffer == NULL || lbuff == NULL || vseg == NULL);
|
||||
/* memory allocated? */
|
||||
if (!bIsAllocated)
|
||||
@@ -599,8 +553,6 @@ HB_FUNC( _FT_DFINIT )
|
||||
|
||||
colinc = hb_parni(11); /* column skip value */
|
||||
|
||||
|
||||
|
||||
bufftop = 0; /* init buffer top pointer */
|
||||
buffbot = buffsize; /* init buffer bottom pointer */
|
||||
buffoffset = 0; /* curr line offset into buffer */
|
||||
@@ -609,8 +561,6 @@ HB_FUNC( _FT_DFINIT )
|
||||
wintop = 0; /* init window top pointer */
|
||||
winbot = 0; /* init window bottom pointer */
|
||||
|
||||
|
||||
|
||||
/* get file size */
|
||||
|
||||
fsize = hb_fsSeek( infile, 0, FS_END ) - 1;
|
||||
@@ -655,67 +605,6 @@ HB_FUNC ( _FT_DFCLOS )
|
||||
}
|
||||
}
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DISPFILE()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Browse a text file
|
||||
* $SYNTAX$
|
||||
* FT_DISPFILE() -> cExitkey
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* The ASCII keystroke that terminated FT_DISPFILE()
|
||||
* $DESCRIPTION$
|
||||
* This routine displays a text file within a defined window using as
|
||||
* little memory as possible. The text file to display has to be
|
||||
* present or an error value of 0 is returned (as a character.)
|
||||
*
|
||||
* Assumptions: The routine assumes that all lines are terminated
|
||||
* with a CR/LF sequence (0x0d and 0x0a).
|
||||
*
|
||||
* Note: Make sure you allocate a buffer large enough to hold
|
||||
* enough data for the number of lines that you have
|
||||
* in the window. Use the following formula as a
|
||||
* guideline - buffer size = (# of line) + 1 * RMargin
|
||||
* this is the smallest you should make the buffer and
|
||||
* for normal use I recommend 4096 bytes.
|
||||
*
|
||||
* Cursor Keys: Up, Down - moves the highlight line
|
||||
* Left, Right - moves the window over nColSkip col's
|
||||
* Home - moves the window to the far left
|
||||
* End - moves the window to the nRMargin column
|
||||
* PgUp, PgDn - moves the highlight one page
|
||||
* Ctrl-PgUp - moves the highlight to the file top
|
||||
* Ctrl-PgDn - moves the highlight to the file bottom
|
||||
* Ctrl-Right - moves the window 16 col's to the right
|
||||
* Ctrl-Left - moves the window 16 col's to the left
|
||||
*
|
||||
* Esc, Return - terminates the function
|
||||
*
|
||||
* All other keys are ignored unless they are specified
|
||||
* within cExitKeys parameter. This list will tell the
|
||||
* routine what keys terminate the function. Special
|
||||
* keys must be passed by a unique value and that value
|
||||
* can be found by looking in the keys.h file.
|
||||
* $EXAMPLES$
|
||||
* @ 4,9 TO 11,71
|
||||
*
|
||||
* FT_DFSETUP("test.txt", 5, 10, 10, 70, 1, 7, 15,;
|
||||
* "AaBb" + Chr(143), .T., 5, 132, 4096)
|
||||
*
|
||||
* cKey = FT_DISPFILE()
|
||||
*
|
||||
* FT_DFCLOSE()
|
||||
*
|
||||
* @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']'
|
||||
* $SEEALSO$
|
||||
* FT_DFSETUP() FT_DFCLOSE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_DISPFILE )
|
||||
{
|
||||
int i;
|
||||
@@ -724,7 +613,6 @@ HB_FUNC( FT_DISPFILE )
|
||||
|
||||
int ch;
|
||||
|
||||
|
||||
/* make sure buffers were allocated and file was opened */
|
||||
if (bIsAllocated && infile > 0)
|
||||
{
|
||||
@@ -870,7 +758,6 @@ HB_FUNC( FT_DISPFILE )
|
||||
else
|
||||
ch = 0;
|
||||
|
||||
|
||||
/* store the key pressed as a character to be returned */
|
||||
|
||||
/* return key value to caller */
|
||||
|
||||
@@ -27,100 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DISPMSG()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Display a message and optionally waits for a keypress
|
||||
* $SYNTAX$
|
||||
* FT_DISPMSG( <aMessageArray>, [ <cKey2Check> ],
|
||||
* [ <nTopBoxRow> ], [ <nLeftBoxColumn> ],
|
||||
* [ <cnBoxType> ], [ <lShadow> ] ) -> lKeyMatch
|
||||
* $ARGUMENTS$
|
||||
* <aMessageArray> is a multidimensional array of messages to be
|
||||
* displayed and the color attributes for each message.
|
||||
*
|
||||
* The first dimension of the array contains one or more elements,
|
||||
* each representing one line in the message box, up to the maximum
|
||||
* number of rows on the screen.
|
||||
*
|
||||
* Within each line of the message individual characters or groups
|
||||
* of characters may be delimited with braces ([]). The braces will
|
||||
* be stripped out and the character(s) inside those braces will be
|
||||
* highlighted.
|
||||
*
|
||||
* The second dimension of the array contains a color attribute for
|
||||
* the corresponding element in dimension one, plus one additional
|
||||
* element for the color of the box border. Dimension two will
|
||||
* always contain one more element than dimension one. If an
|
||||
* attribute is omitted, the last color selected will be used.
|
||||
*
|
||||
* <Key2Check> is a character string of one or more keys to check
|
||||
* for. If omitted, the message is displayed and control is returned
|
||||
* to the calling procedure. If one character is specified,
|
||||
* FT_DISPMSG() waits for one keypress, restores the screen and
|
||||
* returns. If multiple characters are specified, FT_DISPMSG()
|
||||
* remains in a loop until one of the specified keys has been
|
||||
* pressed, then restores the screen and returns.
|
||||
*
|
||||
* <nTopBoxRow> is the upper row for the message box. If omitted, the
|
||||
* box is centered vertically.
|
||||
*
|
||||
* <nLeftBoxColumn> is the leftmost column for the box. If omitted, the
|
||||
* box is centered horizontally.
|
||||
*
|
||||
* <cnBoxType> is a string of characters or a variable for the box
|
||||
* border. See the DISPBOX() function. If omitted, a double box is
|
||||
* drawn.
|
||||
*
|
||||
* <lShadow> is a logical variable. If true (.T.) or omitted, it
|
||||
* uses FT_SHADOW() to add a transparent shadow to the box. If
|
||||
* false (.F.), the box is drawn without the shadow.
|
||||
* $RETURNS$
|
||||
* If <Key2Check> is not specified, FT_DISPMSG() will return false
|
||||
* (.F.).
|
||||
*
|
||||
* If <Key2Check> is a one-character string, FT_DISPMSG() will return
|
||||
* true (.T.) if the user presses that key, or false (.F.) if any
|
||||
* other key is pressed.
|
||||
*
|
||||
* If <Key2Check> consists of multiple characters, it will lock the
|
||||
* user in a loop until one of those keys are pressed and return the
|
||||
* INKEY() value of the keypress.
|
||||
* $DESCRIPTION$
|
||||
* FT_DISPMSG() is a multi-purpose pop-up for user messages.
|
||||
* Multiple lines may be displayed, each with a different attribute.
|
||||
* The box will be automatically centered on the screen, or the row
|
||||
* and/or column can be specified by the programmer. It also centers
|
||||
* each line of the message within the box.
|
||||
* $EXAMPLES$
|
||||
* The following example displays a simple two-line message
|
||||
* and returns immediately to the calling routine.
|
||||
*
|
||||
* FT_DISPMSG( { { "Printing Report" , ;
|
||||
* "Press [ESC] To Interrupt" } , ;
|
||||
* { "W+/B*", "W/B", "GR+/B" } } )
|
||||
*
|
||||
* The next example displays a message and waits for a key press.
|
||||
*
|
||||
* FT_DISPMSG( { { "Press [D] To Confirm Deletion" , ;
|
||||
* "Or Any Other Key To Abort" } , ;
|
||||
* { "W+/B", "W+/B", "GR+/B" } } , ;
|
||||
* "D" )
|
||||
*
|
||||
* The next example displays a one-line message centered on row 5
|
||||
* and returns to the calling procedure.
|
||||
*
|
||||
* FT_DISPMSG( { { "Please Do Not Interrupt" } , ;
|
||||
* { "W+/B", "GR+/B" } } , ;
|
||||
* , 5, )
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#include "inkey.ch"
|
||||
#include "setcurs.ch"
|
||||
|
||||
@@ -140,7 +46,6 @@ PROCEDURE Main( cCmdLine )
|
||||
nMaxRow, ;
|
||||
nType
|
||||
|
||||
|
||||
// main routine starts here
|
||||
SET SCOREBOARD OFF
|
||||
|
||||
@@ -190,9 +95,6 @@ PROCEDURE Main( cCmdLine )
|
||||
#endif
|
||||
// end of demo program
|
||||
|
||||
|
||||
|
||||
|
||||
FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow )
|
||||
|
||||
LOCAL xRtnVal := .F., ;
|
||||
@@ -277,7 +179,6 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow )
|
||||
FT_Shadow( nBoxTop, nBoxLeft, nBoxBottom, nBoxRight )
|
||||
ENDIF
|
||||
|
||||
|
||||
/* fill array with left positions for each row */
|
||||
aLeft := ARRAY( LEN( aInfo[1] ) )
|
||||
FOR i := 1 TO LEN( aInfo[1] )
|
||||
@@ -295,13 +196,11 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
|
||||
/* display messages */
|
||||
FOR i := 1 TO LEN( aInfo[1] )
|
||||
@ nBoxTop+i, aLeft[i] SAY aInfo[1,i] COLOR aInfo[2,i]
|
||||
NEXT
|
||||
|
||||
|
||||
/* highlight characters */
|
||||
FOR i := 1 TO LEN( aPos )
|
||||
FOR j := 1 TO LEN( aPos[i] )
|
||||
@@ -314,7 +213,6 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow )
|
||||
NEXT
|
||||
NEXT
|
||||
|
||||
|
||||
IF cKey != NIL
|
||||
IF LEN( cKey ) == 1
|
||||
nOption := FT_SInkey(0)
|
||||
|
||||
@@ -25,47 +25,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_DOSVER
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Return the current DOS major and minor version as a string
|
||||
* $SYNTAX$
|
||||
* FT_DOSVER() -> <cVersion>
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* A character string with the major version number first, a
|
||||
* period ("."), then the minor version number (e.g., "3.30")
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* FT_DOSVER() invokes DOS interrupt 21h, service 30 in order to
|
||||
* return the current DOS version. It does this by setting up
|
||||
* an array corresponding to machine registers and then calling
|
||||
* the toolkit function FT_INT86().
|
||||
*
|
||||
* It returns a character string corresponding to the DOS
|
||||
* version, as follows: The major version, a period ("."), then
|
||||
* the minor version.
|
||||
*
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FUNCTION main()
|
||||
* RETURN QOut( "Dos version: " + FT_DOSVER() )
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
#define DOS 33
|
||||
#define DOSVER 48
|
||||
|
||||
|
||||
#ifdef FT_TEST
|
||||
FUNCTION MAIN()
|
||||
QOut( "Dos version: " + FT_DOSVER() )
|
||||
|
||||
@@ -24,37 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_E2D()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Convert scientific notation string to a decimal
|
||||
* $SYNTAX$
|
||||
* FT_E2D( <cNumE> ) -> <nDec>
|
||||
* $ARGUMENTS$
|
||||
* <cNumE> Scientific notation string to convert
|
||||
* $RETURNS$
|
||||
* <nDec> Decimal number
|
||||
* $DESCRIPTION$
|
||||
* Given a string in the format x.yEz, the decimal
|
||||
* equivalent is returned.
|
||||
* $EXAMPLES$
|
||||
* ? FT_E2D( "1.23E1" )
|
||||
* -> 12.3
|
||||
*
|
||||
* ? FT_E2D( "-1.235E1" )
|
||||
* -> -12.35
|
||||
*
|
||||
* ? ft_d2e( "5.43E-6" )
|
||||
* -> 0.0000543
|
||||
* $SEEALSO$
|
||||
* FT_D2E()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
function main( sNumE )
|
||||
return qout( FT_E2D( sNumE ) )
|
||||
|
||||
@@ -26,34 +26,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_EASTER()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return the date of Easter
|
||||
* $SYNTAX$
|
||||
* FT_EASTER( <xYear> ) -> dEdate
|
||||
* $ARGUMENTS$
|
||||
* xYear can be a character, date or numeric describing the year
|
||||
* for which you wish to receive the date of Easter.
|
||||
* $RETURNS$
|
||||
* The actual date that Easter occurs.
|
||||
* $DESCRIPTION$
|
||||
* 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.
|
||||
*
|
||||
* This function can be useful in calender type programs that indicate
|
||||
* when holidays occur.
|
||||
* $EXAMPLES$
|
||||
* dEdate := FT_EASTER( 1990 ) // returns 04/15/1990
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
FUNCTION FT_EASTER (nYear)
|
||||
local nGold, nCent, nCorx, nCorz, nSunday, nEpact, nMoon,;
|
||||
nMonth := 0, nDay := 0
|
||||
|
||||
@@ -24,33 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ELAPMIN()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return difference, in minutes, between two mil format times.
|
||||
* $SYNTAX$
|
||||
* FT_ELAPMIN( <cTIME1>, <cTIME2> ) -> nMINUTES
|
||||
* $ARGUMENTS$
|
||||
* <cTIME1, cTIME2> character strings of military form "hhmm",
|
||||
* where 0<=hh<24.
|
||||
* $RETURNS$
|
||||
* <nMINUTES>
|
||||
* $DESCRIPTION$
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* FT_ELAPMIN( "1718", "2040" ) -> 322
|
||||
* FT_ELAPMIN( "2040", "1718" ) -> -322
|
||||
* $SEEALSO$
|
||||
* FT_ELTIME() FT_MIL2MIN() FT_MIN2MIL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_ELAPMIN(cTIME1,cTIME2)
|
||||
return ((VAL(LEFT(cTIME2,2))*60) + (VAL(RIGHT(cTIME2,2)))) - ;
|
||||
((VAL(LEFT(cTIME1,2))*60) + (VAL(RIGHT(cTIME1,2))))
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
FUNCTION DEMO()
|
||||
@@ -47,48 +46,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ELAPSED()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return elapsed time between two days and/or times
|
||||
* $SYNTAX$
|
||||
* FT_ELAPSED([ <dStart> ], [ <dEnd> ], ;
|
||||
* <cTimeStart>, <cTimeEnd>) -> aTimedata
|
||||
* $ARGUMENTS$
|
||||
* <dStart> is any valid date in any date format. Defaults to DATE().
|
||||
*
|
||||
* <dEnd> is any valid date in any date format. Defaults to DATE().
|
||||
*
|
||||
* <cTimeStart> is a valid Time string of the format 'hh:mm:ss' where
|
||||
* hh is hours in 24-hour format.
|
||||
*
|
||||
* <cTimeEnd> is a valid Time string of the format 'hh:mm:ss' where
|
||||
* hh is hours in 24-hour format.
|
||||
* $RETURNS$
|
||||
* A two-dimensional array containing elapsed time data.
|
||||
* $DESCRIPTION$
|
||||
* FT_ELAPSED() calculates the elapsed time between two Date/Time events.
|
||||
*
|
||||
* It returns an array which contains the following data:
|
||||
*
|
||||
* aRetVal[1,1] Integer Days aRetVal[1,2] Total Days (nn.nnnn)
|
||||
* aRetVal[2,1] Integer Hours aRetVal[2,2] Total Hours (nn.nnnn)
|
||||
* aRetVal[3,1] Integer Minutes aRetVal[3,2] Total Minutes (nn.nnnn)
|
||||
* aRetVal[4,1] Integer Seconds aRetVal[4,2] Total Seconds (nn)
|
||||
* $EXAMPLES$
|
||||
* FT_ELAPSED(CTOD('11/28/90'), CTOD('11/30/90'), '08:00:00', '12:10:30')
|
||||
* will return:
|
||||
*
|
||||
* aRetVal[1,1] -> 2 (Days) aRetVal[1,2] -> 2.1740 Days
|
||||
* aRetVal[2,1] -> 4 (Hours) aRetVal[2,2] -> 52.1750 Hours
|
||||
* aRetVal[3,1] -> 10 (Minutes) aRetVal[3,2] -> 3130.5000 Minutes
|
||||
* aRetVal[4,1] -> 30 (Seconds) aRetVal[4,2] -> 187830 Seconds
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd)
|
||||
LOCAL nTotalSec, nCtr, nConstant, nTemp, aRetVal[4,2]
|
||||
|
||||
|
||||
@@ -24,33 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ELTIME()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Compute difference between times in hours, minutes, seconds.
|
||||
* $SYNTAX$
|
||||
* FT_ELTIME( <cTime1>, <cTime2> ) -> cDiff
|
||||
* $ARGUMENTS$
|
||||
* <cTime1, cTime2> character strings representing times in
|
||||
* hh:mm:ss format.
|
||||
* $RETURNS$
|
||||
* <cDiff> character string representing time difference in
|
||||
* hh:mm:ss format.
|
||||
* $DESCRIPTION$
|
||||
* Return the absolute difference between two times in hh:mm:ss format
|
||||
* in character hours, minutes and seconds (hh:mm:ss).
|
||||
* $EXAMPLES$
|
||||
* FT_ELTIME( "22:40:12", "23:55:17" ) -> 01:15:05
|
||||
* FT_ELTIME( "23:55:17", "22:40:12" ) -> 01:15:05
|
||||
* $SEEALSO$
|
||||
* FT_ELAPMIN() FT_MIL2MIN() FT_MIN2MIL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_ELTIME(cTIME1,cTIME2)
|
||||
local nDELSECS, nHRS, nMINS, nSECS, nSECS1, nSECS2
|
||||
|
||||
|
||||
@@ -24,43 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FINDITH()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Find the "ith" occurrence of a substring within a string
|
||||
* $SYNTAX$
|
||||
* FT_FINDITH( <cCheckFor>, <cCheckIn>, <nWhichOccurrence> ;
|
||||
* [, <lIgnoreCase> ] ) -> <nStringPosition>
|
||||
* $ARGUMENTS$
|
||||
* <cCheckFor> is the string to search for.
|
||||
*
|
||||
* <cCheckIn> is the string to search.
|
||||
*
|
||||
* <nWhichOccurrence> is the number of the occurrence to find.
|
||||
*
|
||||
* <lIgnoreCase> is a logical indicating if the search is to be case
|
||||
* sensitive. The default is no case sensitivity (.F.).
|
||||
* $RETURNS$
|
||||
* The position in the string cCheckIn of the ith occurrence of cCheckFor.
|
||||
* $DESCRIPTION$
|
||||
* This function finds the position in a string of the "ith" time another
|
||||
* string appears in it.
|
||||
* $EXAMPLES$
|
||||
* // Find the Position in cMemoString of
|
||||
* // the 10th Occurrence of "the", case
|
||||
* // insensitive
|
||||
*
|
||||
* nNextPosition := FT_FINDITH("the", cMemoString, 10)
|
||||
* $SEEALSO$
|
||||
* FT_AT2()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#define IS_NOT_LOGICAL(x) (VALTYPE(x) != "L")
|
||||
#define MAKE_UPPER(cString) (cString := UPPER(cString))
|
||||
#define NULL ""
|
||||
|
||||
@@ -24,35 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FDAY()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return first day of the month
|
||||
* $SYNTAX$
|
||||
* FT_FDAY( [ <dDateToChk> ] ) -> dFirstDay
|
||||
* $ARGUMENTS$
|
||||
* <dDateToChk> 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.
|
||||
* $RETURNS$
|
||||
* A Clipper date value representing the first date of the month.
|
||||
* $DESCRIPTION$
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* dDate := CTOD( "09/15/90" )
|
||||
* ? FT_FDAY( dDate ) // 09/01/90
|
||||
* ? FT_FDAY() // 03/01/91 (current month)
|
||||
* $SEEALSO$
|
||||
* FT_LDAY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_FDAY(dDateToChk)
|
||||
|
||||
IF Valtype(dDatetoChk) # "D"
|
||||
|
||||
@@ -36,56 +36,6 @@
|
||||
* File header changed to conform to Toolkit standard.
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FLOPTST()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Test diskette drive status
|
||||
* $SYNTAX$
|
||||
* FT_FLOPTST( <nDrive> ) -> nStatus
|
||||
* $ARGUMENTS$
|
||||
* <nDrive> is the diskette drive number, 0 = A:, 1 = B:
|
||||
* $RETURNS$
|
||||
* -1 - Wrong Parameters
|
||||
* 0 - Drive Loaded and ready to read or write
|
||||
* 1 - Drive Door Open or Diskette inserted upside down
|
||||
* 2 - Diskette is unformatted
|
||||
* 3 - Write protected
|
||||
* 4 - Undetermined
|
||||
* $DESCRIPTION$
|
||||
* FT_FLOPTST() is designed as a full replacement for ISDRIVE(). Where
|
||||
* ISDRIVE() returns just .T. or .F. depending if the diskette drive is
|
||||
* ready or not, FT_FLOPTST() returns a numeric code designating the
|
||||
* diskette drive's status.
|
||||
*
|
||||
* FT_FLOPTST() is particularly useful in backup and restore programs
|
||||
* that need to test the floppy drive before writing/reading from a
|
||||
* floppy disk.
|
||||
*
|
||||
* No testing has been performed on systems with more than 2 floppy
|
||||
* drives. If the third drive is "C" and the fourth "D" then there
|
||||
* should be no problems.
|
||||
*
|
||||
* This function does not currently check subst'd drives. So if you
|
||||
* have SUBST E: A:\ then FT_FLOPTST( ASC("E")-ASC("A") ) == 4
|
||||
* Any suggestions to fix this limitation are appreciated.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
* iStatus := FT_FLOPTST( 0 )
|
||||
* DO CASE
|
||||
* CASE iStatus == 1
|
||||
* Qout( "The door to drive A is open." )
|
||||
* CASE iStatus == 2
|
||||
* Qout( "The diskette in drive A is not formatted." )
|
||||
* CASE iStatus == 3
|
||||
* Qout( "The diskette in drive A is write-protected." )
|
||||
* CASE iStatus == 4
|
||||
* Qout( "Something is wrong with drive A, but I don't know what." )
|
||||
* ENDCASE
|
||||
* $END$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ftint86.ch"
|
||||
@@ -116,7 +66,6 @@ RETURN
|
||||
|
||||
#ENDIF
|
||||
|
||||
|
||||
FUNCTION FT_FLOPTST( ; // error code defined by ERR_*
|
||||
nDriveNum_i ; // letter of floppy drive.
|
||||
)
|
||||
@@ -183,7 +132,6 @@ STATIC FUNCTION _GetDisketteNum( ; // returns false if no floppy drive
|
||||
|
||||
RETURN lRetCode
|
||||
|
||||
|
||||
STATIC PROCEDURE _ResetDisketteSystem()
|
||||
LOCAL aRegs[INT86_MAX_REGS]
|
||||
|
||||
@@ -220,7 +168,6 @@ STATIC FUNCTION _ReadBootSector( ;
|
||||
|
||||
RETURN lSuccess
|
||||
|
||||
|
||||
STATIC FUNCTION _WriteBootSector( ;
|
||||
nDriveNum, ;
|
||||
cBuffer_i, ;
|
||||
@@ -244,7 +191,6 @@ STATIC FUNCTION _WriteBootSector( ;
|
||||
|
||||
RETURN lSuccess
|
||||
|
||||
|
||||
STATIC FUNCTION _CallInt13hRetry( ; // logical: did the interrupt succeed?
|
||||
aRegs_io, ; // registers values for INT 13h
|
||||
lCarrySet_o, ; // status of carry flag if return code is true.
|
||||
|
||||
@@ -23,41 +23,6 @@
|
||||
* Initial revision.
|
||||
*
|
||||
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_SAVEATT()
|
||||
* $CATEGORY$
|
||||
* Video
|
||||
* $ONELINER$
|
||||
* Save the attribute bytes of a specified screen region.
|
||||
* $SYNTAX$
|
||||
* FT_SAVEATT( <nTop>, <nLeft>, <nBottom>, <nRight> ) -> cAttributes
|
||||
* $ARGUMENTS$
|
||||
* <nTop>, <nLeft>, <nBottom>, and <nRight> define the screen region.
|
||||
* $RETURNS$
|
||||
* A character string containing the screen attribute bytes for the
|
||||
* specified region. If the memory to store the return value could
|
||||
* not be allocated, the function returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* This function is similar to Clipper's SaveScreen(), except that it only
|
||||
* saves the attribute bytes. This is useful if you want to change the
|
||||
* screen color without affecting the text.
|
||||
*
|
||||
* *** INTERNALS ALERT ***
|
||||
*
|
||||
* This function calls the Clipper internal __gtMaxCol to obtain the
|
||||
* maximum column value for the current video mode. If you're too gutless
|
||||
* to use internals, then this function isn't for you.
|
||||
* $EXAMPLES$
|
||||
* // Save attributes of row 4
|
||||
* cBuffer := FT_SAVEATT( 4, 0, 4, maxcol())
|
||||
*
|
||||
* // Save attributes from middle of screen
|
||||
* cBuffer := FT_SAVEATT(10,20,14,59)
|
||||
* $SEEALSO$
|
||||
* FT_RESTATT()
|
||||
* $END$
|
||||
*
|
||||
*/
|
||||
|
||||
/* This is the original FT_SAVEATT() code
|
||||
@@ -239,43 +204,6 @@ HB_FUNC( FT_SAVEATT )
|
||||
* Initial revision.
|
||||
*
|
||||
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_RESTATT()
|
||||
* $CATEGORY$
|
||||
* Video
|
||||
* $ONELINER$
|
||||
* Restore the attribute bytes of a specified screen region.
|
||||
* $SYNTAX$
|
||||
* FT_RESTATT( <nTop>, <nLeft>, <nBottom>, <nRight>, <cAttributes> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nTop>, <nLeft>, <nBottom>, and <nRight> define the screen region.
|
||||
* <cAttributes> is a character string containing the attribute bytes
|
||||
* for the screen region. This will most often be a string
|
||||
* previously returned by FT_SAVEATT(), but any character
|
||||
* string may be used (provided it is of the proper size).
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* This function is similar to Clipper's RestScreen(), except that it only
|
||||
* restores the attribute bytes. This is useful if you want to change the
|
||||
* screen color without affecting the text.
|
||||
*
|
||||
* *** INTERNALS ALERT ***
|
||||
*
|
||||
* This function calls the Clipper internals __gtSave and __gtRest to
|
||||
* manipulate the the screen image. If you're too gutless to use
|
||||
* internals, then this function isn't for you.
|
||||
* $EXAMPLES$
|
||||
* // Restore attributes of row 4
|
||||
* FT_RESTATT( 4, 0, 4, maxcol(), cBuffer)
|
||||
*
|
||||
* // Restore attributes to middle of screen
|
||||
* FT_RESTATT(10,20,14,59,cBuffer)
|
||||
* $SEEALSO$
|
||||
* FT_SAVEATT()
|
||||
* $END$
|
||||
*
|
||||
*/
|
||||
|
||||
/* This is the Original FT_RESTATT() code
|
||||
|
||||
@@ -21,47 +21,6 @@
|
||||
#include "hbdefs.h"
|
||||
#include "hbapi.h"
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_Idle()
|
||||
* $CATEGORY$
|
||||
* Event
|
||||
* $ONELINER$
|
||||
* Generate an idle event to allow incremental garbage collection.
|
||||
* $SYNTAX$
|
||||
* FT_Idle()
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* During memory-intensive operations that do not generate much in
|
||||
* the way of idle states, the Clipper runtime may not get a chance to
|
||||
* perform garbage collection of discarded memory. This can eventually
|
||||
* lead to any of a variety of memory-related internal errors.
|
||||
*
|
||||
* This function attempts to alleviate the problem by providing a
|
||||
* mechanism by which an idle event can be artifically generated at
|
||||
* will. The idle event will cause the CA-Cl*pper runtime to perform
|
||||
* an incremental memory scavenge.
|
||||
*
|
||||
* This function makes use of an undocumented interal routine. If this
|
||||
* this fact makes you uncomfortable then don't use this function, you
|
||||
* miserable jello-spined lump of human debris.
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* while Whatever // Some batch process
|
||||
*
|
||||
* Something() // Create 'n' discard a bunch of stuff
|
||||
*
|
||||
* FT_Idle() // Take out the garbage
|
||||
*
|
||||
* end
|
||||
* $SEEALSO$
|
||||
* FT_OnIdle()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC(FT_Idle)
|
||||
{
|
||||
hb_idleState();
|
||||
|
||||
@@ -76,69 +76,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ISPRINT()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Check printer status
|
||||
* $SYNTAX$
|
||||
* FT_ISPRINT( [ <cDevice> ] ) -> lResult
|
||||
* $ARGUMENTS$
|
||||
* <cDevice> is optional and is the device to test (LPT2, COM1, etc.).
|
||||
* If omitted, the function will default to the PRN device.
|
||||
* $RETURNS$
|
||||
* .T. if device is ready for output.
|
||||
* .F. if one of the following conditions occurs:
|
||||
* 1) The device is not ready.
|
||||
* 2) The device does not exist.
|
||||
* 3) DOS couldn't open the device for some reason
|
||||
* (such as no file handles available).
|
||||
* $DESCRIPTION$
|
||||
* The Clipper IsPrinter() function is somewhat limited because it only
|
||||
* works with LPT1. Furthermore, it talks directly to the hardware, so
|
||||
* if you have redirected LPT1 via the DOS MODE command, the IsPrinter()
|
||||
* function will return erroneous results.
|
||||
*
|
||||
* This function offers a better alternative. Instead of talking to the
|
||||
* hardware, it issues a DOS call that checks to see if the device is
|
||||
* ready or not. That gives DOS an opportunity to deal with any
|
||||
* redirections, and since you pass the device name as a parameter, you
|
||||
* can test any device, not just LPT1 (note that the function defaults
|
||||
* to PRN if you fail to pass a valid parameter).
|
||||
*
|
||||
* The function also temporarily traps the DOS critical error handler so
|
||||
* you don't get any nasty error messages if the device isn't ready. It
|
||||
* restores the old critical error handler before exiting.
|
||||
*
|
||||
* Note that although this function is mainly designed for testing
|
||||
* printers, you can also check to see if a drive is ready. Since DOS
|
||||
* thinks the NUL device exists on every drive, you can pass a drive
|
||||
* letter followed by NUL as a parameter. If DOS is able to open the
|
||||
* NUL device, then the drive is ready, otherwise the door is open or
|
||||
* something else is wrong.
|
||||
*
|
||||
* The source code is written to adhere to Turbo Assembler's IDEAL mode.
|
||||
* To use another assembler, you will need to rearrange the PROC and
|
||||
* SEGMENT directives, and also the ENDP and ENDS directives (a very
|
||||
* minor task).
|
||||
* $EXAMPLES$
|
||||
* IF ! FT_ISPRINT()
|
||||
* Qout( "PRN is not ready!" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF ! FT_ISPRINT( "COM2" )
|
||||
* Qout( "Check the device on COM2. Something is wrong." )
|
||||
* ENDIF
|
||||
*
|
||||
* IF ! FT_ISPRINT( "A:\nul" )
|
||||
* Qout( "Oops, better check drive A!" )
|
||||
* ENDIF
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
/* TOFIX: Has different behaviour depending on platform/parameter. [vszakats] */
|
||||
|
||||
@@ -24,71 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ROUND()
|
||||
* $CATEGORY$
|
||||
* Math
|
||||
* $ONELINER$
|
||||
* Rounds a number to a specific place
|
||||
* $SYNTAX$
|
||||
* FT_ROUND( <nNumber> [, <nRoundToAmount> ;
|
||||
* [, <cRoundType> [, <cRoundDirection> ;
|
||||
* [, <nAcceptableError> ] ] ] ] ) -> nNumber
|
||||
* $ARGUMENTS$
|
||||
* <nNumber> is the number to round
|
||||
*
|
||||
* <nRoundToAmount> is the fraction to round to or the number of places,
|
||||
* default is 2.
|
||||
*
|
||||
* <cRoundType> is the type of rounding desired
|
||||
*
|
||||
* "D" for Decimal (3 for thousandth, 1/1000) (default)
|
||||
* "F" for Fraction (3 for thirds, 1/3)
|
||||
* "W" for Whole numbers (3 for thousand, 1000)
|
||||
*
|
||||
* <cRoundDirection> is the direction to round the number toward
|
||||
*
|
||||
* "U" to round Up 1.31 -> 1.4
|
||||
* -1.31 -> -1.4
|
||||
* "D" to round Down 1.36 -> 1.3
|
||||
* -1.36 -> -1.3
|
||||
* "N" to round Normal 1.5 -> 2
|
||||
* -1.5 -> -2
|
||||
* 1.49 -> 1
|
||||
* -1.49 -> -1
|
||||
*
|
||||
* <nAcceptableError> is the amount that is considered acceptable
|
||||
* to be within, i.e., if you're within this amount of the number
|
||||
* you don't need to round
|
||||
* $RETURNS$
|
||||
* The number, rounded as specified.
|
||||
* $DESCRIPTION$
|
||||
* This function will allow you to round a number. The following can
|
||||
* be specified:
|
||||
* a. Direction (up, down or normal - normal is 4/5 convention)
|
||||
* b. Type (whole, decimal, fraction)
|
||||
* c. Amount (100's, 5 decimals, 16th, etc.)
|
||||
* $EXAMPLES$
|
||||
* // round normal to 2 decimal places
|
||||
* nDollars := FT_ROUND(nDollars)
|
||||
*
|
||||
* // round normal to 6 decimal places
|
||||
* nIntRate := FT_ROUND(nIntRate, 6)
|
||||
*
|
||||
* // round to nearest thousands
|
||||
* nPrice := FT_ROUND(nPrice, 3, NEAREST_WHOLE_NUMBER)
|
||||
*
|
||||
* // round Up to nearest third
|
||||
* nAmount := FT_ROUND(nAmount, 3, NEAREST_FRACTION, ROUND_UP)
|
||||
*
|
||||
* // round down to 3 decimals Within .005
|
||||
* nAvg := FT_ROUND(nAvg, 3, , ROUND_DOWN, .005)
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#define IS_NEGATIVE(x) ((x) < 0)
|
||||
|
||||
#define NEAREST_DECIMAL "D"
|
||||
@@ -109,8 +44,6 @@
|
||||
<Param1> := iif(VALTYPE(<Param1>) == <Type1>,<Param1>,<Def1>) ;
|
||||
[; <ParamN> := iif(VALTYPE(<ParamN>) == <TypeN>,<ParamN>,<DefN>)]
|
||||
|
||||
|
||||
|
||||
FUNCTION FT_ROUND(nNumber, nRoundToAmount, cRoundType, cRoundDirection, ;
|
||||
nAcceptableError)
|
||||
|
||||
|
||||
@@ -152,7 +152,6 @@
|
||||
enddo
|
||||
ft_fuse()
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -173,7 +172,6 @@
|
||||
faster reads) */
|
||||
#define BUFFSIZE 4096
|
||||
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapifs.h"
|
||||
|
||||
@@ -229,73 +227,6 @@ HB_FUNC( FT_FOFFSET )
|
||||
#define FT_CHR_LF 10
|
||||
#define FT_CHR_EOF 26
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FUSE()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Open or close a text file for use by the FT_F* functions
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FUSE( [ <cFile> ] [, <nMode> ] ) -> nHandle | 0
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* ^b<cFile>^n is the text file you want to open. If not specified,
|
||||
* the file currently open, if any, will be closed.
|
||||
*
|
||||
* ^b<nMode>^n is the open mode for the file. Please refer to the
|
||||
* discussion of open modes under FOPEN() in the Clipper manual
|
||||
* and fileio.ch for a list of allowable open modes. If not
|
||||
* specified, the file will be opened with a mode of
|
||||
* FO_READ + FO_SHARED (64).
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* If ^b<cFile>^n is passed and the file is opened successfully, an
|
||||
* integer containing the text file's workarea. If the file cannot be
|
||||
* opened, -1 will be returned. In this case, check the return value
|
||||
* of ^bft_fError()^n for the cause of the error.
|
||||
*
|
||||
* If FT_FUSE() is called without any arguments, it will close the
|
||||
* text file in the current "text area" and return 0.
|
||||
*
|
||||
* If a read error occurs ^ft_fError()^n will contain the error code.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* The FT_F*() file functions are for reading text files, that is,
|
||||
* files where each line (record) is delimited by a CRLF pair.
|
||||
*
|
||||
* Each file is opened in its own "workarea", similar to the concept
|
||||
* use by dbf files. As provided, a maximum of 10 files (in 10
|
||||
* workareas) can be opened (assuming there are sufficient file
|
||||
* handles available). That number may be increased by modifying
|
||||
* the #define TEXT_WORKAREAS in the C source code and recompiling.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* #include "fileio.ch"
|
||||
*
|
||||
* // open a text file for reading
|
||||
* ft_fUse( "text.txt" )
|
||||
*
|
||||
* // open a text file for reading and writing
|
||||
* ft_fUse( "text.txt", FO_READWRITE + FO_SHARED )
|
||||
*
|
||||
* // close file
|
||||
* ft_fUse()
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FUSE() FT_FSELECT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FUSE )
|
||||
{
|
||||
int attr = hb_parnidef( 2, FO_READWRITE | FO_DENYNONE );
|
||||
@@ -330,66 +261,6 @@ HB_FUNC( FT_FUSE )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FSELECT()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Select a text file workarea
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FSELECT( [ <nNewArea> ] ) -> nPreviousArea
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* ^b<nNewArea>^n is the text file workarea to select.
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* The current selected text file area.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function selects a text file "workarea" from 1 to 10. A
|
||||
* file may or may not be open in the selected area.
|
||||
*
|
||||
* Passing 0 for ^b<nNewArea>^n selects the next available workarea,
|
||||
* similar to Clipper's SELECT 0 command. If no more workareas are
|
||||
* available the current workarea is not changed.
|
||||
*
|
||||
* Each file is opened in its own "workarea", similar to the concept
|
||||
* used by dbf files. As provided, a maximum of 10 files (in 10
|
||||
* workareas) can be opened (assuming there are sufficient file
|
||||
* handles available). That number may be increased by modifying
|
||||
* the #define TEXT_WORKAREAS in the C source code and recompiling.
|
||||
*
|
||||
* All the FT_F*() file functions operate on the file in the currently
|
||||
* selected text file workarea.
|
||||
*
|
||||
* Text file workareas are separate from and independent of Clipper's
|
||||
* database workareas.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FT_FSELECT(1)
|
||||
*
|
||||
* nFile1 := FT_FUSE( "temp.c" )
|
||||
*
|
||||
* ? FT_FLASTRE() // no. of lines in temp.c
|
||||
*
|
||||
* FT_FSELECT(2)
|
||||
*
|
||||
* nFile2 := FT_FUSE( "temp.h" )
|
||||
*
|
||||
* ? FT_FLASTRE() // no. of lines in temp.h
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FUSE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FSELECT )
|
||||
{
|
||||
int oldarea = area + 1;
|
||||
@@ -418,53 +289,6 @@ HB_FUNC( FT_FSELECT )
|
||||
hb_retni( oldarea );
|
||||
}
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FGOTOP()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Go to the first record in a text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FGOTOP() -> NIL
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* NIL
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function moves the record pointer to the first record
|
||||
* in the currently selected text file workarea.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FT_FUSE( "text.c" ) // open text file
|
||||
*
|
||||
* DO WHILE !FT_FEOF()
|
||||
*
|
||||
* ? FT_FREADLN() // read thru file
|
||||
*
|
||||
* FT_FSKIP()
|
||||
*
|
||||
* ENDDO
|
||||
*
|
||||
* FT_FGOTOP() // go back to top
|
||||
*
|
||||
* ? FT_FRECNO() // 1
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FSELECT() FT_FUSE() FT_FRECNO() FT_FGOBOT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FGOTOP )
|
||||
{
|
||||
error[area] = 0;
|
||||
@@ -474,153 +298,16 @@ HB_FUNC( FT_FGOTOP )
|
||||
isEof[area] = HB_FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FERROR()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Return the error code for a text file operation
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FERROR() -> nErrorNo
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* The DOS error code if one occurred. See a reference on DOS error
|
||||
* codes for an explanation of what the code means.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function returns the DOS error code associated with a file
|
||||
* operation on the currently selected text file.
|
||||
*
|
||||
* Errors could stem from any open, create, read or write operation,
|
||||
* among others.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* if ft_fUse( "text.c" ) < 0 // open text file
|
||||
* err := ft_fError();
|
||||
* QOUT( 'Error opening file "Text.c", error code (' + ;
|
||||
* LTRIM( STR( err ) ) + ')' )
|
||||
* endif
|
||||
*
|
||||
* $SEEALSO$
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
HB_FUNC( FT_FERROR )
|
||||
{
|
||||
hb_retni( error[area] );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FRECNO()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Return the current record number of a text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FRECNO() -> nRecNo
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* The current record number of a text file or 0 if no file is open.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function returns the current record number of the file open
|
||||
* in the currently selected text file workarea.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FT_FUSE( "text.c" ) // open text file
|
||||
*
|
||||
* DO WHILE !FT_FEOF()
|
||||
*
|
||||
* ? FT_FREADLN() // read thru file
|
||||
*
|
||||
* FT_FSKIP()
|
||||
*
|
||||
* ENDDO
|
||||
*
|
||||
* FT_FGOTOP() // go back to top
|
||||
*
|
||||
* ? FT_FRECNO() // 1
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FSELECT() FT_FUSE() FT_FGOTOP() FT_FGOBOT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
HB_FUNC( FT_FRECNO )
|
||||
{
|
||||
hb_retnl( recno[area] );
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FGOBOT()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Go to the last record in a text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FGOBOT() -> NIL
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* NIL
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function moves the record pointer to the last record of the
|
||||
* file in the currently selected text file workarea.
|
||||
*
|
||||
* If a read error occurs ^ft_fError()^n will contain the error code.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // read last line
|
||||
* FT_FUSE( "text.c" )
|
||||
*
|
||||
* FT_FGOBOT()
|
||||
*
|
||||
* ? FT_FREADLN()
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FSELECT() FT_FUSE() FT_FGOTOP() FT_FRECNO() FT_FREADLN()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
HB_FUNC( FT_FGOBOT )
|
||||
{
|
||||
|
||||
@@ -638,62 +325,6 @@ HB_FUNC( FT_FGOBOT )
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FSKIP()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Move the record pointer to a new position in a text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FSKIP( [ <nLines> ] ) -> nLinesSkipped
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* <nLines> is the number of lines to skip. Defaults to 1 if
|
||||
* not specified.
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* The number of lines actually skipped. If the file's EOF or
|
||||
* BOF was encountered before ^b<nLines>^n could be skipped, the
|
||||
* return value will be less than ^b<nLines>^n.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function moves the text file record pointer, similar to
|
||||
* the CLIPPER SKIP command.
|
||||
*
|
||||
* Use the return value to determine how many records were actually
|
||||
* skipped, for example to write a custom skipper function for
|
||||
* TBrowse'g text files.
|
||||
*
|
||||
* If a read error occurs ^ft_fError()^n will contain the error code.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // display each record of a text file
|
||||
*
|
||||
* FT_FUSE( "text.c" )
|
||||
*
|
||||
* DO WHILE ! FT_FEOF()
|
||||
*
|
||||
* ? FT_FREADLN()
|
||||
*
|
||||
* FT_FSKIP()
|
||||
*
|
||||
* ENDDO
|
||||
*
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FRECNO() FT_FGOTOP()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FSKIP )
|
||||
{
|
||||
if ( HB_ISNUM(1) )
|
||||
@@ -707,7 +338,6 @@ HB_FUNC( FT_FSKIP )
|
||||
hb_retnl( _ft_skip(1L) );
|
||||
}
|
||||
|
||||
|
||||
/* internal routine to do buffer skips. Passing a positive value performs
|
||||
a downward skip, a negative number does an upward skip. Passing 0
|
||||
skips to the end of file.
|
||||
@@ -896,62 +526,6 @@ static long _ft_skip( long iRecs )
|
||||
return iSkipped;
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FREADLN()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Read a line from the currently selected text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FREADLN() -> cLine
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* A string containing the current record in a text file.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function returns a line of text read from the file in the
|
||||
* currently selected text file workarea. Text lines are delimited
|
||||
* with a CRLF pair. The record pointer is not moved.
|
||||
*
|
||||
* Currently the maximum record size is 4096 characters. You may
|
||||
* increase the maximum record size by changing the value of ^b#define
|
||||
* ^bBUFFSIZE^n in the C source and recompiling, however you should
|
||||
* consider the performance implications if you do (all read and writes
|
||||
* use this buffer size, including ft_fSkip()'s and ft_fGoto()'s).
|
||||
*
|
||||
* If a read error occurs ^ft_fError()^n will contain the error code.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // display each record of a text file
|
||||
*
|
||||
* FT_FUSE( "text.c" )
|
||||
*
|
||||
* DO WHILE ! FT_FEOF()
|
||||
*
|
||||
* ? FT_FREADLN()
|
||||
*
|
||||
* FT_FSKIP()
|
||||
*
|
||||
* ENDDO
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FUSE() FT_FWRITELN() FT_FRECNO() FT_FGOTOP()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
HB_FUNC( FT_FREADLN )
|
||||
{
|
||||
|
||||
@@ -977,49 +551,6 @@ HB_FUNC( FT_FREADLN )
|
||||
hb_xfree( cPtr );
|
||||
}
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FDELETE()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Deletes a line from the currently selected text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FDELETE( [ < nLines > ] ) -> lSuccess
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* ^b<nLines>^n is the number of lines to be eliminated, beginning with
|
||||
* the current record position.
|
||||
*
|
||||
* If ^b<nLines>^n is omitted, the current record is deleted only.
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* TRUE if successful, otherwise check ^ft_fError()^n for error code.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function deletes one or several lines of text from the file
|
||||
* in the currently selected text file workarea. Text lines are
|
||||
* delimited with a CRLF pair. The record pointer is not moved,
|
||||
* unless the deleted lines occur at the end of the file, in which
|
||||
* case ^bft_fRecno()^n will equal ^bft_fLastRe()^n and ^bft_fEOF()^n
|
||||
* will be set to TRUE.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // delete the next 4 lines from a file
|
||||
* FT_FUSE( "test.txt" )
|
||||
*
|
||||
* FT_FDELETE( 4 )
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FAPPEND() FT_FRECNO() FT_FINSERT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FDELETE )
|
||||
{
|
||||
int iBytesRead;
|
||||
@@ -1046,7 +577,6 @@ HB_FUNC( FT_FDELETE )
|
||||
destPtr += hb_fsWriteLarge( handles[area], Buff, iBytesRead );
|
||||
} while( iBytesRead > 0 );
|
||||
|
||||
|
||||
/* move DOS EOF marker */
|
||||
hb_fsSeekLarge( handles[area], srcPtr, FS_SET );
|
||||
hb_fsWrite( handles[area], Buff, 0 );
|
||||
@@ -1074,55 +604,6 @@ HB_FUNC( FT_FDELETE )
|
||||
hb_retl( error[area] ? 0 : 1 );
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FINSERT()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Inserts a line in the currently selected text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FINSERT( [ < nLines > ] ) -> lSuccess
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* ^b<nLines>^n is the number of lines that should be inserted at the
|
||||
* current record position.
|
||||
*
|
||||
* If ^b<nLines>^n is omitted, one record is inserted.
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* ^blSuccess^n is TRUE if the insert succeeded, FALSE if not. If
|
||||
* false check the return value of ^bft_fError()^n for the reason.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function inserts a line of text in the file in the currently
|
||||
* selected text file workarea. Text lines are delimited with a
|
||||
* CRLF pair.
|
||||
*
|
||||
* The record pointer is not moved.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
* Each line inserted with this function will be empty.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // add a couple of blank lines of text to a file
|
||||
* ft fUse( "test.txt" )
|
||||
*
|
||||
* ft_fGoTo( 10 )
|
||||
*
|
||||
* ft_fInsert( 5 )
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FAPPEND() FT_FRECNO() FT_FDELETE() FT_FLASTRE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FINSERT )
|
||||
{
|
||||
int no_lines = hb_parnidef( 1, 1 );
|
||||
@@ -1145,66 +626,6 @@ HB_FUNC( FT_FINSERT )
|
||||
hb_retl( err );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FAPPEND()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Appends a line to the currently selected text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FAPPEND( [ < nLines > ] ) -> NIL
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* <nLines> is the number of lines that should be appended to the
|
||||
* end of the currently selected text file.
|
||||
*
|
||||
* If <nLines> is omitted, one record is appended.
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* lSuccess. If FALSE, check ^bft_fError()^n for the error code.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function appends a line of text to the file in the currently
|
||||
* selected text file workarea. Text lines are delimited with a
|
||||
* CRLF pair. The record pointer is moved to the last appended
|
||||
* record.
|
||||
*
|
||||
* Multiple lines may be appended with one call to FT_FAPPEND().
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
* Each line appended with this function will be empty.
|
||||
*
|
||||
* NOTE: Occasionally a text file may contain a non-CRLF terminated
|
||||
* line, at the end of the file ("stragglers"). This function assumes
|
||||
* these stragglers to be the last line of the file, and begins
|
||||
* appending the new lines after this line. In other words, if the
|
||||
* last line in the text file is not terminated with a CRLF pair prior
|
||||
* to calling FT_FAPPEND(), the function will terminate that last line
|
||||
* before appending any new lines.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // add a blank line of text to a file
|
||||
* FT_FUSE( "test.txt" )
|
||||
*
|
||||
* ?FT_FRECNO() // displays 5
|
||||
*
|
||||
* FT_FAPPEND()
|
||||
*
|
||||
* ?FT_FRECNO() // displays 6
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FRECNO() FT_FDELETE() FT_FINSERT() FT_FLASTRE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FAPPEND )
|
||||
{
|
||||
int no_lines = hb_parnidef( 1, 1 );
|
||||
@@ -1265,68 +686,6 @@ HB_FUNC( FT_FAPPEND )
|
||||
|
||||
}
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FWRITELN()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Write a line to the currently selected text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FWRITELN( < cData >, [ < lInsert > ] ) -> lSuccess
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* <cData> is a string of data to write to the file at the current
|
||||
* record position.
|
||||
*
|
||||
* <lInsert> is a logical indicating whether the contents
|
||||
* of the current record are to be preserved, that is, if lInsert
|
||||
* evaluates to .T., the a new record is inserted at the current
|
||||
* position. The current record then is pushed down to FT_FRECNO()+1.
|
||||
*
|
||||
* If lInsert is .F. or omitted, the current record is replaced by
|
||||
* cData.
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* TRUE if successful, otherwise check ^ft_fError()^n for error code.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function writes a line of text to the file in the currently
|
||||
* selected text file workarea. Text lines are delimited with a
|
||||
* CRLF pair. The record pointer is not moved.
|
||||
*
|
||||
* The contents of the current record are updated to reflect the new
|
||||
* new line written, unless the Insert option is selected.
|
||||
*
|
||||
* Writing a null string has the effect of clearing the current line
|
||||
* if in overstrike mode, else inserting a new line (same as
|
||||
* FT_FINSERT()).
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // write a line of text to a file
|
||||
*
|
||||
* FT_FUSE( "config.sys" )
|
||||
*
|
||||
* DO WHILE UPPER( FT_FREADLN() ) != "FILES=" .AND. !F_FEOF()
|
||||
*
|
||||
* FT_FSKIP()
|
||||
*
|
||||
* ENDDO
|
||||
*
|
||||
* FT_FWRITELN( "FILES=30", FT_FEOF() )
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FREADLN() FT_FRECNO() FT_FINSERT() FT_FDELETE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FWRITELN )
|
||||
{
|
||||
const char * theData = hb_parc( 1 );
|
||||
@@ -1338,7 +697,6 @@ HB_FUNC( FT_FWRITELN )
|
||||
|
||||
char * buffer;
|
||||
|
||||
|
||||
/* position file pointer to insertion point */
|
||||
hb_fsSeekLarge( handles[area], offset[area], FS_SET );
|
||||
|
||||
@@ -1403,44 +761,6 @@ HB_FUNC( FT_FWRITEL )
|
||||
HB_FUNC_EXEC( FT_FWRITELN );
|
||||
}
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FLASTRE()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Get the no. of records in the currently selected text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FLASTRE() -> nLastRecordNum
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* An integer containing the number of records in the text file in
|
||||
* the currently selected text file workarea, or zero if no file
|
||||
* is currently open in the workarea.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function returns the number of the last record in a text file.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FT_FUSE( "text.c" )
|
||||
*
|
||||
* ? FT_FLASTRE()
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FUSE() FT_FRECNO()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FLASTRE )
|
||||
{
|
||||
long cur_rec;
|
||||
@@ -1456,158 +776,16 @@ HB_FUNC( FT_FLASTRE )
|
||||
offset[area] = cur_offset;
|
||||
}
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FEOF()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Determine if end of text file has been encountered
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FEOF() -> lResult
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* .T. if an attempt was made to skip past the last record of
|
||||
* the currently selected text file, otherwise .F.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function is similar to the CLIPPER Eof() function.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FT_FUSE( "fttext.c" )
|
||||
*
|
||||
* ? FT_FEOF() // .F.
|
||||
*
|
||||
* FT_FSKIP()
|
||||
*
|
||||
* ? FT_FEOF() // .T.
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FUSE() FT_FSKIP()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
HB_FUNC( FT_FEOF )
|
||||
{
|
||||
hb_retl( isEof[area] );
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FBOF()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Determine if attempt to skip past beginning of text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FBOF() -> lResult
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* None
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* .T. if an attempt was made to skip past the first record of
|
||||
* the currently selected text file, otherwise .F.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function is similar to the CLIPPER Bof() function.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* FT_FUSE( "fttext.c" )
|
||||
*
|
||||
* FT_FGOTOP()
|
||||
*
|
||||
* ? FT_FBOF() // .F.
|
||||
*
|
||||
* FT_FSKIP(-1)
|
||||
*
|
||||
* ? FT_FBOF() // .T.
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_FSKIP() FT_EOF() FT_GOTOP()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
HB_FUNC( FT_FBOF )
|
||||
{
|
||||
hb_retl( isBof[area] );
|
||||
}
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FGOTO()
|
||||
* $CATEGORY$
|
||||
* File I/O
|
||||
* $ONELINER$
|
||||
* Move record pointer to specific record in a text file
|
||||
* $SYNTAX$
|
||||
*
|
||||
* FT_FGOTO( nLine ) -> NIL
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
*
|
||||
* <nLine> is the record number to go to.
|
||||
*
|
||||
* $RETURNS$
|
||||
*
|
||||
* NIL
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function moves the record pointer to a specific record
|
||||
* in the file in the currently selected text file workarea. If
|
||||
* the record number requested is greater than the number of records
|
||||
* in the file, the record pointer will be positioned at the last
|
||||
* record.
|
||||
*
|
||||
* Internally, the function operates differently depending on how
|
||||
* you invoke it. Passing a value for ^b<nLine>^n results in what
|
||||
* is effectively a skip operation, which is fairly quick. However
|
||||
* if you pass 0 for ^b<nLine>^n, e.g. ft_fGoTo( 0 ), the function
|
||||
* internally goes to the top of the file, then skips down the
|
||||
* required number of records. Hence if your file is relatively
|
||||
* large and the current record is a high number, you may see some
|
||||
* delay as ft_fGoTo(0) skips through the file.
|
||||
*
|
||||
* A text file "record" is a line of text terminated by a CRLF pair.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // read 5th line of text from file
|
||||
*
|
||||
* ft_fUse( "fttext.c" )
|
||||
*
|
||||
* ft_fGoTo(5)
|
||||
*
|
||||
* cText := ft_fReadLN()
|
||||
*
|
||||
* $SEEALSO$
|
||||
*
|
||||
* FT_FRECNO() FT_FGOTOP() FT_FREADLN()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
HB_FUNC( FT_FGOTO )
|
||||
{
|
||||
long target = hb_parnl(1);
|
||||
@@ -1697,7 +875,6 @@ _feoldone:
|
||||
*/
|
||||
} /* end _findeol() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
||||
_findbol() - In-line assembler routine to parse a buffer
|
||||
@@ -1897,8 +1074,6 @@ static int _ins_buff( HB_ISIZ iLen )
|
||||
}
|
||||
/* _ins_buff */
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* deletes xxx bytes from the current file, beginning at the current record */
|
||||
static int _del_buff( HB_ISIZ iLen )
|
||||
@@ -1941,7 +1116,6 @@ static int _del_buff( HB_ISIZ iLen )
|
||||
fpRead += WriteLen;
|
||||
}
|
||||
|
||||
|
||||
/* store length in bytes, set EOF marker for DOS */
|
||||
lastbyte[area] = hb_fsSeekLarge( handles[area], fpWrite, FS_SET );
|
||||
hb_fsWrite( handles[area], WriteBuff, 0 );
|
||||
@@ -1956,7 +1130,6 @@ static int _del_buff( HB_ISIZ iLen )
|
||||
}
|
||||
/* _del_buff */
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* writes a line of data to the file, including the terminating CRLF */
|
||||
static int _writeLine( const char * theData, HB_SIZE iDataLen )
|
||||
|
||||
@@ -24,35 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_GCD()
|
||||
* $CATEGORY$
|
||||
* Math
|
||||
* $ONELINER$
|
||||
* Calculate greatest common divisor of two numbers
|
||||
* $SYNTAX$
|
||||
* FT_GCD( <nNumber1>, <nNumber2> ) -> nGCD
|
||||
* $ARGUMENTS$
|
||||
* <nNumber1> is the first number to find the GCD of.
|
||||
*
|
||||
* <nNumber2> is the second number to find the GCD of.
|
||||
* $RETURNS$
|
||||
* The greatest common divisor of the 2 numbers, or 0 if either is 0.
|
||||
* $DESCRIPTION$
|
||||
* This function calculates the greatest common divisor between 2 numbers,
|
||||
* i.e., the largest number that will divide into both numbers evenly. It
|
||||
* will return zero (0) if either number is zero.
|
||||
* $EXAMPLES$
|
||||
* ? FT_GCD(10,15) // Result: 5
|
||||
* ? FT_GCD(108,54) // Result: 54
|
||||
* ? FT_GCD(102,54) // Result: 6
|
||||
* ? FT_GCD(111,17) // Result: 1
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#command REPEAT ;
|
||||
=> ;
|
||||
DO WHILE .T.
|
||||
|
||||
@@ -27,70 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_GETE()
|
||||
* $CATEGORY$
|
||||
* Environment
|
||||
* $ONELINER$
|
||||
* Return the entire current environment
|
||||
* $SYNTAX$
|
||||
* FT_GETE( [ @<xReceiveVar> ] ) -> nNumStrings
|
||||
* $ARGUMENTS$
|
||||
* <xReceiveVar> is the variable to receive the environment data.
|
||||
*
|
||||
* <xReceiveVar> can be a character type variable, in which case
|
||||
* the function will place all environment strings in the variable
|
||||
* separated by carriage return/line feeds (chr 13 + chr(10)).
|
||||
*
|
||||
* <xReceiveVar> can be an array type, in which case the function
|
||||
* will place each string in an array element. The array MUST be
|
||||
* declared with the proper number of elements prior to passing it
|
||||
* to the function. This can be done by calling FT_GETE() without
|
||||
* parameters first to get the number of strings in the environment.
|
||||
*
|
||||
* Note that the argument MUST be passed by reference. Since arrays
|
||||
* are by nature passed by reference, the "@" symbol is optional when
|
||||
* passing an array.
|
||||
*
|
||||
* If no argument is passed, FT_GETE() merely returns the number
|
||||
* of strings in the environment.
|
||||
* $RETURNS$
|
||||
* FT_GETE() returns the total number of strings found in the
|
||||
* current program's environment.
|
||||
* $DESCRIPTION$
|
||||
* This function stores ALL of the current program's environment
|
||||
* variables in either a block of text lines or in an array. It is
|
||||
* useful for looking at the entire environment at once, or recording
|
||||
* a snapshot of it to a file for later inspection, such as when a
|
||||
* program error occurs. If the value of ONE SPECIFIC variable is
|
||||
* desired, use Clipper's built-in GETE() function.
|
||||
* $EXAMPLES$
|
||||
* Get the environment in text form and browse it:
|
||||
*
|
||||
* cEnvBlock := ""
|
||||
* nNumStrings := FT_GETE(@cEnvBlock)
|
||||
* @ 0, 0 to MAXROW() - 1, MAXCOL()
|
||||
* @ MAXROW(), 0 say 'Browse strings, press ESC to exit...'
|
||||
* MEMOWRIT(cEnvBlock, 1, 1, MAXROW() - 2,MAXCOL() - 1, .F.)
|
||||
*
|
||||
* Get the environment in text form and write it to a file:
|
||||
*
|
||||
* cEnvBlock := ""
|
||||
* FT_GETE(@cEnvBlock)
|
||||
* MEMOWRIT("environ.txt", cEnvBlock)
|
||||
*
|
||||
* Get the environment in Array form:
|
||||
*
|
||||
* aEnvArray := ARRAY(FT_GETE())
|
||||
* FT_GETE(aEnvArray)
|
||||
* ? aEnvArray[1] // "COMSPEC=C:\command.com"
|
||||
* ? aEnvArray[2] // "PATH=C:\;C:\windows;C:\util;C:\harbour"
|
||||
* ... etc ...
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
#if defined( HB_OS_UNIX )
|
||||
|
||||
@@ -96,7 +96,6 @@ HB_FUNC( _FT_ISSHARE )
|
||||
hb_retni( iShare );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( _FT_NWKSTAT )
|
||||
{
|
||||
int iConnect;
|
||||
|
||||
@@ -27,31 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_HEX2DEC()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Convert a hex number to decimal
|
||||
* $SYNTAX$
|
||||
* FT_HEX2DEC( <cHexNum> ) -> nDecNum
|
||||
* $ARGUMENTS$
|
||||
* <cHexNum> is a character string representing a hex number.
|
||||
* $RETURNS$
|
||||
* A decimal number.
|
||||
* $DESCRIPTION$
|
||||
* Converts a hexadecimal number to a BASE 10 decimal number.
|
||||
* Useful for using FT_INT86().
|
||||
* $EXAMPLES$
|
||||
* FT_INT86( HEX2DEC( "21" ), aRegs )
|
||||
*
|
||||
* Converts 21h, the Dos Interrupt, to its decimal equivalent,
|
||||
* 33, for use by FT_INT86().
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#define HEXTABLE "0123456789ABCDEF"
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
@@ -66,44 +66,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_IAmIdle()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Inform the operating system that the application is idle.
|
||||
* $SYNTAX$
|
||||
* FT_IAmIdle() -> lSuccess
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* .T. if supported, .F. otherwise.
|
||||
* $DESCRIPTION$
|
||||
* Some multitasking operating environments (e.g. Windows or OS/2) can
|
||||
* function more efficiently when applications release the CPU during
|
||||
* idle states. This function allows you "announce" to the operating
|
||||
* system that your application is idle.
|
||||
*
|
||||
* Note that if you use this function in conjunction with FT_OnIdle(),
|
||||
* you can cause Clipper to automatically release the CPU whenever
|
||||
* Clipper itself detects an idle state.
|
||||
* $EXAMPLES$
|
||||
* while inkey() != K_ESC
|
||||
* FT_IAmIdle() // Wait for ESC and announce idleness
|
||||
* end
|
||||
*
|
||||
* * Here's another way to do it:
|
||||
*
|
||||
* FT_OnIdle( {|| FT_IAmIdle()} )
|
||||
*
|
||||
* Inkey( 0 ) // Automatically reports idleness until key
|
||||
* // is pressed!
|
||||
* $SEEALSO$
|
||||
* FT_OnIdle()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
HB_FUNC( FT_IAMIDLE )
|
||||
|
||||
@@ -24,30 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_INVCLR()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Get the inverse of a color
|
||||
* $SYNTAX$
|
||||
* FT_INVCLR( [ <cDsrdColor> ] ) -> cColor
|
||||
* $ARGUMENTS$
|
||||
* <cDsrdColor> is the color to get the inverse of. Defaults to
|
||||
* current color.
|
||||
* $RETURNS$
|
||||
* The inverse of the passed color.
|
||||
* $DESCRIPTION$
|
||||
* This function inverts a passed color (in the Clipper format: ??/??),
|
||||
* e.g., "W/N" is converted to "N/W".
|
||||
* $EXAMPLES$
|
||||
* cInverse := FT_INVCLR() // Get Inverse of Current Color
|
||||
* cInvErr := FT_INVCLR( cErrColor ) // Get Inverse of cErrorColor
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#Command DEFAULT <Param1> TO <Def1> [, <ParamN> TO <DefN> ] ;
|
||||
=> ;
|
||||
<Param1> := iif(<Param1> == NIL,<Def1>,<Param1>) ;
|
||||
|
||||
@@ -24,52 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ISBIT()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Test the status of an individual bit
|
||||
* $SYNTAX$
|
||||
* FT_ISBIT( <cByte>, <nBitPos> ) -> lResult
|
||||
* $ARGUMENTS$
|
||||
* <cByte> is a character from CHR(0) to CHR(255)
|
||||
*
|
||||
* <nBitPos> is a number from 0 to 7 conforming to standard right-to-left
|
||||
* bit-numbering convention and representing the position of the
|
||||
* bit within the byte.
|
||||
* $RETURNS$
|
||||
* .T. if designated bit is set (1), .F. if not set (0), NIL if
|
||||
* invalid parameters.
|
||||
* $DESCRIPTION$
|
||||
* Tests for status of any selected bit in the byte passed as a parameter.
|
||||
* Byte must be presented in CHR() form, as a literal constant, or as the
|
||||
* one-byte character result of an expression.
|
||||
*
|
||||
* This function is presented to illustrate that bit-wise operations
|
||||
* are possible with Clipper code. For greater speed, write .c or
|
||||
* .asm versions and use the Clipper Extend system.
|
||||
* $EXAMPLES$
|
||||
* This code tests whether bit 3 is set in the byte represented by
|
||||
* CHR(107):
|
||||
*
|
||||
* lBitflag := FT_ISBIT(CHR(107), 3)
|
||||
* ? lBitflag // result: .T.
|
||||
*
|
||||
* This code tests whether bit 5 is set in the byte represented by ASCII
|
||||
* 65 (letter 'A')
|
||||
*
|
||||
* ? FT_ISBIT('A', 5) // result: .F.
|
||||
*
|
||||
* For a demonstration of Clipper bit manipulations, compile and
|
||||
* link the program bittest.prg in the Nanforum Toolkit source code.
|
||||
* $SEEALSO$
|
||||
* FT_BITSET() FT_BITCLR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_ISBIT(cInbyte,nBitPos)
|
||||
|
||||
LOCAL lBitStat
|
||||
|
||||
@@ -27,39 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ISBITON()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Determine the state of individual bits in a number
|
||||
* $SYNTAX$
|
||||
* FT_ISBITON( <nNumber>, <nBit> ) -> lResult
|
||||
* $ARGUMENTS$
|
||||
* <nNumber> is an integer for which a bit state needs to be checked.
|
||||
*
|
||||
* <nBit> is a number from 0 to 15 that indicates which bit to test.
|
||||
* $RETURNS$
|
||||
* .T. if the specified bit was on., .F. if off.
|
||||
* $DESCRIPTION$
|
||||
* This function is useful when dealing with binary integers. It will
|
||||
* come in very handy if you use the FT_INT86() function, because the
|
||||
* CPU flags are returned as a series of bits. Using this function, you
|
||||
* can determine the state of each CPU flag.
|
||||
* $EXAMPLES$
|
||||
* if FT_ISBITON( nCPUFlags, 0 )
|
||||
* Qout( "The carry flag was set." )
|
||||
* endif
|
||||
*
|
||||
* if FT_ISBITON( nCPUFlags, 7 )
|
||||
* Qout( "The sign flag was set." )
|
||||
* endif
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
function FT_ISBITON( nWord, nBit )
|
||||
|
||||
nWord := iif(nWord < 0, nWord + 65536, nWord)
|
||||
|
||||
@@ -28,36 +28,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ISSHARE()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Determine if DOS "Share" is installed
|
||||
* $SYNTAX$
|
||||
* FT_ISSHARE() -> nRetCode
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* nRetcode will be set as follows on exit:
|
||||
*
|
||||
* 0 if SHARE not loaded but ok to load
|
||||
* 1 if SHARE not loaded and not ok to load
|
||||
* 255 if SHARE loaded
|
||||
* $DESCRIPTION$
|
||||
* Uses DOS interrupt 2Fh (MultiPlex interrupt), service 10h
|
||||
* to determine if DOS SHARE.COM is loaded.
|
||||
* $EXAMPLES$
|
||||
* IF FT_ISSHARE() != 255
|
||||
* Qout("SHARE must be loaded!")
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_INT86()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
#ifdef FT_TEST
|
||||
@@ -87,7 +57,6 @@ FUNCTION ft_isshare()
|
||||
|
||||
FT_Int86( 47, aRegs) // multiplex interrupt
|
||||
|
||||
|
||||
RETURN lowbyte( aRegs[AX] )
|
||||
*/
|
||||
RETURN _ft_isshare()
|
||||
|
||||
@@ -24,71 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_SETRATE()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Set the keyboard delay and repeat rate on PC/AT & PS/2
|
||||
* $SYNTAX$
|
||||
* FT_SETRATE( [ <nDelayTime> ] [, <nRepeatRate> ] ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nDelayTime> is the keyboard delay time.
|
||||
*
|
||||
* <nRepeatRate> is the keyboard repeat rate.
|
||||
*
|
||||
* ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
* ³ nDelayTime DELAY ³ ³ RepeatRate SPEED ³
|
||||
* ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||
* ³ 0 250ms ³ ³ 0 30.0cps ³
|
||||
* ³ 1 (default) 500ms ³ ³ 1 26.7cps ³
|
||||
* ³ 2 750ms ³ ³ 2 24.0cps ³
|
||||
* ³ 3 1000ms ³ ³ 3 21.8cps ³
|
||||
* ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ 4 20.0cps ³
|
||||
* ³ 5 18.5cps ³
|
||||
* ³ 6 17.1cps ³
|
||||
* ³ 7 16.0cps ³
|
||||
* ³ 8 15.0cps ³
|
||||
* ³ 9 13.3cps ³
|
||||
* ³ 10 12.0cps ³
|
||||
* ³ 11 10.9cps ³
|
||||
* ³ 12 (default) 10.0cps ³
|
||||
* ³ 13 9.2cps ³
|
||||
* ³ 14 8.6cps ³
|
||||
* ³ 15 8.0cps ³
|
||||
* ³ 16 7.5cps ³
|
||||
* ³ 17 6.7cps ³
|
||||
* ³ 18 6.0cps ³
|
||||
* ³ 19 5.5cps ³
|
||||
* ³ 20 5.0cps ³
|
||||
* ³ 21 4.6cps ³
|
||||
* ³ 22 4.3cps ³
|
||||
* ³ 23 4.0cps ³
|
||||
* ³ 24 3.7cps ³
|
||||
* ³ 25 3.3cps ³
|
||||
* ³ 26 3.0cps ³
|
||||
* ³ 27 2.7cps ³
|
||||
* ³ 28 2.5cps ³
|
||||
* ³ 29 2.3cps ³
|
||||
* ³ 30 2.1cps ³
|
||||
* ³ 31 2.0cps ³
|
||||
* ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* This routine is used to adjust the IBM PC/AT and PS/2 "typematic"
|
||||
* repeat and delay feature. This is used to allow the users of your
|
||||
* application to adjust these speeds to the most comfortable level.
|
||||
*
|
||||
* This source code is written for Microsoft Assembler v5.1.
|
||||
* $EXAMPLES$
|
||||
* FT_SETRATE(0,0) // Set keyboard to fastest possible settings
|
||||
* FT_SETRATE() // Set keyboard to AT defaults (10.9cps,500ms delay)
|
||||
* FT_SETRATE(11,1) // Set keyboard to PS/2 defaults (10cps,500ms delay)
|
||||
* $END$
|
||||
*/
|
||||
/*This is the Original FT_SETRATE() code
|
||||
PUBLIC FT_SETRATE * MAKE ROUTINE VISIBLE
|
||||
|
||||
|
||||
@@ -22,41 +22,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Librarian's note: The toolkit's original ft_lday() function was
|
||||
submitted by Jeff Bryant. Mike saw it and optimized it. Thanks
|
||||
to you both for your great code!
|
||||
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_LDAY()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return last day of the month
|
||||
* $SYNTAX$
|
||||
* FT_LDAY( [ <dDateToChk> ] ) -> dLastDay
|
||||
* $ARGUMENTS$
|
||||
* <dDateToChk> 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.
|
||||
* $RETURNS$
|
||||
* A Clipper date value representing the last date of the month.
|
||||
* $DESCRIPTION$
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* dDate := CTOD( "09/15/90" )
|
||||
* ? FT_LDAY( dDate ) // 09/30/90
|
||||
* ? FT_LDAY() // 03/31/91 (current month)
|
||||
* $SEEALSO$
|
||||
* FT_FDAY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION ft_lday( dDate )
|
||||
LOCAL d:= dDate
|
||||
IF dDate == NIL
|
||||
|
||||
@@ -24,54 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_LINKED()
|
||||
* $CATEGORY$
|
||||
* Environment
|
||||
* $ONELINER$
|
||||
* Determine if a function was linked in
|
||||
* $SYNTAX$
|
||||
* FT_LINKED( <cString> ) -> lResult
|
||||
* $ARGUMENTS$
|
||||
* <cString> is a character string containing one or more function
|
||||
* calls
|
||||
* $RETURNS$
|
||||
* .T. if all functions within the string are currently linked into
|
||||
* the application, .F. if one or more aren't. See below for a
|
||||
* definition of "function."
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This function would be used in data driven application to determine
|
||||
* whether or not a macro compiled function was linked in.
|
||||
*
|
||||
* Several functions can be passed, and nested, in <cString>.
|
||||
*
|
||||
* Caveat: Some function calls are converted by the preprocessor
|
||||
* into other function calls. You cannot have these types of
|
||||
* functions in a macro compiled string as they never exist at
|
||||
* runtime. FT_LINKED will correctly tell you that they are invalid.
|
||||
*
|
||||
* For instance: there is no function called SORT() in any of the
|
||||
* Nantucket LIBraries, but it is a valid CLIPPER command because the
|
||||
* preprocessor will convert it to other function calls.
|
||||
*
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* cString := "FT_GoodFunc(BadFunc(3,2))"
|
||||
* IF FT_LINKED(cString)
|
||||
* EVAL( &("{||"+cString+"}") )
|
||||
* ELSE
|
||||
* ALERT("Error: "+cString+" was not linked in. Called by FT_LINKED()")
|
||||
* ENDIF
|
||||
*
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
FUNCTION Main
|
||||
@@ -99,7 +51,6 @@
|
||||
|
||||
*------------------------------------------------
|
||||
|
||||
|
||||
FUNCTION FT_Linked( cFuncs )
|
||||
|
||||
// A function is detected by the left parenthesis, "(", and it begins
|
||||
|
||||
@@ -27,53 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MADD()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Add or subtract months to/from a date
|
||||
* $SYNTAX$
|
||||
* FT_MADD( [ <dGivenDate> ], [ <nAddMonths> ], [ <lMakeEOM> ] )
|
||||
* -> dDate
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any date format. Defaults to
|
||||
* current system date if not supplied.
|
||||
*
|
||||
* <nAddMonths> is the number of months to be added or subtracted.
|
||||
* Defaults to 0 if not supplied.
|
||||
*
|
||||
* <lMakeEOM> is a logical variable indicating whether or not to
|
||||
* force the returned date to the last date of the month. It only
|
||||
* affects the returned date if <dGivenDate> is an end-of-month date.
|
||||
* $RETURNS$
|
||||
* A date.
|
||||
* $DESCRIPTION$
|
||||
* FT_MADD() adds or subtracts months to/from a given date.
|
||||
*
|
||||
* If MakeEOM is passed and dGivenDate is the last day of a month,
|
||||
* it will return the EOM of calculated month. Otherwise it will
|
||||
* return the same day as the day of the passed date.
|
||||
* $EXAMPLES$
|
||||
* dDate := CTOD( "09/15/90" )
|
||||
* ? FT_MADD( dDate, 1 ) // 10/15/90
|
||||
* ? FT_MADD( dDate, -2 ) // 07/15/90
|
||||
*
|
||||
* // force EOM
|
||||
* dDate := CTOD( "04/30/91" )
|
||||
* ? FT_MADD( dDate, 1 ) // 05/30/91
|
||||
* ? FT_MADD( dDate, 1, .T. ) // 05/31/91 <- forced EOM
|
||||
* ? FT_MADD( dDate, 2 ) // 06/30/91
|
||||
* ? FT_MADD( dDate, 2, .T. ) // 06/30/91 <- June only has 30 days
|
||||
* ? FT_MADD( dDate, 3 ) // 07/30/91
|
||||
* ? FT_MADD( dDate, 3, .T. ) // 07/31/91 <- forced EOM
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_DAYOFYR() FT_DAYTOBOW()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MADD( dGivenDate, nAddMonths, lMakeEOM)
|
||||
LOCAL nAdjDay, dTemp, i
|
||||
|
||||
|
||||
@@ -24,122 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MENU1()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Pulldown menu system
|
||||
* $SYNTAX$
|
||||
* FT_MENU1( <acBarNames>, <acOptions>, <acAction>,
|
||||
* <acColors> [, <nTopRow> ], [ <lShadow> ] ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <acBarNames> is a character array containing the names to appear
|
||||
* on the menu bar.
|
||||
*
|
||||
* <acOptions> is a multi-dimensional array with one element for each
|
||||
* selection to appear on the pulldown menus.
|
||||
*
|
||||
* <acColors> is an array containing the colors for the menu groups.
|
||||
*
|
||||
* <nTopRow> is a numeric value that determines the row for the menu
|
||||
* bar. If omitted, it defaults to 0.
|
||||
*
|
||||
* <lShadow> is a logical variable. If true (.T.) or omitted, it
|
||||
* uses FT_SHADOW() to add a transparent shadow to the each
|
||||
* pulldown menu. If false (.F.), the menu is drawn without
|
||||
* the shadow.
|
||||
*
|
||||
* All arguments except nTopRow and lShadow are required.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* FT_MENU1() is a function that displays a pulldown menu for each item
|
||||
* on the menu bar and executes the corresponding function for the item
|
||||
* selected. When a called function returns false, FT_MENU1 returns
|
||||
* control to the calling program.
|
||||
*
|
||||
* Valid keystrokes and their corresponding actions:
|
||||
*
|
||||
* Home - Activates Pulldown for first item on the menu bar
|
||||
* End - Activates Pulldown for last item on the menu bar
|
||||
* Left Arrow - Activates next Pulldown to the left
|
||||
* Right Arrow - Activates next Pulldown to the right
|
||||
* Tab - Same as Right Arrow
|
||||
* Shift-Tab - Same as Left Arrow
|
||||
* Page Up - Top item on current Pulldown menu
|
||||
* Page Down - Bottom item on current Pulldown menu
|
||||
* Enter - Selects current item
|
||||
* Alpha Character - Moves to closest match and selects
|
||||
* Alt-<Key> - Moves to corresponding menu bar item
|
||||
* Escape - Prompts for confirmation and either returns to
|
||||
* the calling routine or resumes
|
||||
* $EXAMPLES$
|
||||
* // Declare arrays
|
||||
* LOCAL aColors := {}
|
||||
* LOCAL aBar := { " ENTER/EDIT ", " REPORTS ", " DISPLAY " }
|
||||
*
|
||||
* // Include the following two lines of code in your program, as is.
|
||||
* // The first creates aOptions with the same length as aBar. The
|
||||
* // second assigns a three-element array to each element of aOptions.
|
||||
* LOCAL aOptions[ LEN( aBar ) ]
|
||||
* AEVAL( aBar, { |x,i| aOptions[i] := { {},{},{} } } )
|
||||
*
|
||||
* // fill color array
|
||||
* // Box Border, Menu Options, Menu Bar, Current Selection, Unselected
|
||||
* aColors := iif( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ;
|
||||
* {"W+/N", "W+/N", "W/N", "N/W","W/N"} )
|
||||
*
|
||||
* // array for first pulldown menu
|
||||
* FT_FILL( aOptions[1], 'A. Execute A Dummy Procedure' , {|| fubar()}, .t. )
|
||||
* FT_FILL( aOptions[1], 'B. Enter Daily Charges' , {|| .t.}, .f. )
|
||||
* FT_FILL( aOptions[1], 'C. Enter Payments On Accounts', {|| .t.}, .t. )
|
||||
*
|
||||
* // array for second pulldown menu
|
||||
* FT_FILL( aOptions[2], 'A. Print Member List' , {|| .t.}, .t. )
|
||||
* FT_FILL( aOptions[2], 'B. Print Active Auto Charges' , {|| .t.}, .t. )
|
||||
*
|
||||
* // array for third pulldown menu
|
||||
* FT_FILL( aOptions[3], 'A. Transaction Totals Display', {|| .t.}, .t. )
|
||||
* FT_FILL( aOptions[3], 'B. Display Invoice Totals' , {|| .t.}, .t. )
|
||||
* FT_FILL( aOptions[3], 'C. Exit To DOS' , {|| .f.}, .t. )
|
||||
*
|
||||
* Call FT_FILL() once for each item on each pulldown menu, passing it
|
||||
* three parameters:
|
||||
*
|
||||
* FT_FILL( <cMenuSelection>, <bCodeBlock>, <lSelectable>
|
||||
*
|
||||
* <cMenuSelection> is a character string which will be displayed on
|
||||
* the pulldown menu.
|
||||
*
|
||||
* <bCodeBlock> should contain one of the following:
|
||||
*
|
||||
* A function name to execute, which in turn should return .T. or .F.
|
||||
* FT_MENU1 WILL RETURN CONTROL TO THE CALLING PROGRAM IF .F. IS
|
||||
* RETURNED OR CONTINUE IF .T. IS RETURNED.
|
||||
*
|
||||
* .F. WHICH WILL CAUSE FT_MENU1 TO RETURN CONTROL TO THE CALLING
|
||||
* PROGRAM.
|
||||
*
|
||||
* .T. WHICH WILL DO NOTHING. THIS ALLOWS THE DEVELOPER TO DESIGN A
|
||||
* SKELETON MENU STRUCTURE PRIOR TO COMPLETING ALL OF THE SUBROUTINES.
|
||||
*
|
||||
* // CALL FT_MENU1
|
||||
* FT_MENU1( aBar, aOptions, aColors, 0 )
|
||||
*
|
||||
* NOTE: FT_MENU1() disables Alt-C and Alt-D in order to make them
|
||||
* available for the menu bar. It enables Alt-D and resets
|
||||
* Alt-C to its previous state prior to calling each function.
|
||||
* $SEEALSO$
|
||||
* FT_FILL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
For the sample program:
|
||||
|
||||
@@ -152,7 +36,6 @@
|
||||
PASS "VGA" OR "VGA" AS A COMMAND LINE PARAMETER FOR 50-LINE MODE.
|
||||
*/
|
||||
|
||||
|
||||
#include "common.ch"
|
||||
|
||||
#define LEFTARROW 19
|
||||
@@ -310,7 +193,6 @@ STATIC NHPOS, NVPOS, NMAXROW, NMAXCOL
|
||||
#endif
|
||||
// end of demo program
|
||||
|
||||
|
||||
FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow )
|
||||
LOCAL nTtlUsed
|
||||
LOCAL sMainScrn, lCancMode, lLooping := .t.
|
||||
@@ -481,66 +363,6 @@ STATIC FUNCTION _ftValKeys( nNum,aChoices,aValidkeys )
|
||||
AEVAL( aChoices[nNum,1], {|x| aValidKeys[nNum] += LEFT( x, 1)} )
|
||||
RETURN NIL
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_FILL()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Declare menu options for FT_MENU1()
|
||||
* $SYNTAX$
|
||||
* FT_FILL( <aSubArrayName>, <cMenuSelection>, <bFunction>,
|
||||
* <lSelectable> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <aSubArrayName> is a sub-array of <acOptions> in FT_MENU1()
|
||||
* denoting the group in which to include the selection --
|
||||
* e.g., acOptions[1]
|
||||
*
|
||||
* <cMenuSelection> is the character string that will appear on
|
||||
* the menu.
|
||||
*
|
||||
* <bFunction> is the code block to be executed when that menu
|
||||
* option is selected. i.e. {|| MyFunction() } would execute
|
||||
* the function called MyFunction(). {|| .f.} would exit the
|
||||
* FT_MENU1 and return to the calling routine. {|| .T.} would
|
||||
* do nothing.
|
||||
*
|
||||
* <lSelectable> is a logical variable that determines whether
|
||||
* the corresponding menu option is selectable or not.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* FT_FILL() is a function used to set up the menu options prior
|
||||
* to calling FT_MENU1().
|
||||
* $EXAMPLES$
|
||||
* FT_FILL( aOptions[1], 'A. Execute A Dummy Procedure' , {|| fubar()}, .t. )
|
||||
*
|
||||
* The above would be added to the sub-menu associated with the first menu
|
||||
* bar item, would execute the function FUBAR() when that option was
|
||||
* selected, and would be selectable.
|
||||
*
|
||||
*
|
||||
* FT_FILL( aOptions[3], 'B. Enter Daily Charges' , {|| .t.}, .f. )
|
||||
*
|
||||
* The above would be added to the sub-menu associated with the third menu
|
||||
* bar item, and would be unselectable.
|
||||
*
|
||||
*
|
||||
* FT_FILL( aOptions[2], 'C. Enter Payments On Accounts', {|| .t.}, .t. )
|
||||
*
|
||||
* The above would be added to the sub-menu associated with the second menu
|
||||
* bar item, and would be selectable, but would do nothing when selected.
|
||||
*
|
||||
*
|
||||
* FT_FILL( aOptions[4], 'C. Exit' , {|| .f.}, .t. )
|
||||
*
|
||||
* The above would be added to the sub-menu associated with the fourth menu
|
||||
* bar item, and would be selectable, and would exit FT_MENU1() when chosen.
|
||||
* $SEEALSO$
|
||||
* FT_MENU1()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_FILL( aArray, cMenuOption, bBlock, lAvailable )
|
||||
AADD( aArray[1], cMenuOption )
|
||||
AADD( aArray[2], bBlock )
|
||||
|
||||
@@ -34,154 +34,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_Prompt()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Define a menu item for use with FT_MenuTo()
|
||||
* $SYNTAX$
|
||||
* #include "ftmenuto.ch"
|
||||
*
|
||||
* @ <nRow>, <nCol> PROMPT <cPrompt> ;
|
||||
* [COLOR <cColor>] ;
|
||||
* [MESSAGE <cMessage>] ;
|
||||
* [MSGROW <nMsgRow>] ;
|
||||
* [MSGCOL <nMsgCol>] ;
|
||||
* [MSGCOLOR <cMsgColor>] ;
|
||||
* [TRIGGER <nTrigger>] ;
|
||||
* [TRIGGERCOLOR <cTriggerColor>] ;
|
||||
* [HOME <nHome>] ;
|
||||
* [END <nEnd>] ;
|
||||
* [UP <nUp>] ;
|
||||
* [DOWN <nDown>] ;
|
||||
* [LEFT <nLeft>] ;
|
||||
* [RIGHT <nRight>] ;
|
||||
* [EXECUTE <bExec>] ;
|
||||
*
|
||||
* $ARGUMENTS$
|
||||
* <nRow> is the row at which the prompt is to appear.
|
||||
*
|
||||
* <nCol> is the column at which the prompt will appear.
|
||||
*
|
||||
* <cPrompt> is the menu item string.
|
||||
*
|
||||
* <cColor> is optional and is the color attribute of the prompt. Note
|
||||
* that two colors are required; one for the standard setting and one
|
||||
* for the enhanced setting (i.e. the light bar color). See the example
|
||||
* below if this isn't clear. If <cColor> is not specified then the
|
||||
* current SetColor() value is used by default.
|
||||
*
|
||||
* <cMessage> is optional and is the message associated with the
|
||||
* prompt. If not specified, then no message will be displayed.
|
||||
*
|
||||
* <nMsgRow> is optional and is the row at which the message, if any,
|
||||
* will appear. If not specified, the default is the current setting
|
||||
* of the SET MESSAGE TO command.
|
||||
*
|
||||
* <nMsgCol> is optional and is the column at which the message, if
|
||||
* any, will appear. If not specified, the default is either zero or
|
||||
* centered, depending on the current setting of the CENTER option of
|
||||
* the SET MESSAGE TO command.
|
||||
*
|
||||
* <cMsgColor> is optional and is the color attribute of the message.
|
||||
* If not specified, the default is the same as the prompt color.
|
||||
*
|
||||
* <nTrigger> is optional and is the position within the prompt string
|
||||
* where the trigger character is located. If not specified, the
|
||||
* default is one.
|
||||
*
|
||||
* <cTriggerColor> is optional and is the color attribute of the trigger
|
||||
* character. Note that two colors are required; one for the standard
|
||||
* setting and one for the enhanced setting (i.e. the light bar color).
|
||||
* See the example below if this isn't clear. If <cTriggerColor> is not
|
||||
* specified then the default is the same color as the rest of the
|
||||
* prompt.
|
||||
*
|
||||
* <nHome> is optional and specifies which prompt becomes active
|
||||
* when the home key is pressed. If not specified, the default is
|
||||
* the first prompt.
|
||||
*
|
||||
* <nEnd> is optional and specifies which prompt becomes active
|
||||
* when the end key is pressed. If not specified, the default is
|
||||
* the last prompt.
|
||||
*
|
||||
* <nUp> is optional and specifies which prompt becomes active
|
||||
* when the up arrow key is pressed. If not specified, the
|
||||
* default is the previous prompt. The current setting of SET
|
||||
* WRAP TO is obeyed.
|
||||
*
|
||||
* <nDown> is optional and specifies which prompt becomes
|
||||
* active when the down arrow key is pressed. If not
|
||||
* specified, the default is the next prompt. The current
|
||||
* setting of SET WRAP TO is obeyed.
|
||||
*
|
||||
* <nRight> is optional and specifies which prompt becomes
|
||||
* active when the right arrow key is pressed. If not
|
||||
* specified, the default is the next prompt. The current
|
||||
* setting of SET WRAP TO is obeyed.
|
||||
*
|
||||
* <nLeft> is optional and specifies which prompt becomes
|
||||
* active when the left arrow is pressed. If not specified,
|
||||
* the default is the previous prompt. The current setting of
|
||||
* SET WRAP TO is obeyed.
|
||||
*
|
||||
* <bExec> is optional and is a code block to evaluate whenever
|
||||
* the menu item to which it belongs is selected.
|
||||
* $DESCRIPTION$
|
||||
* Clipper's @...PROMPT and MENU TO commands are fine as far as
|
||||
* they go. But many times you need more flexibility. As
|
||||
* you'll no doubt notice if you read the argument list, this
|
||||
* function is almost completely flexible. You can adjust
|
||||
* locations and colors for every part of the prompt and its
|
||||
* associated message. In addition, since you can control the
|
||||
* effect of the arrow keys, you can allow both horizontal and
|
||||
* vertical movement, or even disable certain arrow keys if you
|
||||
* so desire. Support for nested menus is also available, since
|
||||
* the prompts are stored in stack-based static arrays.
|
||||
*
|
||||
* Note that this command can also be called using function-style
|
||||
* syntax. See the entry for FT_PROMPT() for further details.
|
||||
*
|
||||
* This enhanced version of @...PROMPT requires the inclusion of
|
||||
* the header file ftmenuto.ch in any source file that uses it.
|
||||
* It is may be used in place of the standard Clipper @...PROMPT
|
||||
* command. However, in the interests of functionality it is NOT
|
||||
* 100% compatible. No whining! If compatibility is such a big
|
||||
* deal then use the standard Clipper commands.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
* #include "ftmenuto.ch"
|
||||
*
|
||||
* // Simple prompt
|
||||
* @ 1, 1 PROMPT "Menu choice #1"
|
||||
*
|
||||
* // Prompt with color
|
||||
* @ 3, 1 PROMPT "Menu choice #2" COLOR "W+/R,W+/B"
|
||||
*
|
||||
* // Prompt with a message
|
||||
* @ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch"
|
||||
*
|
||||
* // Prompt with pinpoint message control
|
||||
* @ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ;
|
||||
* MSGROW 22 MSGCOL 4 MSGCOLOR "GR+/N"
|
||||
*
|
||||
* // Prompt with a trigger character ("#" character)
|
||||
* @11, 1 PROMPT "Menu choice #6" TRIGGER 13
|
||||
*
|
||||
* // Prompt with trigger character color control
|
||||
* @13, 1 PROMPT "Menu Choice #7" TRIGGER 13 TRIGGERCOLOR "R+/BG,G+/N"
|
||||
*
|
||||
* // Prompt with right and left arrow keys disabled
|
||||
* @15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8
|
||||
* $INCLUDE$
|
||||
* ftmenuto.ch
|
||||
* $SEEALSO$
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "setcurs.ch"
|
||||
#include "inkey.ch"
|
||||
|
||||
@@ -299,53 +151,6 @@ dispend()
|
||||
|
||||
return NIL
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MenuTo()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Execute light bar menu using prompts created with @...PROMPT
|
||||
* $SYNTAX$
|
||||
* #include "ftmenuto.ch"
|
||||
*
|
||||
* MENU TO <var> [COLD]
|
||||
* $ARGUMENTS$
|
||||
* <var> is the name of the variable to which the result of the menu
|
||||
* selection should be assigned.
|
||||
*
|
||||
* [COLD] is optional and if specified indicates that trigger characters
|
||||
* should be treated as "cold," i.e. rather than causing the menu item
|
||||
* to be selected it only causes the light bar to move to that selection.
|
||||
* $DESCRIPTION$
|
||||
* This enhanced version of MENU TO requires the inclusion of the header
|
||||
* file ftmenuto.ch in any source file that uses it. It may be used in
|
||||
* place of the standard Clipper MENU TO command. However, in the
|
||||
* interests of functionality it is NOT 100% compatible (in particular,
|
||||
* you should make sure that the target memvar exists before executing
|
||||
* the menu -- the Clipper version will create a PRIVATE memvar for you
|
||||
* if it does not already exist, but this version does not). No whining!
|
||||
* If compatibility is such a big deal then use the standard Clipper
|
||||
* command.
|
||||
*
|
||||
* Note that this command can also be called using function-style
|
||||
* syntax. See the entry for FT_MENUTO() for further details.
|
||||
* $EXAMPLES$
|
||||
* #include "ftmenuto.ch"
|
||||
*
|
||||
* // Simple command
|
||||
*
|
||||
* MENU TO memvar
|
||||
*
|
||||
* $INCLUDE$
|
||||
* ftmenuto.ch
|
||||
* $SEEALSO$
|
||||
* FT_Prompt()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_MenuTo( bGetSet, cReadVar, lCold )
|
||||
|
||||
local nMenu := nLevel++
|
||||
@@ -535,7 +340,6 @@ while .not. lChoice
|
||||
substr( aPrompt[ nLast ], aTrigger[ nLast ], 1 ), ;
|
||||
aTriggerColor[ nLast ] )
|
||||
|
||||
|
||||
if cScreen != NIL then restscreen( aMsgRow[ nLast ], ;
|
||||
aMsgCol[ nLast ], ;
|
||||
aMsgRow[ nLast ], ;
|
||||
|
||||
@@ -24,40 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_METAPH()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Convert a character string to MetaPhone format
|
||||
* $SYNTAX$
|
||||
* FT_METAPH( <cName> [, <nSize> ] ) -> cMetaPhone
|
||||
* $ARGUMENTS$
|
||||
* <cName> is the character string to convert
|
||||
|
||||
* <nSize> is the length of the character string to be returned.
|
||||
* If not specified the default length is 4 bytes.
|
||||
* $RETURNS$
|
||||
* A phonetically spelled character string
|
||||
* $DESCRIPTION$
|
||||
* This function is a character function use to index and search for
|
||||
* sound-alike or phonetic matches. It is an alternative to
|
||||
* the SOUNDEX() function, and addresses some basic pronunciation
|
||||
* rules, by looking at surrounding letters to determine how parts of
|
||||
* the string are pronounced. FT_METAPH() will group sound-alikes
|
||||
* together, and forgive shortcomings in spelling ability.
|
||||
* $EXAMPLES$
|
||||
* USE Persons
|
||||
* INDEX ON FT_METAPH( LastName ) TO LastName
|
||||
* SEEK FT_METAPH( "Philmore" )
|
||||
* ? FOUND(), LastName // Result: .T. Philmore
|
||||
* SEEK FT_METAPH( "Fillmore" )
|
||||
* ? FOUND(), LastName // Result: .T. Philmore
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*
|
||||
* File Contents
|
||||
*
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
function main()
|
||||
@@ -66,94 +62,14 @@
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MIL2MIN()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Convert time in military format to number of minute of day.
|
||||
* $SYNTAX$
|
||||
* FT_MIL2MIN( <cMILTIME> ) -> nMINUTE
|
||||
* $ARGUMENTS$
|
||||
* <cMILTIME> character string of form hhmm, where 0<=hh<24.
|
||||
* $RETURNS$
|
||||
* <nMINOFDAY> numeric value representing minute of day.
|
||||
* $DESCRIPTION$
|
||||
* Converts time in military format to number of minute of the day.
|
||||
* $EXAMPLES$
|
||||
* FT_MIL2MIN( "1729" ) -> 1049
|
||||
* $SEEALSO$
|
||||
* FT_MIN2MIL() FT_CIV2MIL() FT_MIL2CIV() FT_SYS2MIL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_MIL2MIN(cMILTIME)
|
||||
return int(val(left(cMILTIME,2))*60 + val(right(cMILTIME,2)))
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MIN2MIL()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Convert minute of day to military format time.
|
||||
* $SYNTAX$
|
||||
* FT_MIN2MIL( <nMINUTE> ) -> cMILTIME
|
||||
* $ARGUMENTS$
|
||||
* <nMINUTE> numeric integer representing minute of day.
|
||||
* $RETURNS$
|
||||
* <cMILTIME> character string of form hhmm, where 0<=hh<24.
|
||||
* $DESCRIPTION$
|
||||
* Converts minute of the day to military format time.
|
||||
* $EXAMPLES$
|
||||
* FT_MIN2MIL( 279 ) -> 0439
|
||||
* $SEEALSO$
|
||||
* FT_MIL2MIN() FT_MIL2CIV() FT_CIV2MIL() FT_SYS2MIL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_MIN2MIL(nMIN)
|
||||
nMIN := nMIN%1440
|
||||
return right("00" + ltrim(str(INT(nMIN/60))),2) + ;
|
||||
right("00" + ltrim(str(INT(nMIN%60))),2)
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MIL2CIV()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Convert time in military format to civilian format.
|
||||
* $SYNTAX$
|
||||
* FT_MIL2CIV( <cCIVTIME> ) -> dMILTIME
|
||||
* $ARGUMENTS$
|
||||
* <cMILTIME> character string of form hhmm, where 0<=hh<24.
|
||||
* $RETURNS$
|
||||
* <cCIVTIME> character string of form hh:mm (am,pm,n or m),
|
||||
* where 0<hh<12.
|
||||
* $DESCRIPTION$
|
||||
* Converts time from military to civilian format
|
||||
* $EXAMPLES$
|
||||
* FT_MIL2CIV( "1640" ) -> 4:40 pm
|
||||
*
|
||||
* FT_MIL2CIV( "0440" ) -> 4:40 am
|
||||
*
|
||||
* FT_MIL2CIV( "1200" ) -> 12:00 n
|
||||
*
|
||||
* FT_MIL2CIV( "0000" ) and FT_MIL2CIV( "2400" ) -> 12:00 m
|
||||
*
|
||||
* Caution: leading blanks are irrelevant.
|
||||
* $SEEALSO$
|
||||
* FT_CIV2MIL() FT_SYS2MIL() FT_MIL2MIN() FT_MIN2MIL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_MIL2CIV(cMILTIME)
|
||||
local cHRS,cMINS,nHRS,cCIVTIME
|
||||
|
||||
@@ -184,40 +100,6 @@ function FT_MIL2CIV(cMILTIME)
|
||||
|
||||
return cCIVTIME
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_CIV2MIL()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Convert usual civilian format time to military time.
|
||||
* $SYNTAX$
|
||||
* FT_CIV2MIL( <cCIVTIME> ) -> cMILTIME
|
||||
* $ARGUMENTS$
|
||||
* <cCIVTIME> character string of form hh:mm (am,pm,n or m),
|
||||
* where 0<hh<12.
|
||||
* $RETURNS$
|
||||
* <cMILTIME> character string of form hhmm, where 0<=hh<24.
|
||||
* $DESCRIPTION$
|
||||
* Converts time from 12-hour civilian format to military.
|
||||
* $EXAMPLES$
|
||||
* FT_CIV2MIL( " 5:40 pm" ) -> 1740
|
||||
*
|
||||
* FT_CIV2MIL( " 5:40 am" ) -> 0540
|
||||
*
|
||||
* FT_CIV2MIL( "12:00 n" ) -> 1200
|
||||
*
|
||||
* FT_CIV2MIL( "12:00 m" ) -> 0000
|
||||
*
|
||||
* Caution: leading blanks are irrelevant; p,a,n,m must be preceded by
|
||||
* one and only one space.
|
||||
* $SEEALSO$
|
||||
* FT_MIL2CIV() FT_SYS2MIL() FT_MIL2MIN() FT_MIN2MIL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_CIV2MIL(cTIME)
|
||||
local cKEY, cMILTIME
|
||||
|
||||
@@ -257,28 +139,5 @@ endcase
|
||||
|
||||
return cMILTIME
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_SYS2MIL()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Convert system time to military time format.
|
||||
* $SYNTAX$
|
||||
* FT_SYS2MIL() -> cMILTIME
|
||||
* $ARGUMENTS$
|
||||
* none
|
||||
* $RETURNS$
|
||||
* <cMILTIME> character string of form hhmm, where 0<=hh<24.
|
||||
* $DESCRIPTION$
|
||||
* Return current system time as character string in military format.
|
||||
* $EXAMPLES$
|
||||
* FT_SYS2MIL() -> 1623
|
||||
* $SEEALSO$
|
||||
* FT_MIL2CIV() FT_CIV2MIL()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_SYS2MIL()
|
||||
return left(stuff(time(),3,1,""),4)
|
||||
|
||||
@@ -27,31 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MIN2DHM()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Convert numeric minutes to days, hours and minutes.
|
||||
* $SYNTAX$
|
||||
* FT_MIN2DHM( <nMinutes> ) -> aDHM_
|
||||
* $ARGUMENTS$
|
||||
* <nMinutes> the number of minutes.
|
||||
* $RETURNS$
|
||||
* <aDHM_>
|
||||
* where:
|
||||
* aDHM_[1] = cDAYS, aDHM_[2] = cHours, aDHM_[3] = cMinutes
|
||||
* $DESCRIPTION$
|
||||
* Converts numeric minutes into a character array containing
|
||||
* days, hours & minutes.
|
||||
* $EXAMPLES$
|
||||
* aDHM_ = MIN2DHM(16789) -> aDHM_[1] = 11, aDHM_[2] = 15, aDHM_[3] = 49
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function FT_MIN2DHM(nMINS)
|
||||
local aDHM_[3]
|
||||
|
||||
|
||||
@@ -25,38 +25,6 @@
|
||||
;
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MKDIR()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Create a subdirectory
|
||||
* $SYNTAX$
|
||||
* FT_MKDIR( <cDirName> ) -> nResult
|
||||
* $ARGUMENTS$
|
||||
* <cDirName> is the name of the directory to create.
|
||||
* $RETURNS$
|
||||
* 0 if successful
|
||||
* 3 if Path Not Found
|
||||
* 5 if Access Denied or directory already exists
|
||||
* 99 if invalid parameters passed
|
||||
* $DESCRIPTION$
|
||||
* Use this function to create the subdirectories needed by your
|
||||
* application. It might be especially useful in an installation
|
||||
* program.
|
||||
*
|
||||
* The source code is written to adhere to Turbo Assembler's IDEAL mode.
|
||||
* To use another assembler, you will need to rearrange the PROC and
|
||||
* SEGMENT directives, and also the ENDP and ENDS directives (a very
|
||||
* minor task).
|
||||
* $EXAMPLES$
|
||||
* FT_MKDIR( "C:\clipper" )
|
||||
* FT_MKDIR( "\example" )
|
||||
* FT_MKDIR( "..\source" )
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*This is the Original FT_CHDIR() code
|
||||
IDEAL
|
||||
MODEL HUGE
|
||||
|
||||
@@ -27,64 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MONTH()
|
||||
* $CATEGORY$
|
||||
* Date/Time
|
||||
* $ONELINER$
|
||||
* Return Calendar or Fiscal Month Data
|
||||
* $SYNTAX$
|
||||
* FT_MONTH( [ <dGivenDate> ], [nMonthNum] ) -> aDateInfo
|
||||
* $ARGUMENTS$
|
||||
* <dGivenDate> is any valid date in any date format. Defaults
|
||||
* to current system date if not supplied.
|
||||
*
|
||||
* <nMonthNum> is a number from 1 to 12 signifying a month.
|
||||
* Defaults to current month if not supplied.
|
||||
* $RETURNS$
|
||||
* A three element array containing the following data:
|
||||
*
|
||||
* aDateInfo[1] - The year and month as a character string "YYYYMM"
|
||||
* aDateInfo[2] - The beginning date of the month
|
||||
* aDateInfo[3] - The ending date of the month
|
||||
* $DESCRIPTION$
|
||||
* FT_MONTH() returns an array containing data about the month
|
||||
* containing the given date.
|
||||
*
|
||||
* Normally the return data will be based on a year beginning
|
||||
* on January 1st with weeks beginning on Sunday.
|
||||
*
|
||||
* 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().
|
||||
*
|
||||
* 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.
|
||||
* $EXAMPLES$
|
||||
* // get info about month containing 9/15/90
|
||||
* aDateInfo := FT_MONTH( CTOD("09/15/90") )
|
||||
* ? aDateInfo[1] // 199009 (9th month)
|
||||
* ? aDateInfo[2] // 09/01/90 beginning of month 9
|
||||
* ? aDateInfo[3] // 09/30/90 end of week month 9
|
||||
*
|
||||
* // get info about month 5 in year containing 9/15/90
|
||||
* aDateInfo := FT_MONTH( CTOD("09/15/90"), 5 )
|
||||
* ? aDateInfo[1] // 199005
|
||||
* ? aDateInfo[2] // 05/01/90 beginning of month 5
|
||||
* ? aDateInfo[3] // 05/31/90 end of month 5
|
||||
*
|
||||
* // get info about month 5 in current year (1991)
|
||||
* aDateInfo := FT_MONTH( , 5 )
|
||||
* ? aDateInfo[1] // 199105
|
||||
* ? aDateInfo[2] // 05/01/91 beginning of month 5
|
||||
* ? aDateInfo[3] // 05/31/91 end of month 5
|
||||
* $SEEALSO$
|
||||
* FT_DATECNFG() FT_WEEK() FT_QTR() FT_YEAR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MONTH( dGivenDate, nMonthNum )
|
||||
LOCAL lIsMonth, nTemp, aRetVal
|
||||
|
||||
|
||||
@@ -240,7 +240,6 @@ HB_FUNC( _MGET_MICS )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( _M_RESET )
|
||||
{
|
||||
int iMouse;
|
||||
@@ -390,7 +389,6 @@ HB_FUNC( _M_MXLIMIT )
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( _M_MYLIMIT )
|
||||
{
|
||||
#if defined( HB_OS_DOS )
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,12 +60,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// The original mouse routines were written by Robert diFalco but
|
||||
// Leo Letendre has made such major additions and modifications
|
||||
// and fixes that I've given him sole credit. -- G. Scott
|
||||
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
static aReg[10]
|
||||
@@ -267,39 +265,8 @@ static lMinit:=.F.
|
||||
|
||||
RETURN nil
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MINIT()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Initialize the mouse driver, vars and return status of mouse
|
||||
* $SYNTAX$
|
||||
* FT_MINIT() -> lMouseStatus
|
||||
* $ARGUMENTS$
|
||||
* NONE
|
||||
* $RETURNS$
|
||||
* An logical representing the mouse status (.F. == mouse not installed)
|
||||
* $DESCRIPTION$
|
||||
* Initializes the mouse drive, associated variables and returns mouse
|
||||
* status. It checks to see if the mouse has been previously initialized
|
||||
* and if so it does not reinitialize. The row and column limits of mouse
|
||||
* movement is set to the maximum for the current video mode.
|
||||
* Use FT_MSHOWCRS() to display the mouse cursor.
|
||||
* $EXAMPLES$
|
||||
* IF .NOT. FT_MINIT()
|
||||
* ? "No mouse driver is installed"
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_MRESET()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MINIT()
|
||||
|
||||
* If not previously initialized then try
|
||||
@@ -313,41 +280,8 @@ FUNCTION FT_MINIT()
|
||||
FT_MXLIMIT(0,8*MAXCOL())
|
||||
ENDIF
|
||||
|
||||
|
||||
RETURN lMinit
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MRESET()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Reset mouse driver and return status of mouse
|
||||
* $SYNTAX$
|
||||
* FT_MRESET() -> nMouseStatus
|
||||
* $ARGUMENTS$
|
||||
* NONE
|
||||
* $RETURNS$
|
||||
* An integer representing the mouse status (0 == mouse not installed)
|
||||
* $DESCRIPTION$
|
||||
* Resets the mouse driver and returns mouse status. Use FT_MSHOWCRS()
|
||||
* to display the mouse cursor. The mouse is set to allow it to cover the
|
||||
* complete screen (as defined by MAXCOL() and MAXROW()). This is necessary
|
||||
* because at least some versions of the mouse drivers do not operate
|
||||
* according to the documentation when confronted with a 43 or 50 line
|
||||
* screen.
|
||||
*
|
||||
* Normally, FT_MINIT() should be used to initialize the mouse since it
|
||||
* will not reinitialize if already done.
|
||||
* $EXAMPLES$
|
||||
* IF Empty( FT_MRESET() )
|
||||
* ? "No mouse driver is installed"
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_MINIT() FT_MSHOWCRS()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MRESET()
|
||||
|
||||
aReg[AX] := 0 // set mouse function call 0
|
||||
@@ -361,33 +295,6 @@ FUNCTION FT_MRESET()
|
||||
|
||||
RETURN aReg[AX] // return status code
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MCURSOR()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Set the mouse cursor
|
||||
* $SYNTAX$
|
||||
* FT_MCURSOR( [ <lState> ] ) -> lCursorState
|
||||
* $ARGUMENTS$
|
||||
* <lState> is a logical indicating whether to set the mouse cursor on.
|
||||
* .T. - set mouse cursor on
|
||||
* .F. - set mouse cursor off
|
||||
* If omitted, no change is made to cursor state
|
||||
* $RETURNS$
|
||||
* A logical indicating the previous mouse cursor state.
|
||||
* $DESCRIPTION$
|
||||
* This function works like most Clipper state functions. If no value
|
||||
* is sent to FT_MCURSOR() it will return the state of the mouse cursor.
|
||||
* $EXAMPLES$
|
||||
* IF !( FT_MCURSOR() )
|
||||
* FT_MCURSOR( .T. )
|
||||
* ENDIF
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MCURSOR( lState )
|
||||
local lSavState := lCrsState
|
||||
|
||||
@@ -401,41 +308,6 @@ FUNCTION FT_MCURSOR( lState )
|
||||
|
||||
RETURN lSavState
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MSHOWCRS()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Increment internal cursor flag and display mouse cursor
|
||||
* $SYNTAX$
|
||||
* FT_MSHOWCRS() -> NIL
|
||||
* $ARGUMENTS$
|
||||
* NONE
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Displays the mouse cursor. Make sure to turn the mouse cursor off
|
||||
* when redrawing screens. The mouse cursor dutifully saves the screen
|
||||
* under it, so if you draw over the mouse cursor it will create a "hole"
|
||||
* in your screen when you move the mouse cursor.
|
||||
*
|
||||
* Note: A call to FT_MHIDECRS() decrements a mouse driver variable
|
||||
* which indicates whether the cursor is shown. The cursor is visible
|
||||
* only when the variable = 0. Thus multiple calls to FT_MHIDECRS()
|
||||
* require an equal number of calls to FT_MSHOWCRS() before the cursor
|
||||
* will again be visible. Once the variable is 0 calls to FT_MSHOWCRS()
|
||||
* does not increment the variable above 0.
|
||||
* $EXAMPLES$
|
||||
* IF Empty( FT_MRESET() )
|
||||
* FT_MSHOWCRS()
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_MHIDECRS() FT_MCONOFF()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MSHOWCRS()
|
||||
|
||||
aReg[AX] := 1 // set mouse function call 1
|
||||
@@ -444,44 +316,6 @@ FUNCTION FT_MSHOWCRS()
|
||||
|
||||
RETURN NIL // no output from function
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MHIDECRS()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Decrement internal mouse cursor flag and hide mouse cursor
|
||||
* $SYNTAX$
|
||||
* FT_MHIDECRS() -> NIL
|
||||
* $ARGUMENTS$
|
||||
* NONE
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Hides the mouse cursor. Make sure to turn the mouse cursor off when
|
||||
* redrawing screens. The mouse cursor dutifully saves the screen
|
||||
* under it, so if you draw over the mouse cursor it will create a
|
||||
* "hole" in your screen when you move the mouse cursor.
|
||||
*
|
||||
* Note: A call to FT_MHIDECRS() decrements a mouse driver variable
|
||||
* which indicates whether the cursor is shown. The cursor is visible
|
||||
* only when the variable = 0. Thus multiple calls to FT_MHIDECRS()
|
||||
* require an equal number of calls to FT_MSHOWCRS() before the cursor
|
||||
* will again be visible. Once the variable is 0 calls to FT_MSHOWCRS()
|
||||
* does not increment the varaible above 0.
|
||||
* $EXAMPLES$
|
||||
* FT_MHIDECRS()
|
||||
* @ 10, 10 to 20, 20
|
||||
* FT_MSHOWCRS()
|
||||
* $SEEALSO$
|
||||
* FT_MSHOWCRS() FT_MCONOFF()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
FUNCTION FT_MHIDECRS() // decrement internal cursor flag and hide cursor
|
||||
|
||||
aReg[AX] := 2 // set mouse function call 2
|
||||
@@ -489,54 +323,6 @@ FUNCTION FT_MHIDECRS() // decrement internal cursor flag and hide cursor
|
||||
lCrsState := .f.
|
||||
RETURN NIL // no output from function
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MGETPOS()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Get mouse cursor position and button status
|
||||
* $SYNTAX$
|
||||
* FT_MGETPOS( @<nX>, @<nY> ) -> nButtonStatus
|
||||
* $ARGUMENTS$
|
||||
* <nX> is a variable that will receive the mouse X position in virtual
|
||||
* screen coordinates. It must be passed by reference.
|
||||
*
|
||||
* <nY> is a variable that will receive the mouse Y position in virtual
|
||||
* screen coordinates. It must be passed by reference.
|
||||
* $RETURNS$
|
||||
* an integer representing button status
|
||||
*
|
||||
* - 0 for no button pressed
|
||||
* - 1 for left pressed
|
||||
* - 2 for right pressed
|
||||
* - 3 for left and right pressed
|
||||
* - 4 for middle pressed
|
||||
* - 5 for left and middle pressed
|
||||
* - 6 for right and middle pressed
|
||||
* - 7 for all three buttons pressed
|
||||
* $DESCRIPTION$
|
||||
* Loads cursor position into x and y coordinates passed by reference and
|
||||
* returns the button status. The coordinate system in text mode has
|
||||
* eight virtual coordinates per character cell. Thus x=16 means that you
|
||||
* are in the Row 2. The values returned by this routine when in text mode
|
||||
* and with mouse driver versions 6 and above are multiples of 8. We have
|
||||
* experience with drivers prior to that version
|
||||
* $EXAMPLES$
|
||||
* LOCAL nX, nY
|
||||
* LOCAL nButton := FT_MGETPOS( @nX, @nY )
|
||||
* ? "Mouse Row :", nX
|
||||
* ? "Mouse Column :", nY
|
||||
* ? "Button Status:", nButton
|
||||
* $SEEALSO$
|
||||
* FT_MGETCOORD() FT_MSETPOS() FT_MDEFCRS() FT_MGETX() FT_MGETY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
FUNCTION FT_MGETPOS( nX, nY )
|
||||
|
||||
nX := iif( nX == NIL, 0, nX )
|
||||
@@ -549,46 +335,6 @@ FUNCTION FT_MGETPOS( nX, nY )
|
||||
|
||||
RETURN aReg[BX] // return button status
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MGETCOORD()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Get mouse cursor position (text coord.) and button status
|
||||
* $SYNTAX$
|
||||
* FT_MGETPOS( @<nX>, @<nY> ) -> nButtonStatus
|
||||
* $ARGUMENTS$
|
||||
* <nX> is a variable that will receive the mouse X position in text
|
||||
* screen coordinates. It must be passed by reference.
|
||||
*
|
||||
* <nY> is a variable that will receive the mouse Y position in text
|
||||
* screen coordinates. It must be passed by reference.
|
||||
* $RETURNS$
|
||||
* an integer representing button status
|
||||
*
|
||||
* - 0 for no button pressed
|
||||
* - 1 for left pressed
|
||||
* - 2 for right pressed
|
||||
* - 3 for left and right pressed
|
||||
* - 4 for middle pressed
|
||||
* - 5 for left and middle pressed
|
||||
* - 6 for right and middle pressed
|
||||
* - 7 for all three buttons pressed
|
||||
* $DESCRIPTION$
|
||||
* Loads cursor position into x and y coordinates passed by reference and
|
||||
* returns the button status.
|
||||
* $EXAMPLES$
|
||||
* LOCAL nX, nY
|
||||
* LOCAL nButton := FT_MGETCOORD( @nX, @nY )
|
||||
* ? "Mouse Row :", nX
|
||||
* ? "Mouse Column :", nY
|
||||
* ? "Button Status:", nButton
|
||||
* $SEEALSO$
|
||||
* FT_MGETPOS() FT_MSETPOS() FT_MDEFCRS() FT_MGETX() FT_MGETY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MGETCOORD( nX, nY )
|
||||
|
||||
* Duplicated code from FT_MGETPOS() for speed reasons
|
||||
@@ -603,32 +349,6 @@ FUNCTION FT_MGETCOORD( nX, nY )
|
||||
|
||||
RETURN aReg[BX] // return button status
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MGETX()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Get mouse cursor row position
|
||||
* $SYNTAX$
|
||||
* FT_MGETX() -> nRowPos
|
||||
* $ARGUMENTS$
|
||||
* NONE
|
||||
* $RETURNS$
|
||||
* <nRowPos> which is the row position of mouse in virtual screen
|
||||
* coordinates.
|
||||
* $DESCRIPTION$
|
||||
* Retrieves mouse's row position in virtual screen coordinates. The
|
||||
* values returned are multiples of 8 when in text mode and with at least
|
||||
* Microsoft drivers 6 and above.
|
||||
* $EXAMPLES$
|
||||
* ? FT_MGETX()
|
||||
* $SEEALSO$
|
||||
* FT_MGETCOORD() FT_MDEFCRS() FT_MGETPOS() FT_MGETY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MGETX()
|
||||
|
||||
* Duplicated code from FT_MGETPOS() for speed reasons
|
||||
@@ -638,30 +358,6 @@ FUNCTION FT_MGETX()
|
||||
|
||||
RETURN( INT(aReg[DX]/8) ) // return x-coordinate
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MGETY()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Get mouse cursor column position
|
||||
* $SYNTAX$
|
||||
* FT_MGETY() -> nColPos
|
||||
* $ARGUMENTS$
|
||||
* NONE
|
||||
* $RETURNS$
|
||||
* <nColPos> Column position of mouse in virtual screen coordinates
|
||||
* $DESCRIPTION$
|
||||
* Retrieves mouse's column position in virtual screen coordinates. The
|
||||
* values returned are multiples of 8 when in text mode and with at least
|
||||
* Microsoft drivers 6 and above.
|
||||
* $EXAMPLES$
|
||||
* ? FT_MGETY()
|
||||
* $SEEALSO$
|
||||
* FT_MGETCOORD() FT_MDEFCRS() FT_MGETPOS() FT_MGETX()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MGETY()
|
||||
|
||||
* Duplicated code from FT_MGETPOS() for speed reasons
|
||||
@@ -671,33 +367,6 @@ FUNCTION FT_MGETY()
|
||||
|
||||
RETURN( INT(aReg[CX]/8)) // return y-coordinate
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MSETPOS()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Position the mouse cursor using virtual screen coordinates
|
||||
* $SYNTAX$
|
||||
* FT_MSETPOS( <nX>, <nY> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nX> is the desired mouse row.
|
||||
*
|
||||
* <nY> is the desired mouse column.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Positions mouse cursor on screen. The virtual coordinate system in text
|
||||
* mode has eight virtual coordinates per character cell. Thus x=16 means
|
||||
* that you are in the Row 2.
|
||||
* $EXAMPLES$
|
||||
* FT_MSETPOS( 10, 20 ) // position mouse cursor at row 10, col 20
|
||||
* // in virtual screen coordinates
|
||||
* $SEEALSO$
|
||||
* FT_MGETPOS() FT_MGETCOORD() FT_MSETCOORD() FT_MGETX() FT_MGETY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MSETPOS( nX, nY ) // set mouse cursor location
|
||||
|
||||
aReg[AX] := 4 // set mouse function call 4
|
||||
@@ -707,33 +376,6 @@ FUNCTION FT_MSETPOS( nX, nY ) // set mouse cursor location
|
||||
|
||||
RETURN NIL // no function output
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MSETCOORD()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Position the mouse cursor using text screen coordinates
|
||||
* $SYNTAX$
|
||||
* FT_MSETPOS( <nX>, <nY> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nX> is the desired mouse row.
|
||||
*
|
||||
* <nY> is the desired mouse column.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Positions mouse cursor on screen using text (normal row and column)
|
||||
* coordinates.
|
||||
* $EXAMPLES$
|
||||
* FT_MSETCOORD( 10, 20 ) // position mouse cursor at row 10, col 20
|
||||
* // in text screen coordinates
|
||||
* $SEEALSO$
|
||||
* FT_MGETPOS() FT_MGETCOORD() FT_MSETPOS() FT_MDEFCRS() FT_MGETX() FT_MGETY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MSETCOORD( nX, nY ) // set mouse cursor location
|
||||
|
||||
aReg[AX] := 4 // set mouse function call 4
|
||||
@@ -743,30 +385,6 @@ FUNCTION FT_MSETCOORD( nX, nY ) // set mouse cursor location
|
||||
|
||||
RETURN NIL // no function output
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MXLIMIT()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Set vertical bounds of mouse using virtual screen coord.
|
||||
* $SYNTAX$
|
||||
* FT_MXLIMIT( <nX1>, <nX2> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nX1> is the top row limit.
|
||||
*
|
||||
* <nX2> is the bottom row limit.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Set maximum vertical bounds of mouse using virtual screen coordinates.
|
||||
* $EXAMPLES$
|
||||
* FT_MXLIMIT( 10, 20 )
|
||||
* $SEEALSO$
|
||||
* FT_MYLIMIT() FT_MINREGION()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MXLIMIT( nXMin, nXMax ) // set vertical minimum and maximum coordinates
|
||||
|
||||
aReg[AX] = 7 // set mouse function call 7
|
||||
@@ -776,30 +394,6 @@ FUNCTION FT_MXLIMIT( nXMin, nXMax ) // set vertical minimum and maximum coordi
|
||||
|
||||
RETURN NIL
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MYLIMIT()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Set horiz. bounds of mouse using virtual screen coordinates
|
||||
* $SYNTAX$
|
||||
* FT_MYLIMIT( <nY1>, <nY2> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nY1> is the left column limit.
|
||||
*
|
||||
* <nY2> is the right column limit.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Set maximum horizontal bounds of mouse using virtual screen coordinates.
|
||||
* $EXAMPLES$
|
||||
* FT_MYLIMIT( 10, 20 )
|
||||
* $SEEALSO$
|
||||
* FT_MXLIMIT() FT_MINREGION()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MYLIMIT( nYMin, nYMax ) // set horizontal minimum and maximum coordinates
|
||||
|
||||
aReg[AX] = 8 // set mouse function call 8
|
||||
@@ -809,53 +403,6 @@ FUNCTION FT_MYLIMIT( nYMin, nYMax ) // set horizontal minimum and maximum coord
|
||||
|
||||
RETURN NIL // no function output
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MBUTPRS()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Retrieve button press status
|
||||
* $SYNTAX$
|
||||
* FT_MBUTPRS( <nButton> [, @nButPrs [, @nX [, @nY] ] ] ) -> nButStatus
|
||||
* $ARGUMENTS$
|
||||
* <nButton> is the mouse button number:
|
||||
*
|
||||
* 0 - Left Button
|
||||
* 1 - Right Button
|
||||
* 2 - Middle Button [if applicable]
|
||||
*
|
||||
* <nButPrs> is the number of times the specified button was pressed
|
||||
* since the last call to this routine. PASSED BY REFERENCE.
|
||||
* <nX> is the X position of the cursor when the last press occurred.
|
||||
* PASSED BY REFERENCE.
|
||||
* <nY> is the Y position of the cursor when the last press occurred.
|
||||
* PASSED BY REFERENCE.
|
||||
*
|
||||
* $RETURNS$
|
||||
* An integer representing the button status:
|
||||
*
|
||||
* 0 - no buttons pressed
|
||||
* 1 - left button pressed
|
||||
* 2 - right button pressed
|
||||
* 3 - left and right pressed
|
||||
* 4 - middle pressed
|
||||
* 5 - left and middle pressed
|
||||
* 6 - middle and right buttons pressed
|
||||
* 7 - all 3 buttons pressed
|
||||
* $DESCRIPTION$
|
||||
* Retrieves the mouse button status and the position of the cursor when
|
||||
* a button was last pressed.
|
||||
* $EXAMPLES$
|
||||
* IF Empty( FT_MBUTPRS(1) )
|
||||
* ? "No Item selected"
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_MBUTREL() FT_MDBLCLK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
FUNCTION FT_MBUTPRS( nButton, nButPrs, nX, nY ) // get button press information
|
||||
|
||||
aReg[AX] := 5 // set mouse function call 5
|
||||
@@ -867,51 +414,6 @@ FUNCTION FT_MBUTPRS( nButton, nButPrs, nX, nY ) // get button press information
|
||||
|
||||
RETURN aReg[AX] // return button status
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MBUTREL()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Get mouse button release information
|
||||
* $SYNTAX$
|
||||
* FT_MBUTREL( nButton [, @nButRel [, @nX [, @nY] ] ]) -> nBStat
|
||||
* $ARGUMENTS$
|
||||
* <nButton> is the mouse button number
|
||||
* 0 - Left Button
|
||||
* 1 - Right Button
|
||||
* 2 - Middle Button [if applicable]
|
||||
*
|
||||
* <nButRel> is the number of times the specified button was released
|
||||
* since the last call to this routine. PASSED BY REFERENCE.
|
||||
*
|
||||
* <nX> is the X position of the cursor when the last release occurred.
|
||||
* PASSED BY REFERENCE.
|
||||
*
|
||||
* <nY> is the Y position of the cursor when the last release occurred.
|
||||
* PASSED BY REFERENCE.
|
||||
* $RETURNS$
|
||||
* <nBStat> - an integer representing button release status
|
||||
* 0 - None
|
||||
* 1 - Left
|
||||
* 2 - Right
|
||||
* 3 - Middle
|
||||
* $DESCRIPTION$
|
||||
* This function returns the release status of the mouse buttons and the
|
||||
* coordinates of the last release.
|
||||
* $EXAMPLES$
|
||||
* IF FT_MBUTREL( 0 ) == 1
|
||||
* ? "Left button released"
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_MBUTPRS() FT_MDBLCLK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
FUNCTION FT_MBUTREL( nButton, nButRel, nX, nY ) // get button release information
|
||||
|
||||
aReg[AX] := 6 // set mouse function call 6
|
||||
@@ -923,64 +425,6 @@ FUNCTION FT_MBUTREL( nButton, nButRel, nX, nY ) // get button release informatio
|
||||
|
||||
RETURN aReg[AX] // return button status
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_MDEFCRS()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Define the mouse cursor
|
||||
* $SYNTAX$
|
||||
* FT_MDEFCRS( <nCrsType>, <nScrMask>, <nCrsMask> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nCrsType> is the cursor type. A value of 0 indicates the software cursor
|
||||
* (the default) and a value of 1 indicates the hardware cursor.
|
||||
*
|
||||
* <nScrMask> is the screen mask for the software cursor or the first scan
|
||||
* line of the hardware cursor. See the description for more
|
||||
* information.
|
||||
*
|
||||
* <nCrsMask> is the cursor mask for the software cursor of the last scan
|
||||
* line of the hardware cursor. See the description for more
|
||||
* information.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* In text mode the mouse cursor can either be a software generated or
|
||||
* the actual hardware cursor. This routine allows one choose between them.
|
||||
* The software cursor is the default and its effect on the character it
|
||||
* covers is determined by the screen mask and the cursor mask. Both of
|
||||
* these masks are 16 bit values (which in Clipper are passed as standard
|
||||
* numerical values). The 16 bit masks are arranged in a manner identical
|
||||
* to the way information is stored for each character cell on the screen.
|
||||
* The low order 8 bits represent the actual character displayed while the
|
||||
* high order bits represent the display atributes such as blinking,
|
||||
* intensity and forground and background colors. The mask is represented in
|
||||
* the diagram below:
|
||||
*
|
||||
* Bit: ³15 ³14 12³11 ³10 8³7 0³
|
||||
* Function:³blink ³background³intensity³foreground³character³
|
||||
*
|
||||
* Blinking and high intensity are on when the bit is 1. The background and
|
||||
* foreground indicate which colors are used for each. The software mouse
|
||||
* cursor uses these two values by taking the mask from the screen cell it
|
||||
* is on and performing a logical AND on each bit with the screen mask
|
||||
* value. The result is then logically XOR'ed with the cursor mask value.
|
||||
* Thus to keep the character the same but invert the foreground and
|
||||
* background colors the following values would be used:
|
||||
*
|
||||
* Bit: ³15 ³14 12³11 ³10 8³7 0³
|
||||
* Function:³blink ³background³intensity³foreground³character³
|
||||
* screen: ³ 0 ³ 111 ³ 0 ³ 111 ³11111111 ³ =30719
|
||||
* cursor: ³ 0 ³ 111 ³ 0 ³ 111 ³00000000 ³ =30464
|
||||
*
|
||||
* The hardware cursor is the text cursor provided by the video board. One
|
||||
* specifies the range of scan lines which are on using <nScrMask> and
|
||||
* <nCrsMask>. The range of values is dependant upon the type of monitor.
|
||||
* The first scan line is 0.
|
||||
* $END$
|
||||
*/
|
||||
/*
|
||||
FUNCTION FT_MDEFCRS( nCurType, nScrMask, nCurMask ) // define text cursor type and masks
|
||||
|
||||
|
||||
@@ -26,31 +26,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_N2COLOR()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Returns the string complement of a Clipper color number
|
||||
* $SYNTAX$
|
||||
* FT_COLOR2N( <nColor> ) -> cColor
|
||||
* $ARGUMENTS$
|
||||
* <nColor> a number representing a Clipper color
|
||||
* $RETURNS$
|
||||
* The string complement of a number representing a Clipper or a
|
||||
* null string if the parameter is invalid
|
||||
* $DESCRIPTION$
|
||||
* This function is useful for converting a number to a Clipper color
|
||||
* string.
|
||||
* $EXAMPLES$
|
||||
* cColor := FT_COLOR2N( 239 ) // returns "*+w/gr"
|
||||
* $SEEALSO$
|
||||
* FT_N2COLOR()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapigt.h"
|
||||
|
||||
|
||||
@@ -24,57 +24,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NETPV()
|
||||
* $CATEGORY$
|
||||
* Math
|
||||
* $ONELINER$
|
||||
* Calculate net present value
|
||||
* $SYNTAX$
|
||||
* FT_NETPV( <nInitialInvestment>, <nInterestRate>, <aCashFlow> ;
|
||||
* [, <nNoOfCashFlows> ] ) -> nNetPV
|
||||
* $ARGUMENTS$
|
||||
* <nInitialInvestment> is the amount of cash invested for purposes
|
||||
* of generating the cash flows.
|
||||
*
|
||||
* <nInterestRate> is the annual interest rate used to discount
|
||||
* expected cash flows (10.5% = 10.5, not .105).
|
||||
*
|
||||
* <aCashFlow> is an array of the expected cash receipts each year.
|
||||
*
|
||||
* <nNoOfCashFlows> is the number of years cash flows are expected
|
||||
* (optional, Len( aCashFlow ) ).
|
||||
* $RETURNS$
|
||||
* The difference between the initial investment and the discounted
|
||||
* cash flow in dollars.
|
||||
* $DESCRIPTION$
|
||||
* This function calculates the net present value, the difference
|
||||
* between the cost of an initial investment and the present value
|
||||
* of the expected cash flow(s) from the investment. The present
|
||||
* value of the expected cashflow(s) is calculated at the specified
|
||||
* interest rate, which is often referred to as the "cost of capital".
|
||||
*
|
||||
* This function can be used to evaluate alternative investments.
|
||||
* The larger the NPV, the more profitable the investment. See
|
||||
* also the FutureValue and PresentValue for further explanations.
|
||||
* The formula to calculate the net present value is:
|
||||
*
|
||||
* NetPresentValue = SUM(CashFlow[i] / ((1 + InterestRate) ** i))
|
||||
* FOR i = 1 TO NoOfCashFlows
|
||||
* $EXAMPLES$
|
||||
* nNetPresentValue := FT_NETPV(10000, 10, { 10000,15000,16000,17000 } )
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
FUNCTION MAIN()
|
||||
? FT_NETPV( 10000, 10, { 10000,15000,16000,17000 } )
|
||||
RETURN ( nil )
|
||||
#endif
|
||||
|
||||
|
||||
FUNCTION FT_NETPV(nInitialInvestment, nInterestRate, aCashFlow, nNoOfCashFlows)
|
||||
|
||||
LOCAL nNetPresentValue := 0
|
||||
|
||||
@@ -24,42 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NOOCCUR()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Find the number of times one string occurs in another
|
||||
* $SYNTAX$
|
||||
* FT_NOOCCUR( <cCheckFor>, <cCheckIn> ;
|
||||
* [, <lIgnoreCase> ] ) -> <nOccurrences>
|
||||
* $ARGUMENTS$
|
||||
* <cCheckFor> is the string to search for
|
||||
*
|
||||
* <cCheckIn> is the string to search
|
||||
*
|
||||
* <lIgnoreCase> is a boolean variable to force case sensitivity
|
||||
* (optional, defaults to .F.).
|
||||
* $RETURNS$
|
||||
* The number of times <cCheckFor> appears in <cCheckIn>
|
||||
* $DESCRIPTION$
|
||||
* This function finds the number of times a string occurs in a
|
||||
* second string.
|
||||
* $EXAMPLES$
|
||||
* // Find the number of times "the" appears in cMemoString, case
|
||||
* // insensitive
|
||||
*
|
||||
* nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString )
|
||||
*
|
||||
* // Find the number of times "the" appears in cMemoString, case
|
||||
* // sensitive
|
||||
*
|
||||
* nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString, .T. )
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#define IS_NOT_LOGICAL(x) (VALTYPE(x) != "L")
|
||||
#define MAKE_UPPER(x) (x := UPPER(x))
|
||||
|
||||
|
||||
@@ -21,57 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NTOW()
|
||||
* $CATEGORY$
|
||||
* Conversion
|
||||
* $ONELINER$
|
||||
* Translate numeric value to words
|
||||
* $SYNTAX$
|
||||
* FT_NTOW( <nNumber> ) -> cWords
|
||||
* $ARGUMENTS$
|
||||
* <nNumber> An integer to translate
|
||||
* $RETURNS$
|
||||
* A text string representing <nNumber>
|
||||
* $DESCRIPTION$
|
||||
* Translates numeric input to a text string.
|
||||
*
|
||||
* FT_NTOW is intended to be used with integers only. Since I don't
|
||||
* know what your application will be, I can't assume the type of
|
||||
* fraction you want returned (ninety nine cents, 99/100, .99, etc).
|
||||
* If you want the fraction in words, just pass it as an integer.
|
||||
*
|
||||
* Do not pass a negative number! Handle negative numbers any way
|
||||
* you need to in your code. (ie: CR, DB, Negative, Minus, etc.)
|
||||
*
|
||||
* Also, numeric 0 is returned as a null string. You will need to
|
||||
* make a decision how to output it (zero dollars, no dollars, etc).
|
||||
* $EXAMPLES$
|
||||
* ? FT_NTOW( 999 ) -> Nine Hundred Ninety Nine
|
||||
*
|
||||
* ? FT_NTOW( 1000 ) -> One Thousand
|
||||
*
|
||||
* ? FT_NTOW( 23 ) + " Dollars and " + FT_NTOW( 99 ) + " Cents"
|
||||
* -> Twenty Three Dollars and Ninety Nine Cents
|
||||
*
|
||||
* ? FT_NTOW( 23 ) + " Dollars and " + "99/100"
|
||||
* -> Twenty Three Dollars and 99/100
|
||||
*
|
||||
* x := -23.99
|
||||
* cents := str( (x - int( x )) * 100, 2, 0 ) + "/100"
|
||||
* x := int( x )
|
||||
* string := iif( x < 0, "Credit of ", "Debit of " )
|
||||
* ? string + FT_NTOW( abs(x) ) + " Dollars and " + "99/100"
|
||||
* -> Credit of Twenty Three Dollars and 99/100
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
static ones := { "", " One", " Two", " Three", " Four", " Five", ;
|
||||
" Six", " Seven", " Eight", " Nine" ;
|
||||
}
|
||||
@@ -87,14 +36,11 @@ static tens := { "", "", " Twenty", " Thirty", " Forty", " Fifty", ;
|
||||
|
||||
static qualifiers := { "", " Thousand", " Million", " Billion", " Trillion" }
|
||||
|
||||
|
||||
#ifdef FT_TEST
|
||||
function main( cNum )
|
||||
return qout( ft_ntow( val( cNum ) ) )
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
function ft_ntow(nAmount)
|
||||
local nTemp, sResult := " ", nQualNo
|
||||
local nDiv := 10 ^ ( int( sol10(nAmount) / 3 ) * 3 )
|
||||
@@ -111,7 +57,6 @@ function ft_ntow(nAmount)
|
||||
endif
|
||||
return ltrim(sResult)
|
||||
|
||||
|
||||
static function grp_to_words(nGrp, sQual)
|
||||
local sResult := "", nTemp
|
||||
|
||||
@@ -130,7 +75,6 @@ static function grp_to_words(nGrp, sQual)
|
||||
endcase
|
||||
return sResult + sQual
|
||||
|
||||
|
||||
static function sol10( nNumber )
|
||||
local sTemp
|
||||
|
||||
|
||||
@@ -29,50 +29,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NUMLOCK()
|
||||
* $CATEGORY$
|
||||
* Keyboard/Mouse
|
||||
* $ONELINER$
|
||||
* Return status of NumLock key
|
||||
* $SYNTAX$
|
||||
* FT_NUMLOCK( [ <lNewSetting> ] ) -> lCurrentSetting
|
||||
* $ARGUMENTS$
|
||||
* <lNewSetting> is optional and if supplied is the new setting
|
||||
* for the CapLock key. Specify .T. to turn CapLock on, or .F. to
|
||||
* turn it off.
|
||||
* $RETURNS$
|
||||
* lValue is .T. if NumLock is set, .F. if it isn't set. The value
|
||||
* returned represents the setting in effect prior to any changes that
|
||||
* might by made by <lNewSetting>.
|
||||
* $DESCRIPTION$
|
||||
* This function is useful if you need to know or set the status of the
|
||||
* NumLock key for some reason.
|
||||
* $EXAMPLES$
|
||||
* IF FT_NUMLOCK()
|
||||
* Qout( "NumLock is active" )
|
||||
* ENDIF
|
||||
*
|
||||
* Another one, slightly strange, courtesy of Glenn Scott:
|
||||
*
|
||||
*
|
||||
* function numBlink()
|
||||
* local lOldNum := ft_numlock()
|
||||
*
|
||||
* while inkey( .5 ) != 27
|
||||
* ft_numlock( !ft_numlock() )
|
||||
* end
|
||||
*
|
||||
* return ft_numlock( lOldNum )
|
||||
* $SEEALSO$
|
||||
* FT_CAPLOCK() FT_CTRL() FT_PRTSCR() FT_SHIFT() FT_ALT()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapigt.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
|
||||
@@ -25,38 +25,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWLSTAT()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Return the current Novell NetWare logical station number
|
||||
* $SYNTAX$
|
||||
* FT_NWLSTAT() -> nStatNum
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* A numeric corresponding to the current logical station number
|
||||
* assigned by NetWare.
|
||||
* $DESCRIPTION$
|
||||
* In order to find out information about a particular node logged
|
||||
* in to a NetWare server, you will need the logical
|
||||
* station number, also known as a "connection number." This
|
||||
* function will return that number. This will be a number from 1 to 100
|
||||
* under NetWare 286, or from 1 to 250 under NetWare 386. This is *not*
|
||||
* the same as a physical station number.
|
||||
*
|
||||
* This function requires FT_INT86().
|
||||
*
|
||||
* This function does NOT test for the existence of the NetWare shell.
|
||||
* The behavior is undefined if no shell is loaded.
|
||||
* $EXAMPLES$
|
||||
* QOut( "Logical station: " + str( FT_NWLSTAT() ) )
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
#define DOS 33
|
||||
|
||||
@@ -33,12 +33,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Semaphore Package for Novell NetWare
|
||||
// --------------------------------------------------------------
|
||||
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
#define INT21 33
|
||||
@@ -102,99 +100,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWSEMOPEN()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Open or create a NetWare semaphore
|
||||
* $SYNTAX$
|
||||
* FT_NWSEMOPEN( <cName>, <nInitVal>, <@nHandle>, <@nOpenCnt> ) -> nRc
|
||||
* $ARGUMENTS$
|
||||
* <cName> is the semaphore name, maximum length is 127 characters.
|
||||
*
|
||||
* <nInitVal> is the initial value for the semaphore. It must start
|
||||
* as a positive number, to a maximum of 127.
|
||||
*
|
||||
* <@nHandle> is the semaphore handle. THIS MUST BE PASSED BY
|
||||
* REFERENCE! On exit, <nHandle> will contain a numeric value that
|
||||
* refers to the opened semaphore. You will need it to pass to
|
||||
* other semaphore functions! PASS IT BY REFERENCE!
|
||||
*
|
||||
* <@nOpenCnt> is the number of stations that have opened the
|
||||
* semaphore. THIS MUST BE PASSED BY REFERENCE! On exit, <nOpenCnt>
|
||||
* will contain a numeric value.
|
||||
* $RETURNS$
|
||||
* nRc, a numeric result code, as follows:
|
||||
*
|
||||
* 0 - success
|
||||
* 254 - Invalid semaphore name length
|
||||
* 255 - Invalid semaphore value
|
||||
*
|
||||
* <nHandle> will contain the semaphore handle, and
|
||||
* <nOpenCnt> will contain the number of stations that have opened
|
||||
* the semaphore.
|
||||
* $DESCRIPTION$
|
||||
* A semaphore is simply a label that indirectly controls network
|
||||
* activity. There is a semaphore name, which can be up to 127
|
||||
* characters, and an associated value, which can range from 0 to
|
||||
* 127.
|
||||
*
|
||||
* A semaphore can be used for many things, but is most often used
|
||||
* to limit the number of users in an application, and to control
|
||||
* access to a network resource.
|
||||
*
|
||||
* A semaphore essentially allows you to place locks on resources
|
||||
* other than files.
|
||||
*
|
||||
* An application begins the process by calling FT_NWSEMOPEN().
|
||||
* If the semaphore doesn't exist, NetWare will create it.
|
||||
* FT_NWSEMOPEN() returns a handle that is used in other semaphore
|
||||
* calls.
|
||||
*
|
||||
* Applications use FT_NWSEMWAIT() to wait for a semaphore to
|
||||
* become available. FT_NWSEMWAIT() decrements the semaphore's
|
||||
* value by 1. If the value > 0, then the application should
|
||||
* be allowed to access the semaphore's resource. If the value
|
||||
* goes negative, then the application is placed in a queue.
|
||||
* How long your app is in the queue is determined by how you
|
||||
* set the timeout parameter. If you can't get the resource in
|
||||
* the time you allot, you're let out of the queue and the
|
||||
* value increments by 1 again.
|
||||
*
|
||||
* When an application finishes with a semaphore, it should
|
||||
* call FT_NWSEMSIG() to increment the value, and then
|
||||
* FT_NWSEMCLOSE() to close the semaphore. When the semaphore's
|
||||
* open count goes to 0, NetWare deletes it.
|
||||
*
|
||||
* FT_NWSEMEX() can be used to examine the value and open count
|
||||
* without affecting them.
|
||||
*
|
||||
* For an interesting discussion on the operating system aspects
|
||||
* of semaphores, check "Operating Systems Design and Implementation"
|
||||
* by A. Tanenbaum, page 60. For more details on NetWare's
|
||||
* semaphore facilities, refer to Charles Rose's "Programmer's
|
||||
* Guide to NetWare". The "Programmer's Guide" will make an
|
||||
* excellent companion guide to the source code for all NetWare
|
||||
* functions in the Nanforum Toolkit.
|
||||
* $EXAMPLES$
|
||||
* LOCAL nInitVal, nRc, nHandle, nOpenCnt
|
||||
*
|
||||
* nInitVal := 2
|
||||
* nRc := FT_NWSEMOPEN( "Semaphore Test", nInitVal, ;
|
||||
* @nHandle, @nOpenCnt )
|
||||
*
|
||||
* IF nRc != 0
|
||||
* QOUT =: "Error: " + STR( nRc ) )
|
||||
* QUIT
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_NWSEMEX() FT_NWSEMWAIT() FT_NWSEMSIG() FT_NWSEMCLOSE() FT_NWSEMLOCK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt )
|
||||
local aRegs[ INT86_MAX_REGS ], cRequest, nRet
|
||||
|
||||
@@ -203,7 +108,6 @@ function ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt )
|
||||
nHandle to 0, ;
|
||||
nOpenCnt to 0
|
||||
|
||||
|
||||
cName := iif( len( cName ) > 127, substr( cName, 1, 127 ), cName )
|
||||
cRequest := chr( len( cName ) ) + cName
|
||||
|
||||
@@ -221,63 +125,6 @@ function ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt )
|
||||
|
||||
return iif( nRet < 0, nRet + 256, nRet )
|
||||
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWSEMEX()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Examine a NetWare semaphore's value and open count
|
||||
* $SYNTAX$
|
||||
* FT_NWSEMEX( <nHandle>, <@nValue>, <@nOpenCnt> ) -> nRc
|
||||
* $ARGUMENTS$
|
||||
* <nHandle> is the semaphore handle, returned from a previous call
|
||||
* to FT_NWSEMOPEN().
|
||||
*
|
||||
* <@nValue> will get the current semaphore value. THIS NUMERIC
|
||||
* ARGUMENT MUST BE PASSED BY REFERENCE!
|
||||
*
|
||||
* <@nOpenCnt> will get the current number of workstations
|
||||
* that have opened the semaphore. THIS NUMERIC ARGUMENT MUST BE
|
||||
* PASSED BY REFERENCE!
|
||||
* $RETURNS$
|
||||
* nRc, a numeric, as follows:
|
||||
*
|
||||
* 0 - success
|
||||
* 255 - invalid semaphore handle
|
||||
*
|
||||
* In addition, nValue will be set to the semaphore's current value,
|
||||
* and nOpenCnt will be set to the number of stations that have
|
||||
* opened the semaphore.
|
||||
* $DESCRIPTION$
|
||||
* See the description for FT_NWSEMOPEN().
|
||||
* $EXAMPLES$
|
||||
* nInitVal := 2
|
||||
* nHandle := 0
|
||||
* nOpenCnt := 0
|
||||
*
|
||||
* FT_NWSEMOPEN( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt )
|
||||
*
|
||||
* nRc := FT_NWSEMWAIT( nHandle )
|
||||
* IF nRc == 254
|
||||
* QOUT( "All slots for this resource are currently in use" )
|
||||
* QUIT
|
||||
* ENDIF
|
||||
*
|
||||
* FT_NWSEMEX( nHandle, @nValue, @nOpenCnt )
|
||||
* QOUT( "Semaphore test -> Open at [" + ;
|
||||
* ALLTRIM(STR(nOpenCnt)) + ;
|
||||
* "] stations, value is [" + ;
|
||||
* ALLTRIM(STR(nValue)) + "]" )
|
||||
* $SEEALSO$
|
||||
* FT_NWSEMOPEN() FT_NWSEMWAIT() FT_NWSEMSIG() FT_NWSEMCLOSE() FT_NWSEMLOCK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
function ft_nwSemEx( nHandle, nValue, nOpenCnt )
|
||||
local aRegs[ INT86_MAX_REGS ], nRet
|
||||
|
||||
@@ -304,120 +151,15 @@ function ft_nwSemEx( nHandle, nValue, nOpenCnt )
|
||||
|
||||
return iif( nRet < 0, nRet + 256, nRet )
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWSEMWAIT()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Wait on a NetWare semaphore (decrement)
|
||||
* $SYNTAX$
|
||||
* FT_NWSEMWAIT( <nHandle> [, nTimeout ] ) -> nRc
|
||||
* $ARGUMENTS$
|
||||
* <nHandle> is the semaphore handle, returned from a previous call
|
||||
* to FT_NWSEMOPEN().
|
||||
*
|
||||
* <nTimeOut> is an optional parameter telling how long you wish to
|
||||
* wait on this semaphore. This is a numeric indicating the number
|
||||
* of clock ticks (approx 1/18 sec ) to wait. A zero (the default)
|
||||
* means "don't wait."
|
||||
* $RETURNS$
|
||||
* nRc, a numeric, as follows:
|
||||
*
|
||||
* 0 - success
|
||||
* 254 - timeout failure
|
||||
* 255 - invalid semaphore handle
|
||||
* $DESCRIPTION$
|
||||
* See the description for the FT_NWSEMOPEN() function.
|
||||
* $EXAMPLES$
|
||||
* FT_NWSEMOPEN( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt )
|
||||
*
|
||||
* nRc := FT_NWSEMWAIT( nHandle )
|
||||
* IF nRc == 254
|
||||
* QOUT( "All slots for this resource are currently in use" )
|
||||
* QUIT
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_NWSEMOPEN() FT_NWSEMEX() FT_NWSEMSIG() FT_NWSEMCLOSE() FT_NWSEMLOCK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function ft_nwSemWait( nHandle, nTimeout )
|
||||
return _ftnwsem( WAIT_SEMAPHORE, nHandle, nTimeout )
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWSEMSIG()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Signal a NetWare semaphore (increment)
|
||||
* $SYNTAX$
|
||||
* FT_NWSEMSIG( nHandle ) -> nRc
|
||||
* $ARGUMENTS$
|
||||
* <nHandle> is the semaphore handle, returned from a previous call
|
||||
* to FT_NWSEMOPEN().
|
||||
* $RETURNS$
|
||||
* nRc, a numeric, as follows
|
||||
*
|
||||
* 0 - success
|
||||
* 1 - semaphore overflow ( value > 127 )
|
||||
* 255 - invalid semaphore handle
|
||||
* $DESCRIPTION$
|
||||
* Use FT_NWSEMSIG() when your app has finished with the resource
|
||||
* locked by a semaphore. This will increase the value (thus
|
||||
* making a slot available to another app).
|
||||
*
|
||||
* For more information, see the description under FT_NWSEMOPEN().
|
||||
* $EXAMPLES$
|
||||
* QOUT( "Signal returns: " + STR( FT_NWSEMSIG( nHandle ) ) )
|
||||
* $SEEALSO$
|
||||
* FT_NWSEMOPEN() FT_NWSEMEX() FT_NWSEMWAIT() FT_NWSEMCLOSE() FT_NWSEMLOCK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
function ft_nwSemSig( nHandle )
|
||||
return _ftnwsem( SIGNAL_SEMAPHORE, nHandle )
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWSEMCLOSE()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Close a NetWare semaphore
|
||||
* $SYNTAX$
|
||||
* FT_NWSEMCLOSE( <nHandle> ) -> nRc
|
||||
* $ARGUMENTS$
|
||||
* <nHandle> is the semaphore handle, returned from a previous call
|
||||
* to FT_NWSEMOPEN().
|
||||
* $RETURNS$
|
||||
* nRc, a numeric, as follows:
|
||||
*
|
||||
* 0 - success
|
||||
* 255 - invalid semaphore handle
|
||||
* $DESCRIPTION$
|
||||
* Call FT_NWSEMCLOSE() when the app is finished. This decrements
|
||||
* the open count for the semaphore. If the open count hits zero,
|
||||
* the semaphore is deleted by NetWare.
|
||||
* $EXAMPLES$
|
||||
* QOUT( "Close returns: " + STR( FT_NWSEMCLOSE( nHandle ) ) )
|
||||
* $SEEALSO$
|
||||
* FT_NWSEMOPEN() FT_NWSEMEX() FT_NWSEMWAIT() FT_NWSEMSIG() FT_NWSEMLOCK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
function ft_nwSemClose( nHandle )
|
||||
return _ftnwsem( CLOSE_SEMAPHORE, nHandle )
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// _ftnwsem() - internal for the semaphore package
|
||||
// ---------------------------------------------------------
|
||||
@@ -435,81 +177,12 @@ static function _ftnwsem( nOp, nHandle, nTimeout )
|
||||
aRegs[ DX ] := bin2i( substr( l2bin( nHandle ), 3, 2 ) )
|
||||
aRegs[ BP ] := nTimeout
|
||||
|
||||
|
||||
ft_int86( INT21, aRegs )
|
||||
nRet := lowbyte( aRegs[AX] )
|
||||
nRet := iif( nRet < 0, nRet + 256, nRet )
|
||||
|
||||
return nRet
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWSEMLOCK()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Perform a semaphore "lock"
|
||||
* $SYNTAX$
|
||||
* FT_NWSEMLOCK ( <cSemaphore>, <@nHandle> ) -> lRet
|
||||
* $ARGUMENTS$
|
||||
* <cSemaphore> is the name of a semaphore you want to "lock."
|
||||
* <nHandle> is the semaphore's handle, if you get the lock.
|
||||
* THIS MUST BE PASSED BY REFERENCE!
|
||||
* $RETURNS$
|
||||
* lRet == .t. if you get the lock, .f. if you don't.
|
||||
* If the lock succeeds, <nHandle> will contain the semaphore
|
||||
* handle. If it fails, the value of <nHandle> is undefined.
|
||||
*
|
||||
* $DESCRIPTION$
|
||||
* FT_NWSEMLOCK() uses the Nanforum Toolkit's NetWare Semaphore API
|
||||
* functions in order to provide a general purpose "lock" you can use in
|
||||
* a NetWare environment.
|
||||
*
|
||||
* An interesting byproduct of NetWare's semaphore functions is
|
||||
* the "open count" which tells you how many connections have this
|
||||
* semaphore open. This is different from the semaphore's _value_,
|
||||
* which is set when the semaphore is opened and changed with
|
||||
* signal() and wait().
|
||||
*
|
||||
* The point of semaphores is that you don't care how many users
|
||||
* are using the resource; you merely wait on a semaphore until
|
||||
* the resource becomes available or you give up. When you're done,
|
||||
* you signal it and off you go.
|
||||
*
|
||||
* Back to the open count. FT_NWSEMLOCK() opens the semaphore
|
||||
* as named in <cSemaphore>. After it is opened, the open count
|
||||
* is checked. If it is anything other than 1, that means someone
|
||||
* else has it (or you failed in your open) so the semaphore is
|
||||
* closed and the "lock" is refused. If the value is 1, then your
|
||||
* app is that 1 station so the "lock" is granted.
|
||||
*
|
||||
* You can use a semaphore lock to control access to anything
|
||||
* that Clipper's RLOCK() and FLOCK() can't help you with, such
|
||||
* as text files written with the low level file i/o functions,
|
||||
* etc.
|
||||
* $EXAMPLES$
|
||||
* LOCAL nHandle := 0
|
||||
* IF FT_NWSEMLOCK( "k:\apps\error.log", @nHandle )
|
||||
* // Note, you aren't actually LOCKING this file, you are
|
||||
* // just locking a semaphore by the same name. As long as
|
||||
* // all apps that might be using this file are cooperating
|
||||
* // with the same kind of semaphore lock, you can effectively
|
||||
* // control access to the file.
|
||||
* ELSE
|
||||
* QOUT("Couldn't lock file.")
|
||||
* ENDIF
|
||||
* * Processing, then:
|
||||
* FT_NWSEMUNLOCK( nHandle )
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_NWSEMOPEN() FT_NWSEMEX() FT_NWSEMWAIT() FT_NWSEMSIG() FT_NWSEMUNLOCK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function ft_nwSemLock( cSemaphore, nHandle )
|
||||
local nRc
|
||||
local nOpenCnt := 0
|
||||
@@ -524,48 +197,5 @@ function ft_nwSemLock( cSemaphore, nHandle )
|
||||
|
||||
return ( nOpenCnt == 1 )
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWSEMUNLOCK()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* "Unlock" a semaphore locked by FT_NWSEMLOCK()
|
||||
* $SYNTAX$
|
||||
* FT_NWSEMUNLOCK( <nHandle> ) -> lRet
|
||||
* $ARGUMENTS$
|
||||
* <nHandle> is the semaphore handle returned from FT_NWSEMLOCK()
|
||||
* $RETURNS$
|
||||
* lRet == .t. if you successfully unlock the semaphore, .f. if
|
||||
* you don't. If this call fails, it could be that you're passing
|
||||
* an invalid semaphore handle.
|
||||
* $DESCRIPTION$
|
||||
*
|
||||
* This call unlocks a semaphore prevsiously locked via FT_NWSEMLOCK().
|
||||
* It is important that you get a valid semaphore handle from
|
||||
* FT_NWSEMLOCK() before you use this call. Make sure when you call
|
||||
* FT_NWSEMLOCK() that you pass a numeric parameter in for the handle
|
||||
* BY REFERENCE.
|
||||
* $EXAMPLES$
|
||||
* LOCAL nHandle := 0
|
||||
* IF FT_NWSEMLOCK( "k:\apps\error.log", @nHandle )
|
||||
* // Note, you aren't actually LOCKING this file, you are
|
||||
* // just locking a semaphore by the same name. As long as
|
||||
* // all apps that might be using this file are cooperating
|
||||
* // with the same kind of semaphore lock, you can effectively
|
||||
* // control access to the file.
|
||||
* ELSE
|
||||
* QOUT("Couldn't lock file.")
|
||||
* ENDIF
|
||||
* * Processing, then:
|
||||
* FT_NWSEMUNLOCK( nHandle )
|
||||
*
|
||||
* $SEEALSO$
|
||||
* FT_NWSEMOPEN() FT_NWSEMEX() FT_NWSEMWAIT() FT_NWSEMSIG() FT_NWSEMLOCK()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
function ft_nwSemUnLock( nHandle )
|
||||
return ( ft_nwSemClose( nHandle ) == 0 )
|
||||
|
||||
@@ -32,51 +32,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_NWUID()
|
||||
* $CATEGORY$
|
||||
* NetWare
|
||||
* $ONELINER$
|
||||
* Return the current Novell NetWare User ID
|
||||
* $SYNTAX$
|
||||
* FT_NWUID( [ <nConnection> ] ) -> cUid
|
||||
* $ARGUMENTS$
|
||||
* <nConnection> is a connection number, or logical station number,
|
||||
* to find a userid for. Under NetWare 286, this number can be from
|
||||
* 1 to 100. Under NetWare 386, 1-250. If not supplied, FT_NWUID()
|
||||
* defaults to the current connection (i.e., the connection running
|
||||
* the application).
|
||||
* $RETURNS$
|
||||
* A string containing the userid, or "login name."
|
||||
* The maximum length of this string, as defined by current
|
||||
* versions of Novell NetWare, is 48 characters.
|
||||
* $DESCRIPTION$
|
||||
* FT_NWUID() returns the current NetWare userid, or "login
|
||||
* name." This is useful for implementing security or audit
|
||||
* trail procedures within your programs.
|
||||
*
|
||||
* There is no simple way a user can "fool" this function into
|
||||
* retrieving an incorrect value, provided a NetWare shell is loaded.
|
||||
*
|
||||
* This function requires FT_INT86() and FT_NWLSTAT()
|
||||
*
|
||||
* This function does NOT test for the existence of the NetWare shell.
|
||||
* The behavior is undefined if no shell is loaded. You'll usually get
|
||||
* garbage. This function has not been tested on NetWare 386.
|
||||
* $EXAMPLES$
|
||||
* QOut( "I am: " + FT_NWUID() )
|
||||
*
|
||||
* FOR x := 1 TO 100
|
||||
* cUid := FT_NWUID( x )
|
||||
* IF .NOT Empty( cUid )
|
||||
* QOut( Str( x, 3 ) + Space(3) + cUid )
|
||||
* ENDIF
|
||||
* NEXT
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
#define DOS 33
|
||||
|
||||
@@ -17,53 +17,6 @@
|
||||
* Initial release
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_OnTick()
|
||||
* $CATEGORY$
|
||||
* Event
|
||||
* $ONELINER$
|
||||
* Evaluate a designated code block at a designated interval.
|
||||
* $SYNTAX$
|
||||
* FT_OnTick( bCode, nInterval )
|
||||
* $ARGUMENTS$
|
||||
* <bCode> is the code block to evaluate.
|
||||
* <nInterval> is the number of clock ticks to wait between
|
||||
* evaluations of the code block.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* This function effectively allows you to run tasks in the background
|
||||
* by transparently and periodically calling a designated routine.
|
||||
*
|
||||
* To halt the execution of the background function, call FT_OnTick()
|
||||
* with no arguments.
|
||||
*
|
||||
* This function makes heavy use of several undocumented internal
|
||||
* routines. If this fact makes you uncomfortable then don't use
|
||||
* this function, you quivering sack of cowardly slime.
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* // Set up a self-updating on-screen clock
|
||||
*
|
||||
* FT_OnTick( "CLOCK", 9 )
|
||||
*
|
||||
* procedure Clock
|
||||
*
|
||||
* local nRow := Row()
|
||||
* local nCol := Col()
|
||||
*
|
||||
* @ 0, 0 say Time()
|
||||
*
|
||||
* SetPos( nRow, nCol )
|
||||
*
|
||||
* return
|
||||
*
|
||||
* $SEEALSO$
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
@@ -123,7 +76,6 @@ static void cdecl TickTock( void )
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CLIPPER FT_OnTick( void )
|
||||
{
|
||||
if ( hb_itemType( codeBlock ) == BLOCK ) hb_itemRelease( codeBlock );
|
||||
|
||||
@@ -22,42 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_ORIGIN()
|
||||
* $CATEGORY$
|
||||
* Environment
|
||||
* $ONELINER$
|
||||
* Report the drive, path and filename of the current program
|
||||
* $SYNTAX$
|
||||
* FT_ORIGIN() -> cString
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* A string containing the full drive/directory/filename of
|
||||
* the currently executing file.
|
||||
* $DESCRIPTION$
|
||||
* Often users will install multiple copies of application software,
|
||||
* especially on networks and in situations where the user is trying
|
||||
* to get around a copy protection scheme.
|
||||
*
|
||||
* This function enables you to learn the name and source location
|
||||
* of the currently executing file, so that you may take whatever
|
||||
* action you need to.
|
||||
*
|
||||
* Requires DOS v3.xx and above.
|
||||
* $EXAMPLES$
|
||||
* cMyFile := FT_ORIGIN()
|
||||
*
|
||||
* IF cMyFile != "C:\appdir\myfile.exe"
|
||||
* ?"Incorrect startup file. Please remove/rename and start again"
|
||||
* QUIT
|
||||
* ENDIF
|
||||
* $SEEALSO$
|
||||
* FT_WHEREIS() FT_TREE()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
HB_FUNC( FT_ORIGIN )
|
||||
|
||||
@@ -31,35 +31,6 @@
|
||||
|
||||
#define VIDEO 16
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_SETVPG()
|
||||
* $CATEGORY$
|
||||
* Video
|
||||
* $ONELINER$
|
||||
* Set the current video page
|
||||
* $SYNTAX$
|
||||
* FT_SETVPG( <nPage> ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <nMode> is a valid video page.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* Selects the video page.
|
||||
*
|
||||
* For more information on graphics programming and video pages,
|
||||
* consult a reference such as "Programmer's Guide to PC and PS/2
|
||||
* Video Systems" (Microsoft Press).
|
||||
* $EXAMPLES$
|
||||
* // The following sets the current video page to 1
|
||||
*
|
||||
* FT_SETVPG( 1 )
|
||||
* $SEEALSO$
|
||||
* FT_GETVPG()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
FUNCTION FT_SETVPG( nPage )
|
||||
/*
|
||||
LOCAL aRegs[ INT86_MAX_REGS ]
|
||||
@@ -71,37 +42,6 @@ FUNCTION FT_SETVPG( nPage )
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_GETVPG()
|
||||
* $CATEGORY$
|
||||
* Video
|
||||
* $ONELINER$
|
||||
* Get the currently selected video page
|
||||
* $SYNTAX$
|
||||
* FT_GETVPG() -> <nPage>
|
||||
* $ARGUMENTS$
|
||||
* None.
|
||||
* $RETURNS$
|
||||
* The video page, as a numeric.
|
||||
* $DESCRIPTION$
|
||||
* Get the currently selected video page
|
||||
*
|
||||
* For more information on graphics programming and video pages,
|
||||
* consult a reference such as _Programmer's Guide to PC and PS/2
|
||||
* Video Systems_ (Microsoft Press).
|
||||
*
|
||||
* $EXAMPLES$
|
||||
* nPage := FT_GETVPG()
|
||||
* $SEEALSO$
|
||||
* FT_SETVPG()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
FUNCTION FT_GETVPG()
|
||||
/*
|
||||
LOCAL aRegs[ INT86_MAX_REGS ]
|
||||
|
||||
@@ -24,97 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_PCHR()
|
||||
* $CATEGORY$
|
||||
* String
|
||||
* $ONELINER$
|
||||
* Convert printer control codes
|
||||
* $SYNTAX$
|
||||
* FT_PCHR( <cString> ) -> <cPrinterFormat>
|
||||
* $ARGUMENTS$
|
||||
* <cString> is the representation of the printer control codes in
|
||||
* text, numeric, hexadecimal, Epson command format, or any combination
|
||||
* separated by commas.
|
||||
* $RETURNS$
|
||||
* A character string of printer control codes.
|
||||
* $DESCRIPTION$
|
||||
* This function is useful for allowing the user to enter printer
|
||||
* control codes in text (enclosed in double quotes), numeric,
|
||||
* hexadecimal, or Epson commands preceded by a slash and returns
|
||||
* the printer control code equivalent.
|
||||
*
|
||||
* NOTES"
|
||||
*
|
||||
* - Combinations of text, numbers, hex, and commands must be
|
||||
* separated by commas ("A",27,&1B,/RESET).
|
||||
* - Text must be enclosed in double quotes ("x").
|
||||
* - Hexadecimal must be preceded by an ampersand (&1B).
|
||||
* - Epson commands, listed below, must be preceded by a forward
|
||||
* slash (/RESET).
|
||||
*
|
||||
* Epson commands: (slash commands are specific to the Epson)
|
||||
*
|
||||
* Job Control:
|
||||
*
|
||||
* /RESET or /INIT Reset or initialize the printer
|
||||
* /BELL or /BEEP Cause the printer's speaker to beep (not HS)
|
||||
* /CAN Clear print buffers (not MX)
|
||||
* /SLOW Set low speed mode (not CR, HS, MX)
|
||||
* /FAST Cancel low speed mode (not CR, HS, MX)
|
||||
* /ONE Select Unidirectional mode
|
||||
* /TWO Select Directional mode
|
||||
* /ON Activate printer
|
||||
* /OFF Turn off printer
|
||||
*
|
||||
* /FF or /EJECT Form Feed
|
||||
*
|
||||
* Page Control:
|
||||
*
|
||||
* /1/6 Set 6 lines per inch
|
||||
* /1/8 Set 8 lines per inch
|
||||
* /SKIP Set Skip perforation ON
|
||||
* /SKIPOFF Set Skip perforation OFF
|
||||
*
|
||||
* Font Selection and Manipulation:
|
||||
*
|
||||
* /ITALIC Select italic char. set (only FX86, EX, LX,
|
||||
* no LQ-1500, SX)
|
||||
* /GRAPHIC Select graphic char. set (only FX86, EX, LX,
|
||||
* no LQ-1500, SX)
|
||||
* /ROMAN Choose Roman font
|
||||
* /SANS Choose Sans Serif font
|
||||
* /DRAFT Choose draft
|
||||
* /NLQ Choose near letter quality
|
||||
* /PICA Choose 10 chars per inch
|
||||
* /ELITE Choose 12 chars per inch
|
||||
* /COND or /SI Choose 15 chars per inch
|
||||
* /EMPH Turn emphasize on
|
||||
* /EMPHOFF Turn emphasize off
|
||||
* /SPANISH Select spanish international char set
|
||||
* /USA Select USA international char set
|
||||
*
|
||||
* $EXAMPLES$
|
||||
* cSetUp := '27,116,1'
|
||||
* Set Print ON
|
||||
* ? FT_PCHR( cSetUp ) -> (CHR(27)+CHR(116)+CHR(1))
|
||||
* <select Epson char. graphics>
|
||||
*
|
||||
* ? FT_PCHR( '27,"x",0' ) -> (CHR(27)+CHR(120)+CHR(0))
|
||||
* <Epson draft mode>
|
||||
*
|
||||
* ? FT_PCHR( '&1B,"E"' ) -> (CHR(27)+CHR(69)) <HP reset>
|
||||
*
|
||||
* ? FT_PCHR( '/ELITE,/NLQ' ) ->(CHR(27)+CHR(77)+CHR(27)+CHR(120)+CHR(1))
|
||||
* <Epson elite & near letter quality>
|
||||
* $SEEALSO$
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
Function FT_PCHR(c_nums)
|
||||
Local c_ret:='', c_st:=0,c_part,c_st2,c_hex:="0123456789ABCDEF"
|
||||
Local c_upper,c_t1,c_t2
|
||||
|
||||
@@ -28,37 +28,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_PEEK()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Retrieve a byte from a specified memory location.
|
||||
* $SYNTAX$
|
||||
* FT_PEEK( <nSegment>, <nOffset> ) -> nValue
|
||||
* $ARGUMENTS$
|
||||
* <nSegment> is the segment of the desired memory address.
|
||||
*
|
||||
* <nOffset> is the offset of the desired memory address.
|
||||
* $RETURNS$
|
||||
* <nValue> will be a value from 0 to 255 if all parameters were valid and
|
||||
* the function was able to retrieve the desired byte.
|
||||
* <nValue> will be -1 if invalid parameters were passed.
|
||||
* $DESCRIPTION$
|
||||
* Use this function if you have a need to examine a specific memory
|
||||
* location. The function will return the byte at the specified
|
||||
* address as a numeric value. If you need this value as a character,
|
||||
* use the Chr() function to convert it.
|
||||
*
|
||||
* This function was written for version 5.1 of MicroSoft C. You may
|
||||
* have to modify the source code to use another compiler.
|
||||
* $EXAMPLES$
|
||||
* local nVMode := FT_PEEK( 0, 1097 ) // Get the current video mode
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
#include "cpmi.h"
|
||||
|
||||
@@ -29,28 +29,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_PEGS()
|
||||
* $CATEGORY$
|
||||
* Game
|
||||
* $ONELINER$
|
||||
* FT_PEGS GAME (all work and no play...)
|
||||
* $SYNTAX$
|
||||
* FT_PEGS() -> NIL
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* This function can be used to alleviate boredom. The object is to
|
||||
* remove all pegs except one. This is done by jumping over adjacent
|
||||
* pegs.
|
||||
* $EXAMPLES$
|
||||
* FT_PEGS()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "inkey.ch"
|
||||
#include "common.ch"
|
||||
#include "setcurs.ch"
|
||||
@@ -180,7 +158,6 @@ return NIL
|
||||
* end function FT_PEGS()
|
||||
*--------------------------------------------------------------------*
|
||||
|
||||
|
||||
static function DrawBox(nelement)
|
||||
setcolor(iif(board_[nelement][4], '+w/rb', 'w/n'))
|
||||
@ board_[nelement][1,1], board_[nelement][1,2], board_[nelement][1,3], ;
|
||||
@@ -192,7 +169,6 @@ return NIL
|
||||
* end static function DrawBox()
|
||||
*--------------------------------------------------------------------*
|
||||
|
||||
|
||||
static function err_msg(msg)
|
||||
local buffer := savescreen(23, 33, 23, 47)
|
||||
setcursor(SC_NONE)
|
||||
@@ -206,7 +182,6 @@ return nil
|
||||
* end static function Err_Msg()
|
||||
*--------------------------------------------------------------------*
|
||||
|
||||
|
||||
static function moremoves()
|
||||
local xx, yy, canmove := .f., piecesleft := 0, buffer
|
||||
for xx := 1 to 33
|
||||
|
||||
@@ -21,57 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_PENDING()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Display same-line pending messages after a wait.
|
||||
* $SYNTAX$
|
||||
* FT_PENDING ( <cMsg>, [ <nRow> ], [ <nCol> ], ;
|
||||
* [ <nWait> ], [ <cColor> ] ) -> NIL
|
||||
* $ARGUMENTS$
|
||||
* <cMsg> is the message string to display.
|
||||
*
|
||||
* <nRow> is an optional screen row for message display, default row 24.
|
||||
*
|
||||
* <nCol> is an optional screen col for message display, default col 0.
|
||||
*
|
||||
* <nWait> is an optional wait (sec) between messages, default 5 sec.
|
||||
*
|
||||
* <cColor> is an optional color string for displayed messages, default
|
||||
* is white text over red background.
|
||||
* $RETURNS$
|
||||
* NIL
|
||||
* $DESCRIPTION$
|
||||
* A good way to display information messages during the running
|
||||
* of an application is to send them all to the SAME line on the
|
||||
* screen where users are expected to look for them. In order to
|
||||
* give users a chance to read the current message before the next one
|
||||
* is displayed we may need to insert a delay after each message.
|
||||
*
|
||||
* FT_PENDING() function displays messages by keeping track of
|
||||
* the time of the last message and providing a delay ONLY if the next
|
||||
* pending message is issued much too soon after the current one.
|
||||
*
|
||||
* $EXAMPLES$
|
||||
* FT_PENDING("Message one",20,0,3,"W+/G") // Displays "Message one."
|
||||
* // sets row to 20, col to 0.
|
||||
* // wait to 3 and color to
|
||||
* // bright white over green.
|
||||
* FT_PENDING("Message two") // Displays "Message two", after 5 sec.
|
||||
* FT_PENDING("Message three") // Displays "Message three", after 5 sec.
|
||||
*
|
||||
*
|
||||
* Note that default row, col, wait time and color need to be set only
|
||||
* once in the very first call to FT_PENDING() and only if the internal
|
||||
* default values are not appropriate.
|
||||
*
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
FUNCTION MAIN()
|
||||
@0,0 CLEAR
|
||||
|
||||
@@ -24,26 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_PICKDAY()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Picklist of days of week
|
||||
* $SYNTAX$
|
||||
* FT_PICKDAY() -> cDayOfWeek
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* Character string containing day of week
|
||||
* $DESCRIPTION$
|
||||
* This function is ideal if you need the user to select a day.
|
||||
* $EXAMPLES$
|
||||
* mday := FT_PICKDAY()
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "box.ch"
|
||||
|
||||
// test code
|
||||
@@ -55,7 +35,6 @@ return nil
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
function FT_PICKDAY
|
||||
LOCAL DAYS := { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", ;
|
||||
"FRIDAY", "SATURDAY" }, SEL := 0
|
||||
|
||||
@@ -28,40 +28,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_POKE()
|
||||
* $CATEGORY$
|
||||
* DOS/BIOS
|
||||
* $ONELINER$
|
||||
* Write a byte to a specified memory location
|
||||
* $SYNTAX$
|
||||
* FT_POKE( <nSegment>, <nOffset>, <nValue> ) -> lResult
|
||||
* $ARGUMENTS$
|
||||
* <nSegment> is the segment of the desired memory address.
|
||||
*
|
||||
* <nOffset> is the offset of the desired memory address.
|
||||
*
|
||||
* <nValue> is the value to write to the desired memory address.
|
||||
* $RETURNS$
|
||||
* <lResult> will be .T. if all parameters were valid and the function was
|
||||
* able to write the desired byte.
|
||||
* <lResult> will be .F. if invalid parameters were passed.
|
||||
* $DESCRIPTION$
|
||||
* Use this function if you have a need to change the value at a specific
|
||||
* memory location. The function will write the specified byte to the
|
||||
* specified address. The value must be passed as a numeric; if the byte
|
||||
* you wish to use is stored as a character, use the Asc() function
|
||||
* to convert it.
|
||||
*
|
||||
* This function was written for version 5.1 of MicroSoft C. You may
|
||||
* have to modify the source code to use another compiler.
|
||||
* $EXAMPLES$
|
||||
* FT_POKE( 0, 1047, 64) // Turn CapsLock on
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
#include "cpmi.h"
|
||||
|
||||
@@ -31,86 +31,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* FT_Adder()
|
||||
* $CATEGORY$
|
||||
* Menus/Prompts
|
||||
* $ONELINER$
|
||||
* Pop up a simple calculator
|
||||
* $SYNTAX$
|
||||
* FT_Adder()
|
||||
* $ARGUMENTS$
|
||||
* None
|
||||
* $RETURNS$
|
||||
* NIL .... but optionally places Total of calculation in active
|
||||
* Get variable using oGet:VARPUT()
|
||||
* $DESCRIPTION$
|
||||
* PopAdder() gives you an adding machine inside your Clipper 5.2
|
||||
* application. It has the basic functions add, subtract, multiply,
|
||||
* and divide. You may move it from one side of the screen to the
|
||||
* other. It even displays a scrollable tape, if you want it.
|
||||
*
|
||||
*
|
||||
* There are a few HOT Keys while using the Adder:
|
||||
*
|
||||
* <D>ecimals - change # of decimals
|
||||
* <M>ove - the Adder from right display to left
|
||||
* <T>ape - turn the Tape Display On or Off
|
||||
* <S>croll - the tape display
|
||||
* <DEL> ---+-- 1st Clear entry
|
||||
* +-- 2nd Clear ADDER
|
||||
* <ESC> - Quit
|
||||
* <F10> - return a <TOTAL> to the active get
|
||||
*
|
||||
*
|
||||
* A couple of notes about the adder:
|
||||
*
|
||||
*
|
||||
* 1.) It was designed to be used on an Enhanced keyboard with
|
||||
* separate <DELETE> key. <DELETE> is used to clear the adder.
|
||||
* However, it will still work on a Standard keyboard.
|
||||
*
|
||||
* 2.) You do not have to display the tape. You may turn it on
|
||||
* at any time by pressing <T>. You may SCROLL back through
|
||||
* the tape once there are more than 16 entries in the
|
||||
* adder, by pressing <S>.
|
||||
*
|
||||
* 3.) To Quit the Adder just press <ESC>. To return your Total
|
||||
* to the application press <F10>. The adder will place the
|
||||
* Total in the active GET variable using oGet:VarPut(). The
|
||||
* adder will only return a Total to a numerical GET!
|
||||
*
|
||||
* 4.) There are many support functions that you might find
|
||||
* interesting. They are part of my personal library, but
|
||||
* are necessary to the operation of the adder.
|
||||
* You might want to pull these out to reduce the overall
|
||||
* size of the adder. Many are worth at least a little
|
||||
* time studying.
|
||||
*
|
||||
* 5.) To make FT_Adder a Hot key from inside your application
|
||||
* at the beginning of your application add the line:
|
||||
*
|
||||
* SET KEY K_ALT_A TO FT_Adder
|
||||
*
|
||||
* This will make <ALT-A> a key "Hot" and permit you to
|
||||
* Pop - Up the adder from anywhere in the application.
|
||||
*
|
||||
* 6.) If you use FT_INKEY(), you can even have active hotkeys
|
||||
* in an INKEY().
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* $EXAMPLES$
|
||||
*
|
||||
* $SEEALSO$
|
||||
*
|
||||
* $INCLUDE$
|
||||
* inkey.ch, setcurs.ch, achoice.ch
|
||||
* $END$
|
||||
*/
|
||||
|
||||
#include "inkey.ch"
|
||||
#include "setcurs.ch"
|
||||
#include "achoice.ch"
|
||||
@@ -171,7 +91,6 @@
|
||||
END ;;
|
||||
END
|
||||
|
||||
|
||||
// Instead of using STATIC variables for these I'm using a LOCAL array
|
||||
// and passing aAdder[] all over the place.... Don't let this confuse
|
||||
// you. I wrote the Adder using the variable names & now let the
|
||||
@@ -200,7 +119,6 @@
|
||||
#define nTapeSpace aAdder[22]
|
||||
#define cTapeScr aAdder[23]
|
||||
|
||||
|
||||
// I still use a few of STATICS, but most are set to NIL when quiting...
|
||||
STATIC lAdderOpen := .F., ;
|
||||
aKeys, aWindow, nWinColor, aWinColor, aStdColor
|
||||
@@ -248,8 +166,6 @@ STATIC lAdderOpen := .F., ;
|
||||
RETURN NIL
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: FT_Adder() Docs: Keith A. Wire |
|
||||
| Description: Pop Up Adder / Calculator with Tape Display |
|
||||
@@ -435,8 +351,6 @@ aKeys := aWindow := aWinColor := aStdColor := NIL
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftAddScreen() Docs: Keith A. Wire |
|
||||
| Description: Display the Adder |
|
||||
@@ -495,8 +409,6 @@ STATIC FUNCTION _ftAddScreen(aAdder)
|
||||
@ 3+nTopOS, 6+nAddSpace, 5+nTopOS, 27+nAddSpace BOX B_DOUBLE
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftChangeDec() Docs: Keith A. Wire |
|
||||
| Description: Change the decimal position in the display |
|
||||
@@ -537,8 +449,6 @@ STATIC FUNCTION _ftChangeDec(aAdder, nNumDec)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftDispTotal() Docs: Keith A. Wire |
|
||||
| Description: Display total number to Adder Window |
|
||||
@@ -572,9 +482,6 @@ STATIC FUNCTION _ftDispTotal(aAdder)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftDispSubTot() Docs: Keith A. Wire |
|
||||
| Description: Display subtotal number |
|
||||
@@ -607,8 +514,6 @@ STATIC FUNCTION _ftDispSubTot(aAdder)
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftProcessNumb() Docs: Keith A. Wire |
|
||||
| Description: Act on NUMBER key pressed |
|
||||
@@ -652,10 +557,6 @@ STATIC FUNCTION _ftProcessNumb(aAdder, nKey)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftAddTotal() Docs: Keith A. Wire |
|
||||
| Description: Enter key - SUBTOTAL\TOTAL |
|
||||
@@ -739,9 +640,6 @@ STATIC FUNCTION _ftAddTotal(aAdder)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftAddSub() Docs: Keith A. Wire |
|
||||
| Description: Process + or - keypress |
|
||||
@@ -795,10 +693,6 @@ STATIC FUNCTION _ftAddSub(aAdder, nKey)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftMultDiv() Docs: Keith A. Wire |
|
||||
| Description: Process * or / keypress |
|
||||
@@ -857,9 +751,6 @@ STATIC FUNCTION _ftMultDiv(aAdder, nKey)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftAddHelp Docs: Keith A. Wire |
|
||||
| Description: Help window |
|
||||
@@ -895,12 +786,8 @@ STATIC FUNCTION _ftAddHelp
|
||||
_ftPushMessage(cMess, .T., "ADDER HELP", "press any key to continue...", ;
|
||||
"QUIET")
|
||||
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftClearAdder() Docs: Keith A. Wire |
|
||||
| Description: Clear entry / Clear Adder |
|
||||
@@ -931,9 +818,6 @@ STATIC FUNCTION _ftClearAdder(aAdder)
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftUpdateTrans() Docs: Keith A. Wire |
|
||||
| Description: Update transactions array |
|
||||
@@ -981,9 +865,6 @@ STATIC FUNCTION _ftUpdateTrans(aAdder, lTypeTotal, nAmount)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftEraseTotSubTot() Docs: Keith A. Wire |
|
||||
| Description: Clear the <TOTAL> & <SUBTOTAL> from Adder |
|
||||
@@ -1002,8 +883,6 @@ STATIC FUNCTION _ftEraseTotSubTot(aAdder)
|
||||
_ftSetWinColor(W_CURR,W_PROMPT)
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftRoundIt() Docs: Keith A. Wire |
|
||||
| Description: Adder Rounding function |
|
||||
@@ -1023,9 +902,6 @@ STATIC FUNCTION _ftRoundIt(nNumber, nPlaces)
|
||||
RETURN IIF(nNumber < 0.0, -1.0, 1.0) * ;
|
||||
INT( ABS(nNumber) * 10 ^ nPlaces + 0.50 + 10 ^ -12 ) / 10 ^ nPlaces
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftDivide() Docs: Keith A. Wire |
|
||||
| Description: Check divide by zero not allowed |
|
||||
@@ -1049,8 +925,6 @@ STATIC FUNCTION _ftDivide(aAdder, nNumerator,nDenominator)
|
||||
ENDIF
|
||||
RETURN(nNumerator/nDenominator)
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftValDeci() Docs: Keith A. Wire |
|
||||
| Description: Validate the number of decimals |
|
||||
@@ -1074,8 +948,6 @@ STATIC FUNCTION _ftValDeci(oGet)
|
||||
|
||||
RETURN lRtnValue
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftDisplayTape() Docs: Keith A. Wire |
|
||||
| Description: Display the Tape |
|
||||
@@ -1124,9 +996,6 @@ STATIC FUNCTION _ftDisplayTape(aAdder, nKey)
|
||||
_ftSetWinColor(W_CURR,W_PROMPT)
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftSetLastKey() Docs: Keith A. Wire |
|
||||
| Description: Sets the LASTKEY() value to value of nLastKey |
|
||||
@@ -1148,10 +1017,6 @@ STATIC FUNCTION _ftSetLastKey(nLastKey)
|
||||
_ftPopKeys()
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPushKeys Docs: Keith A. Wire |
|
||||
| Description: Push any keys in the Keyboard buffer on the array aKeys[] |
|
||||
@@ -1171,10 +1036,6 @@ STATIC FUNCTION _ftPushKeys
|
||||
ENDDO
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPopKeys Docs: Keith A. Wire |
|
||||
| Description: Restore the keyboard with any keystrokes that were saved |
|
||||
@@ -1197,7 +1058,6 @@ STATIC FUNCTION _ftPopKeys
|
||||
aKeys := {}
|
||||
RETURN NIL
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPushMessage() Docs: Keith A. Wire |
|
||||
| Description: Display a message on the screen in a window |
|
||||
@@ -1259,8 +1119,6 @@ STATIC FUNCTION _ftPushMessage(cMessage,lWait,cTitle,cBotTitle,xQuiet, nTop)
|
||||
_ftSetLastKey(nOldLastKey)
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPopMessage Docs: Keith A. Wire |
|
||||
| Description: Pop off the Message Box |
|
||||
@@ -1278,9 +1136,6 @@ STATIC FUNCTION _ftPopMessage
|
||||
_ftPopWin()
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftQuest() Docs: Keith A. Wire |
|
||||
| Description: Push a Question Box on the Screen |
|
||||
@@ -1384,9 +1239,6 @@ STATIC FUNCTION _ftQuest(cMessage,xVarVal,cPict,bValid,lNoESC,nWinColor,nTop)
|
||||
_ftSetLastKey(nOldLastKey)
|
||||
RETURN xVarVal
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftAdderTapeUDF() Docs: Keith A. Wire |
|
||||
| Description: User function for ACHOICE() when scrolling tape |
|
||||
@@ -1429,9 +1281,6 @@ FUNCTION _ftAdderTapeUDF(mode,cur_elem,rel_pos)
|
||||
ENDCASE
|
||||
RETURN nRtnVal
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftError() Docs: Keith A. Wire |
|
||||
| Description: Display an ERROR message in a window |
|
||||
@@ -1490,9 +1339,6 @@ STATIC FUNCTION _ftError(cMessage, xDontReset)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftStuffComma() Docs: Keith A. Wire |
|
||||
| Description: Stuff a Comma in a string |
|
||||
@@ -1540,10 +1386,6 @@ STATIC FUNCTION _ftStuffComma(cStrToStuff,lTrimStuffedStr)
|
||||
|
||||
RETURN cStrToStuff
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftSetSCRColor() Docs: Keith A. Wire |
|
||||
| Description: Set the standard screen colors to the color requested. |
|
||||
@@ -1578,9 +1420,6 @@ STATIC FUNCTION _ftSetSCRColor(nStd,nEnh,nBord,nBack,nUnsel)
|
||||
RETURN SETCOLOR(aStdColor[nStd]+","+aStdColor[nEnh]+","+aStdColor[nBord]+","+;
|
||||
aStdColor[nBack]+","+aStdColor[nUnsel])
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPushWin() Docs: Keith A. Wire |
|
||||
| Description: Push a new window on the screen |
|
||||
@@ -1640,9 +1479,6 @@ STATIC FUNCTION _ftPushWin(t,l,b,r,cTitle,cBotTitle,nWinColor)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPopWin Docs: Keith A. Wire |
|
||||
| Description: Pop a Window off the screen |
|
||||
@@ -1682,10 +1518,6 @@ STATIC FUNCTION _ftPopWin
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftSetWinColor() Docs: Keith A. Wire |
|
||||
| Description: Set the Color to the Window Colors requested |
|
||||
@@ -1720,11 +1552,6 @@ STATIC FUNCTION _ftSetWinColor(nWin,nStd,nEnh,nBord,nBack,nUnsel)
|
||||
RETURN SETCOLOR(aWinColor[nStd,nWin]+","+aWinColor[nEnh,nWin]+","+ ;
|
||||
aWinColor[nBord,nWin]+","+aWinColor[nBack,nWin]+","+aWinColor[nUnsel,nWin])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftShadow() Docs: Keith A. Wire |
|
||||
| Description: Create a shadow on the screen in the coordinates given |
|
||||
@@ -1750,10 +1577,6 @@ STATIC FUNCTION _ftShadow( nTop, nLeft, nBottom, nRight )
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftLastWinColor Docs: Keith A. Wire |
|
||||
| Description: Decrement the active window color number and return the |
|
||||
@@ -1771,11 +1594,6 @@ RETURN NIL
|
||||
STATIC FUNCTION _ftLastWinColor
|
||||
RETURN nWinColor := IIF(nWinColor==1,4,nWinColor-1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftNextWinColor Docs: Keith A. Wire |
|
||||
| Description: Increment the active window color number and return the |
|
||||
@@ -1797,10 +1615,6 @@ STATIC FUNCTION _ftNextWinColor
|
||||
|
||||
RETURN nWinColor := (IIF(nWinColor<4,nWinColor+1,1))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftWinTitle() Docs: Keith A. Wire |
|
||||
| Description: Print the top or bottom titles on the border of the |
|
||||
@@ -1825,9 +1639,6 @@ STATIC FUNCTION _ftWinTitle(cTheTitle,cTopOrBot)
|
||||
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftInitColors Docs: Keith A. Wire |
|
||||
| Description: Initilize the colors for the Adder |
|
||||
@@ -1861,9 +1672,6 @@ STATIC FUNCTION _ftInitColors
|
||||
"N/N" }
|
||||
RETURN NIL
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftCharOdd() Docs: Keith A. Wire |
|
||||
| Description: Remove all the even numbered characters in a string. |
|
||||
@@ -1882,10 +1690,6 @@ STATIC FUNCTION _ftCharOdd(cString)
|
||||
cString := TRANSFORM(cString,REPLICATE("X", LEN(cString)/2 ) )
|
||||
RETURN STRTRAN(cString,"")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPosRepl() Docs: Keith A. Wire |
|
||||
| Description: Replace the Character at nPosit in cString with cChar |
|
||||
@@ -1903,10 +1707,6 @@ RETURN STRTRAN(cString,"")
|
||||
STATIC FUNCTION _ftPosRepl(cString,cChar,nPosit)
|
||||
RETURN STRTRAN(cString,"9",cChar,nPosit,1)+""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftCharRem() Docs: Keith A. Wire |
|
||||
| Description: Removes all occurances of cChar from cString. |
|
||||
@@ -1923,13 +1723,6 @@ RETURN STRTRAN(cString,"9",cChar,nPosit,1)+""
|
||||
STATIC FUNCTION _ftCharRem(cChar,cString)
|
||||
RETURN STRTRAN(cString,cChar)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftCountLeft() Docs: Keith A. Wire |
|
||||
| Description: Returns the number of spaces on the Left side of the String|
|
||||
@@ -1945,10 +1738,6 @@ RETURN STRTRAN(cString,cChar)
|
||||
STATIC FUNCTION _ftCountLeft(cString)
|
||||
RETURN LEN(cString)-LEN(LTRIM(cString))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: _ftPosIns() Docs: Keith A. Wire |
|
||||
| Description: Insert the Character cChar in cString at position nPosit |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user