2012-09-29 19:44 UTC+0200 Viktor Szakats (harbour syenar.net)
+ contrib/hbnf/tests/aading.prg
+ contrib/hbnf/tests/aemaxlen.prg
+ contrib/hbnf/tests/aeminlen.prg
+ contrib/hbnf/tests/amedian.prg
+ contrib/hbnf/tests/aredit.prg
+ contrib/hbnf/tests/at2.prg
+ contrib/hbnf/tests/blink.prg
+ contrib/hbnf/tests/calendar.prg
+ contrib/hbnf/tests/clrsel.prg
+ contrib/hbnf/tests/d2e.prg
+ contrib/hbnf/tests/datecnfg.prg
+ contrib/hbnf/tests/dectobin.prg
+ contrib/hbnf/tests/dfile.prg
+ contrib/hbnf/tests/diskfunc.prg
+ contrib/hbnf/tests/dispmsg.prg
+ contrib/hbnf/tests/dosver.prg
+ contrib/hbnf/tests/e2d.prg
+ contrib/hbnf/tests/elapsed.prg
+ contrib/hbnf/tests/findith.prg
+ contrib/hbnf/tests/floptst.prg
+ contrib/hbnf/tests/gcd.prg
+ contrib/hbnf/tests/hex2dec.prg
+ contrib/hbnf/tests/isshare.prg
+ contrib/hbnf/tests/linked.prg
+ contrib/hbnf/tests/menu1.prg
+ contrib/hbnf/tests/metaph.prg
+ contrib/hbnf/tests/miltime.prg
+ contrib/hbnf/tests/mouse1.prg
+ contrib/hbnf/tests/mouse2.prg
+ contrib/hbnf/tests/netpv.prg
+ contrib/hbnf/tests/ntow.prg
+ contrib/hbnf/tests/nwlstat.prg
+ contrib/hbnf/tests/nwsem.prg
+ contrib/hbnf/tests/nwuid.prg
+ contrib/hbnf/tests/pending.prg
+ contrib/hbnf/tests/pickday.prg
+ contrib/hbnf/tests/popadder.prg
+ contrib/hbnf/tests/prtesc.prg
+ contrib/hbnf/tests/rand1.prg
+ contrib/hbnf/tests/savearr.prg
+ contrib/hbnf/tests/savesets.prg
+ contrib/hbnf/tests/scancode.prg
+ contrib/hbnf/tests/setdate.prg
+ contrib/hbnf/tests/settime.prg
+ contrib/hbnf/tests/sleep.prg
+ contrib/hbnf/tests/sysmem.prg
+ contrib/hbnf/tests/tbwhile.prg
+ contrib/hbnf/tests/tempfile.prg
+ contrib/hbnf/tests/vertmenu.prg
+ contrib/hbnf/tests/vidmode.prg
+ contrib/hbnf/tests/wda.prg
+ contrib/hbnf/tests/workdays.prg
+ contrib/hbnf/tests/woy.prg
+ contrib/hbnf/tests/xbox.prg
- contrib/hbnf/hbmk.hbm
- contrib/hbnf/tests/nftest.prg
* contrib/hbnf/aading.prg
* contrib/hbnf/aemaxlen.prg
* contrib/hbnf/aeminlen.prg
* contrib/hbnf/amedian.prg
* contrib/hbnf/aredit.prg
* contrib/hbnf/at2.prg
* contrib/hbnf/blink.prg
* contrib/hbnf/calendar.prg
* contrib/hbnf/clrsel.prg
* contrib/hbnf/d2e.prg
* contrib/hbnf/datecnfg.prg
* contrib/hbnf/dectobin.prg
* contrib/hbnf/dfile.prg
* contrib/hbnf/diskfunc.prg
* contrib/hbnf/dispmsg.prg
* contrib/hbnf/dosver.prg
* contrib/hbnf/e2d.prg
* contrib/hbnf/elapsed.prg
* contrib/hbnf/findith.prg
* contrib/hbnf/floptst.prg
* contrib/hbnf/gcd.prg
* contrib/hbnf/hex2dec.prg
* contrib/hbnf/isshare.prg
* contrib/hbnf/linked.prg
* contrib/hbnf/menu1.prg
* contrib/hbnf/metaph.prg
* contrib/hbnf/miltime.prg
* contrib/hbnf/mouse1.prg
* contrib/hbnf/mouse2.prg
* contrib/hbnf/netpv.prg
* contrib/hbnf/ntow.prg
* contrib/hbnf/nwlstat.prg
* contrib/hbnf/nwsem.prg
* contrib/hbnf/nwuid.prg
* contrib/hbnf/pending.prg
* contrib/hbnf/pickday.prg
* contrib/hbnf/popadder.prg
* contrib/hbnf/prtesc.prg
* contrib/hbnf/rand1.prg
* contrib/hbnf/savearr.prg
* contrib/hbnf/savesets.prg
* contrib/hbnf/scancode.prg
* contrib/hbnf/setdate.prg
* contrib/hbnf/settime.prg
* contrib/hbnf/sleep.prg
* contrib/hbnf/sysmem.prg
* contrib/hbnf/tbwhile.prg
* contrib/hbnf/tempfile.prg
* contrib/hbnf/vertmenu.prg
* contrib/hbnf/vidmode.prg
* contrib/hbnf/wda.prg
* contrib/hbnf/workdays.prg
* contrib/hbnf/woy.prg
* contrib/hbnf/xbox.prg
+ extracted FT_TEST code into separate .prg files and
copied to /tests dir, replacing nftest.prg which was
a copy of the same code merged into one file.
This commit is contained in:
@@ -16,6 +16,121 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-09-29 19:44 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
+ contrib/hbnf/tests/aading.prg
|
||||
+ contrib/hbnf/tests/aemaxlen.prg
|
||||
+ contrib/hbnf/tests/aeminlen.prg
|
||||
+ contrib/hbnf/tests/amedian.prg
|
||||
+ contrib/hbnf/tests/aredit.prg
|
||||
+ contrib/hbnf/tests/at2.prg
|
||||
+ contrib/hbnf/tests/blink.prg
|
||||
+ contrib/hbnf/tests/calendar.prg
|
||||
+ contrib/hbnf/tests/clrsel.prg
|
||||
+ contrib/hbnf/tests/d2e.prg
|
||||
+ contrib/hbnf/tests/datecnfg.prg
|
||||
+ contrib/hbnf/tests/dectobin.prg
|
||||
+ contrib/hbnf/tests/dfile.prg
|
||||
+ contrib/hbnf/tests/diskfunc.prg
|
||||
+ contrib/hbnf/tests/dispmsg.prg
|
||||
+ contrib/hbnf/tests/dosver.prg
|
||||
+ contrib/hbnf/tests/e2d.prg
|
||||
+ contrib/hbnf/tests/elapsed.prg
|
||||
+ contrib/hbnf/tests/findith.prg
|
||||
+ contrib/hbnf/tests/floptst.prg
|
||||
+ contrib/hbnf/tests/gcd.prg
|
||||
+ contrib/hbnf/tests/hex2dec.prg
|
||||
+ contrib/hbnf/tests/isshare.prg
|
||||
+ contrib/hbnf/tests/linked.prg
|
||||
+ contrib/hbnf/tests/menu1.prg
|
||||
+ contrib/hbnf/tests/metaph.prg
|
||||
+ contrib/hbnf/tests/miltime.prg
|
||||
+ contrib/hbnf/tests/mouse1.prg
|
||||
+ contrib/hbnf/tests/mouse2.prg
|
||||
+ contrib/hbnf/tests/netpv.prg
|
||||
+ contrib/hbnf/tests/ntow.prg
|
||||
+ contrib/hbnf/tests/nwlstat.prg
|
||||
+ contrib/hbnf/tests/nwsem.prg
|
||||
+ contrib/hbnf/tests/nwuid.prg
|
||||
+ contrib/hbnf/tests/pending.prg
|
||||
+ contrib/hbnf/tests/pickday.prg
|
||||
+ contrib/hbnf/tests/popadder.prg
|
||||
+ contrib/hbnf/tests/prtesc.prg
|
||||
+ contrib/hbnf/tests/rand1.prg
|
||||
+ contrib/hbnf/tests/savearr.prg
|
||||
+ contrib/hbnf/tests/savesets.prg
|
||||
+ contrib/hbnf/tests/scancode.prg
|
||||
+ contrib/hbnf/tests/setdate.prg
|
||||
+ contrib/hbnf/tests/settime.prg
|
||||
+ contrib/hbnf/tests/sleep.prg
|
||||
+ contrib/hbnf/tests/sysmem.prg
|
||||
+ contrib/hbnf/tests/tbwhile.prg
|
||||
+ contrib/hbnf/tests/tempfile.prg
|
||||
+ contrib/hbnf/tests/vertmenu.prg
|
||||
+ contrib/hbnf/tests/vidmode.prg
|
||||
+ contrib/hbnf/tests/wda.prg
|
||||
+ contrib/hbnf/tests/workdays.prg
|
||||
+ contrib/hbnf/tests/woy.prg
|
||||
+ contrib/hbnf/tests/xbox.prg
|
||||
- contrib/hbnf/hbmk.hbm
|
||||
- contrib/hbnf/tests/nftest.prg
|
||||
* contrib/hbnf/aading.prg
|
||||
* contrib/hbnf/aemaxlen.prg
|
||||
* contrib/hbnf/aeminlen.prg
|
||||
* contrib/hbnf/amedian.prg
|
||||
* contrib/hbnf/aredit.prg
|
||||
* contrib/hbnf/at2.prg
|
||||
* contrib/hbnf/blink.prg
|
||||
* contrib/hbnf/calendar.prg
|
||||
* contrib/hbnf/clrsel.prg
|
||||
* contrib/hbnf/d2e.prg
|
||||
* contrib/hbnf/datecnfg.prg
|
||||
* contrib/hbnf/dectobin.prg
|
||||
* contrib/hbnf/dfile.prg
|
||||
* contrib/hbnf/diskfunc.prg
|
||||
* contrib/hbnf/dispmsg.prg
|
||||
* contrib/hbnf/dosver.prg
|
||||
* contrib/hbnf/e2d.prg
|
||||
* contrib/hbnf/elapsed.prg
|
||||
* contrib/hbnf/findith.prg
|
||||
* contrib/hbnf/floptst.prg
|
||||
* contrib/hbnf/gcd.prg
|
||||
* contrib/hbnf/hex2dec.prg
|
||||
* contrib/hbnf/isshare.prg
|
||||
* contrib/hbnf/linked.prg
|
||||
* contrib/hbnf/menu1.prg
|
||||
* contrib/hbnf/metaph.prg
|
||||
* contrib/hbnf/miltime.prg
|
||||
* contrib/hbnf/mouse1.prg
|
||||
* contrib/hbnf/mouse2.prg
|
||||
* contrib/hbnf/netpv.prg
|
||||
* contrib/hbnf/ntow.prg
|
||||
* contrib/hbnf/nwlstat.prg
|
||||
* contrib/hbnf/nwsem.prg
|
||||
* contrib/hbnf/nwuid.prg
|
||||
* contrib/hbnf/pending.prg
|
||||
* contrib/hbnf/pickday.prg
|
||||
* contrib/hbnf/popadder.prg
|
||||
* contrib/hbnf/prtesc.prg
|
||||
* contrib/hbnf/rand1.prg
|
||||
* contrib/hbnf/savearr.prg
|
||||
* contrib/hbnf/savesets.prg
|
||||
* contrib/hbnf/scancode.prg
|
||||
* contrib/hbnf/setdate.prg
|
||||
* contrib/hbnf/settime.prg
|
||||
* contrib/hbnf/sleep.prg
|
||||
* contrib/hbnf/sysmem.prg
|
||||
* contrib/hbnf/tbwhile.prg
|
||||
* contrib/hbnf/tempfile.prg
|
||||
* contrib/hbnf/vertmenu.prg
|
||||
* contrib/hbnf/vidmode.prg
|
||||
* contrib/hbnf/wda.prg
|
||||
* contrib/hbnf/workdays.prg
|
||||
* contrib/hbnf/woy.prg
|
||||
* contrib/hbnf/xbox.prg
|
||||
+ extracted FT_TEST code into separate .prg files and
|
||||
copied to /tests dir, replacing nftest.prg which was
|
||||
a copy of the same code merged into one file.
|
||||
|
||||
2012-09-29 18:34 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* contrib/hbnf/aavg.prg
|
||||
* contrib/hbnf/adessort.prg
|
||||
|
||||
@@ -21,48 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aList1, aList2, var0, nstart, nstop, nelapsed, nCtr
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AADDITION"
|
||||
?
|
||||
aList1 := { "apple", "orange", "pear" }
|
||||
aList2 := { "apple ", "banana", "PEAR" }
|
||||
? "aList1 : "
|
||||
AEval( aList1, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
? "aList2 : "
|
||||
AEval( aList2, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
|
||||
nstart := Seconds()
|
||||
FOR nCtr := 1 TO 100
|
||||
var0 := FT_AADDITION( aList1, aList2 )
|
||||
NEXT
|
||||
nstop := Seconds()
|
||||
nelapsed := nstop - nstart
|
||||
? "time for 100 merges:", nelapsed
|
||||
|
||||
? PadR( "FT_AADDITION( aList1, aList2 ) ->", 44 )
|
||||
AEval( var0, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
var0 := FT_AADDITION( aList1, aList2, , .F. )
|
||||
? PadR( "FT_AADDITION( aList1, aList2, , .F. ) ->", 44 )
|
||||
AEval( var0, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
var0 := FT_AADDITION( aList1, aList2, .F. , .F. )
|
||||
? PadR( "FT_AADDITION( aList1, aList2, .F., .F. ) ->", 44 )
|
||||
AEval( var0, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_AADDITION( aList1, aList2, lTrimmer, lCaseSens )
|
||||
|
||||
LOCAL nElement, nPos, bScanCode
|
||||
|
||||
@@ -21,38 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL var0, myarray1 := Directory()
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMAXLEN"
|
||||
?
|
||||
? "myarray1 := DIRECTORY()"
|
||||
?
|
||||
var0 := FT_AEMAXLEN( myarray1 )
|
||||
? PadR( "FT_AEMAXLEN( myarray1 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMAXLEN( myarray1, 2 )
|
||||
? PadR( "FT_AEMAXLEN( myarray1, 2 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMAXLEN( myarray1, 3 )
|
||||
? PadR( "FT_AEMAXLEN( myarray1, 3 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMAXLEN( ATail( myarray1 ) )
|
||||
? PadR( "FT_AEMAXLEN( aTail( myarray1 ) ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_AEmaxlen( aArray, nDimension, nStart, nCount )
|
||||
|
||||
LOCAL i, nLast, cType, nMaxlen := 0
|
||||
|
||||
@@ -21,41 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL var0, myarray1 := Directory()
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMINLEN"
|
||||
?
|
||||
? "myarray1 := DIRECTORY()"
|
||||
?
|
||||
AEval( myarray1, {| v | QOut( PadR( v[ 1 ], 12 ), v[ 2 ], v[ 3 ], v[ 4 ], v[ 5 ] ) } )
|
||||
var0 := FT_AEMINLEN( myarray1 )
|
||||
? PadR( "FT_AEMINLEN( myarray1 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMINLEN( myarray1, 2 )
|
||||
? PadR( "FT_AEMINLEN( myarray1, 2 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
?
|
||||
var0 := FT_AEMINLEN( myarray1[ 2 ] )
|
||||
? PadR( "FT_AEMINLEN( myarray1[ 2 ] ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
?
|
||||
var0 := FT_AEMINLEN( myarray1, 3 )
|
||||
? PadR( "FT_AEMINLEN( myarray1, 3 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_AEminlen( aArray, nDimension, nStart, nCount )
|
||||
|
||||
LOCAL i, nLast, cType, nMinlen := 65519
|
||||
|
||||
@@ -23,39 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
#include "directry.ch"
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL var0, myarray0 := Directory(), myarray1 := {}
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AMEDIAN"
|
||||
?
|
||||
AEval( myarray0, {| x | AAdd( myarray1, x[ F_SIZE ] ) } )
|
||||
var0 := FT_AMEDIAN( myarray1 )
|
||||
? PadR( "FT_AMEDIAN( myarray1 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AMEDIAN( myarray1, 2 )
|
||||
? PadR( "FT_AMEDIAN( myarray1, 2 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AMEDIAN( myarray1, , 9 )
|
||||
? PadR( "FT_AMEDIAN( myarray1, , 9 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AMEDIAN( myarray1, 8, 40 )
|
||||
? PadR( "FT_AMEDIAN( myarray1, 8, 40 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
#include "common.ch"
|
||||
|
||||
#define FORCE_BETWEEN( x, y, z ) ( y := MAX( MIN( y, z ), x ) )
|
||||
|
||||
@@ -50,73 +50,6 @@
|
||||
#define KEY_ELEM 1
|
||||
#define BLK_ELEM 2
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
// Thanks to Jim Gale for helping me understand the basics
|
||||
LOCAL i, ar[ 3, 26 ], aBlocks[ 3 ], aHeadings, nElem := 1, bGetFunc, cRet
|
||||
// set up 2 dimensional array ar[]
|
||||
FOR i := 1 TO 26
|
||||
ar[ 1, i ] := i // 1 -> 26 Numeric
|
||||
ar[ 2, i ] := Chr( Asc( "A" ) + i - 1 ) // "A" -> "Z" Character
|
||||
ar[ 3, i ] := Chr( Asc( "Z" ) - i + 1 ) // "Z" -> "A" Character
|
||||
NEXT i
|
||||
// Set Up aHeadings[] for column headings
|
||||
aHeadings := { "Numbers", "Letters", "Reverse" }
|
||||
// Set Up Blocks Describing Individual Elements in Array ar[]
|
||||
aBlocks[ 1 ] := {|| Str( ar[ 1, nElem ], 2 ) } // to prevent default 10 spaces
|
||||
aBlocks[ 2 ] := {|| ar[ 2, nElem ] }
|
||||
aBlocks[ 3 ] := {|| ar[ 3, nElem ] }
|
||||
// Set up TestGet() as bGetFunc
|
||||
bGetFunc := {| b, ar, nDim, nElem | TestGet( b, ar, nDim, nElem ) }
|
||||
|
||||
SET SCOREBOARD OFF
|
||||
SetColor( "W/N" )
|
||||
CLS
|
||||
@ 21, 4 SAY "Use Cursor Keys To Move Between Fields, <F7> = Delete Row, <F8> = Add Row"
|
||||
@ 22, 7 SAY "<ESC> = Quit Array Edit, <Enter> or <Any Other Key> Edits Element"
|
||||
SetColor( "N/W, W/N, , , W/N" )
|
||||
cRet := FT_ArEdit( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc )
|
||||
SetColor( "W/N" )
|
||||
CLS
|
||||
? cRet
|
||||
? "Lastkey() = ESC:", LastKey() == K_ESC
|
||||
|
||||
RETURN
|
||||
|
||||
FUNCTION TestGet( b, ar, nDim, nElem )
|
||||
|
||||
LOCAL GetList := {}
|
||||
LOCAL nRow := Row()
|
||||
LOCAL nCol := Col()
|
||||
LOCAL cSaveScrn := SaveScreen( 21, 0, 22, MaxCol() )
|
||||
LOCAL cOldColor := SetColor( "W/N" )
|
||||
|
||||
@ 21, 0 CLEAR TO 22, MaxCol()
|
||||
@ 21, 29 SAY "Editing Array Element"
|
||||
SetColor( cOldColor )
|
||||
DO CASE
|
||||
CASE nDim == 1
|
||||
@ nRow, nCol GET ar[ 1, nElem ] PICTURE "99"
|
||||
READ
|
||||
b:refreshAll()
|
||||
CASE nDim == 2
|
||||
@ nRow, nCol GET ar[ 2, nElem ] PICTURE "!"
|
||||
READ
|
||||
b:refreshAll()
|
||||
CASE nDim == 3
|
||||
@ nRow, nCol GET ar[ 3, nElem ] PICTURE "!"
|
||||
READ
|
||||
b:refreshAll()
|
||||
ENDCASE
|
||||
RestScreen( 21, 0, 22, MaxCol(), cSaveScrn )
|
||||
@ nRow, nCol SAY ""
|
||||
|
||||
RETURN .T.
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_ArEdit( nTop, nLeft, nBot, nRight, ;
|
||||
ar, nElem, aHeadings, aBlocks, bGetFunc )
|
||||
|
||||
|
||||
@@ -26,37 +26,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cSearch, cTarget, var0
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AT2"
|
||||
?
|
||||
cSearch := "t"
|
||||
? "Find occurrences of 't' in: "
|
||||
cTarget := "This is the day that the Lord has made."
|
||||
?? cTarget
|
||||
?
|
||||
var0 := ft_at2( cSearch, cTarget )
|
||||
? PadR( "FT_AT2( cSearch, cTarget ) -> ", 40 )
|
||||
?? var0
|
||||
?
|
||||
var0 := ft_at2( cSearch, cTarget, 2 )
|
||||
? PadR( "FT_AT2( cSearch, cTarget, 2 ) -> ", 40 )
|
||||
??var0
|
||||
?
|
||||
var0 := ft_at2( cSearch, cTarget, 2, .F. )
|
||||
? PadR( "FT_AT2( cSearch, cTarget, 2, .F. ) -> ", 40 )
|
||||
??var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_AT2( cSearch, cTarget, nOccurs, lCaseSens )
|
||||
|
||||
LOCAL nCount, nPos, nPos2 := 0
|
||||
|
||||
@@ -23,16 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
FT_BLINK( "WAIT", 5, 10 )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_BLINK( cMsg, nRow, nCol )
|
||||
|
||||
// Declare color restore var.
|
||||
|
||||
@@ -23,32 +23,6 @@
|
||||
#include "inkey.ch"
|
||||
#include "setcurs.ch"
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aRet
|
||||
|
||||
SetColor( "w+/b" )
|
||||
CLS
|
||||
IF ft_numlock()
|
||||
ft_numlock( .F. )
|
||||
ENDIF
|
||||
hb_keyPut( K_F1 )
|
||||
aRet := ft_calendar( 10, 40, "w+/rb", .T. , .T. ) //display calendar, return all.
|
||||
@ 1, 0 SAY "Date :" + DToC( aRet[ 1 ] )
|
||||
@ 2, 0 SAY "Month Number:" + Str( aRet[ 2 ], 2, 0 )
|
||||
@ 3, 0 SAY "Day Number :" + Str( aRet[ 3 ], 2, 0 )
|
||||
@ 4, 0 SAY "Year Number :" + Str( aRet[ 4 ], 4, 0 )
|
||||
@ 5, 0 SAY "Month :" + aRet[ 5 ]
|
||||
@ 6, 0 SAY "Day :" + aRet[ 6 ]
|
||||
@ 7, 0 SAY "Julian Day :" + Str( aRet[ 7 ], 3, 0 )
|
||||
@ 8, 0 SAY "Current Time:" + aRet[ 8 ]
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_CALENDAR( nRow, nCol, cColor, lShadow, lShowHelp )
|
||||
|
||||
LOCAL nJump := 0, nKey := 0, cSavColor, cSaveScreen, cSaveCursor
|
||||
|
||||
@@ -92,59 +92,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cVidMode )
|
||||
|
||||
LOCAL nRowDos := Row()
|
||||
LOCAL nColDos := Col()
|
||||
LOCAL aEnvDos := FT_SaveSets()
|
||||
LOCAL cScrDos := SaveScreen( 0, 0, MaxRow(), MaxCol() )
|
||||
LOCAL lColour
|
||||
LOCAL aClrs
|
||||
|
||||
DEFAULT cVidMode TO ""
|
||||
NoSnow( ( "NOSNOW" $ Upper( cVidMode ) ) )
|
||||
IF "VGA" $ Upper( cVidMode )
|
||||
SetMode( 50, 80 )
|
||||
ENDIF
|
||||
IF "EGA" $ Upper( cVidMode )
|
||||
SetMode( 43, 80 )
|
||||
ENDIF
|
||||
lColour := iif( "MONO" $ Upper( cVidMode ), .F. , IsColor() )
|
||||
|
||||
SET SCOREBOARD OFF
|
||||
SetCursor( SC_NONE )
|
||||
SetBlink( .F. )
|
||||
|
||||
//.... a typical application might have the following different settings
|
||||
// normally these would be stored in a .dbf/.dbv
|
||||
aClrs := { ;
|
||||
{ "Desktop", "N/BG", "D", hb_UTF8ToStr( "▒" ) }, ;
|
||||
{ "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 )
|
||||
|
||||
HB_SYMBOL_UNUSED( aClrs )
|
||||
|
||||
//.... restore the DOS environment
|
||||
FT_RestSets( aEnvDos )
|
||||
RestScreen( 0, 0, MaxRow(), MaxCol(), cScrDos )
|
||||
SetPos( nRowDos, nColDos )
|
||||
SetBlink( .F. ) // doesn't appear to be reset from FT_RestSets
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
FUNCTION FT_ClrSel( aClrs, lColour, cChr )
|
||||
|
||||
@@ -28,17 +28,6 @@
|
||||
#define log10( num ) log( num ) / log( 10 )
|
||||
#define DEFAULT_PRECISION 6
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cNum, cPrec )
|
||||
|
||||
DEFAULT cPrec TO Str( DEFAULT_PRECISION )
|
||||
QOut( ft_d2e( Val( cNum ), Val( cPrec ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION ft_d2e( nDec, nPrecision )
|
||||
|
||||
LOCAL nExp, sScn
|
||||
|
||||
@@ -26,210 +26,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
// NOTES: 1) The date functions are 'international'; i.e., the
|
||||
// system date format is maintained, although ANSI is
|
||||
// temporarily used within certain functions.
|
||||
//
|
||||
// 2) The date functions fall into two categories:
|
||||
//
|
||||
// a) Calendar or fiscal periods.
|
||||
// A calendar or fiscal year is identified by the year()
|
||||
// of the last date in the year.
|
||||
//
|
||||
// b) Accounting Periods. 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.
|
||||
//
|
||||
// 3) The date functions require the presence of two variables:
|
||||
//
|
||||
// a) cFY_Start is a character string used to define the
|
||||
// first day of a calendar or fiscal year. It's format
|
||||
// is ANSI; e.g., "1980.01.01" defines a calendar year,
|
||||
// "1980.10.01" defines a fiscal year, starting October 1.
|
||||
//
|
||||
// The year may be any valid year. It's value has no
|
||||
// effect on the date functions. The day is assumed to be
|
||||
// less than 29. See function: FT_DATECNFG().
|
||||
//
|
||||
// B) nDow_Start is a number from 1 to 7 which defines the
|
||||
// starting day, DOW(), of a work week; e.g., 1 == Sunday.
|
||||
//
|
||||
// See function: FT_DATECNFG()
|
||||
//
|
||||
// COMPILE ALL PROGRAMS WITH /N /W /A
|
||||
//
|
||||
//*******************************************************************
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nNum, dDate, aTestData, aTemp, cFY_Start, nDOW_Start
|
||||
|
||||
SET DATE ANSI // User's normal date format
|
||||
aTemp := FT_DATECNFG() // Get/Set cFY_Start & nDOW_Start.
|
||||
// aTemp := FT_DATECNFG( "1980.01.03", 1 ) // Date string in user's format.
|
||||
cFY_Start := aTemp[ 1 ] // See FT_DATECNFG() in ft_date0.prg
|
||||
nDOW_Start := ATEMP[ 2 ] // FOR PARAMETERS.
|
||||
dDate := Date()
|
||||
// dDate := SToD( "19880229" ) // Test date, in user's normal date format
|
||||
|
||||
CLS
|
||||
? "Given Date: "
|
||||
?? dDate
|
||||
?? " cFY_Start: " + cFY_Start
|
||||
?? " nDOW_Start:" + Str( nDOW_Start, 2 )
|
||||
? "---- Fiscal Year Data -----------"
|
||||
|
||||
aTestData := FT_YEAR( dDate )
|
||||
? "FYYear ", aTestData[ 1 ] + " ", aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_QTR( dDate )
|
||||
? "FYQtr ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_QTR( dDate, nNum )
|
||||
? "FYQtr " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_MONTH( dDate )
|
||||
? "FYMonth ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_MONTH( dDate, nNum )
|
||||
? "FYMonth " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_WEEK( dDate )
|
||||
? "FYWeek ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_WEEK( dDate, nNum )
|
||||
? "FYWeek " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_DAYOFYR( dDate )
|
||||
? "FYDay ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 3 ) )
|
||||
aTestData := FT_DAYOFYR( dDate, nNum )
|
||||
? "FYDAY " + Str( nNum, 3 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
?
|
||||
? "---- Accounting Year Data -------"
|
||||
|
||||
aTestData := FT_ACCTYEAR( dDate )
|
||||
? "ACCTYear ", aTestData[ 1 ] + " ", aTestData[ 2 ], aTestData[ 3 ], ;
|
||||
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks"
|
||||
|
||||
aTestData := FT_ACCTQTR( dDate )
|
||||
? "ACCTQtr ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ], ;
|
||||
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks"
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_ACCTQTR( dDate, nNum )
|
||||
? "ACCTQtr " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_ACCTMONTH( dDate )
|
||||
? "ACCTMonth ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ], ;
|
||||
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks"
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_ACCTMONTH( dDate, nNum )
|
||||
? "ACCTMonth" + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_ACCTWEEK( dDate )
|
||||
? "ACCTWeek ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_ACCTWEEK( dDate, nNum )
|
||||
? "ACCTWeek " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_DAYOFYR( dDate, , .T. )
|
||||
? "ACCTDay ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 3 ) )
|
||||
aTestData := FT_DAYOFYR( dDate, nNum, .T. )
|
||||
? "ACCTDay " + Str( nNum, 3 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
WAIT
|
||||
|
||||
FT_CAL( dDate )
|
||||
FT_CAL( dDate, 1 )
|
||||
|
||||
RETURN
|
||||
|
||||
// DEMO Monthly Calendar function.
|
||||
// nType : 0 -> FT_MONTH, 1 -> FT_ACCTMONTH
|
||||
|
||||
STATIC FUNCTION FT_CAL( dGivenDate, nType )
|
||||
|
||||
LOCAL nTemp, dTemp, aTemp, cFY_Start, dStart, dEnd
|
||||
|
||||
aTemp := FT_DATECNFG()
|
||||
cFY_Start := aTemp[ 1 ]
|
||||
|
||||
IF dGivenDate == NIL .OR. !( ValType( dGivenDate ) $ "ND" )
|
||||
dGivenDate := Date()
|
||||
ELSEIF HB_ISNUMERIC( dGivenDate )
|
||||
nType := dGivenDate
|
||||
dGivenDate := Date()
|
||||
ENDIF
|
||||
|
||||
nType := iif( HB_ISNUMERIC( nType ), nType, 0 )
|
||||
|
||||
IF nType == 0
|
||||
IF SubStr( cFY_Start, 6, 5 ) == "01.01"
|
||||
? " Calendar Month Calendar containing " + DToC( dGivenDate )
|
||||
ELSE
|
||||
? " Fiscal Month Calendar containing " + DToC( dGivenDate )
|
||||
ENDIF
|
||||
|
||||
aTemp := FT_MONTH( dGivenDate )
|
||||
dStart := aTemp[ 2 ]
|
||||
dEnd := aTemp[ 3 ]
|
||||
aTemp[ 2 ] -= FT_DAYTOBOW( aTemp[ 2 ] )
|
||||
aTemp[ 3 ] += 6 - FT_DAYTOBOW( aTemp[ 3 ] )
|
||||
ELSE
|
||||
? " Accounting Month Calendar containing " + DToC( dGivenDate )
|
||||
aTemp := FT_ACCTMONTH( dGivenDate )
|
||||
ENDIF
|
||||
|
||||
?
|
||||
dTemp := aTemp[ 2 ]
|
||||
|
||||
FOR nTemp := 0 TO 6
|
||||
?? PadC( CDOW( dTemp + nTemp ), 10 )
|
||||
NEXT
|
||||
|
||||
?
|
||||
WHILE dTemp <= aTemp[ 3 ]
|
||||
FOR nTemp := 1 TO 7
|
||||
?? " "
|
||||
IF nType == 0 .AND. ( dTemp < dStart .OR. dTemp > dEnd )
|
||||
?? Space( 8 )
|
||||
ELSE
|
||||
?? dTemp
|
||||
ENDIF
|
||||
?? " "
|
||||
dTemp++
|
||||
NEXT
|
||||
?
|
||||
END
|
||||
|
||||
RETURN NIL
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_DATECNFG( cFYStart , nDow )
|
||||
|
||||
THREAD STATIC t_aDatePar := { "1980.01.01", 1 }
|
||||
|
||||
@@ -23,20 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL X
|
||||
|
||||
FOR X := 1 TO 255
|
||||
QOut( FT_DEC2BIN( x ) )
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_DEC2BIN( x )
|
||||
|
||||
LOCAL i, buffer := { "0", "0", "0", "0", "0", "0", "0", "0" }
|
||||
|
||||
@@ -28,59 +28,6 @@
|
||||
|
||||
THREAD STATIC t_nHandle := 0
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cInFile := "dfile.prg"
|
||||
LOCAL CKEY
|
||||
LOCAL NNCOLOR := 7
|
||||
LOCAL NHCOLOR := 15
|
||||
LOCAL NCOLSKIP := 5
|
||||
LOCAL NRMARGIN := 132
|
||||
LOCAL CEXITKEYS := "AABBC "
|
||||
LOCAL LBROWSE := .F.
|
||||
LOCAL NSTART := 1
|
||||
LOCAL NBUFFSIZE := 4096
|
||||
LOCAL GetList := {}
|
||||
|
||||
@ 0, 0 CLEAR
|
||||
|
||||
@ 0, 0 SAY "ENTER FILENAME: " GET CINFILE
|
||||
@ 1, 0 SAY " FOREGROUND: " GET NNCOLOR PICTURE "999"
|
||||
@ 2, 0 SAY " HIGHLIGHT: " GET NHCOLOR PICTURE "999"
|
||||
@ 3, 0 SAY " EXIT KEYS: " GET CEXITKEYS
|
||||
@ 4, 0 SAY " BUFFER SIZE: " GET NBUFFSIZE PICTURE "9999"
|
||||
@ 1, 40 SAY "COLUMN INCREMENT: " GET NCOLSKIP PICTURE "999"
|
||||
@ 2, 40 SAY " MAX LINE SIZE: " GET NRMARGIN PICTURE "999"
|
||||
@ 3, 40 SAY " BROWSE MODE? " GET LBROWSE PICTURE "Y"
|
||||
|
||||
READ
|
||||
|
||||
/*
|
||||
* REMEMBER A WINDOW WILL BE ONE SIZE LESS AND GREATER THAN THE PASSED COORD.'S
|
||||
*
|
||||
* THE 9TH PARAMETER CONTAINS THE KEYS THAT THE ROUTINE WILL TERMINATE ON
|
||||
* AND THE hb_BChar(143) represents the F3 key.
|
||||
*
|
||||
*/
|
||||
|
||||
@ 4, 9 TO 11, 71
|
||||
|
||||
FT_DFSETUP( cInFile, 5, 10, 10, 70, nStart, ;
|
||||
nNColor, nHColor, cExitKeys + hb_BChar( 143 ), ;
|
||||
lBrowse, nColSkip, nRMargin, nBuffSize )
|
||||
|
||||
cKey := FT_DISPFILE()
|
||||
|
||||
FT_DFCLOSE()
|
||||
|
||||
@ 20, 0 SAY "Key pressed was: " + "[" + cKey + "]"
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_DFSETUP( cInFile, nTop, nLeft, nBottom, nRight, ;
|
||||
nStart, nCNormal, nCHighlight, cExitKeys, ;
|
||||
lBrowse, nColSkip, nRMargin, nBuffSize )
|
||||
|
||||
@@ -29,17 +29,6 @@
|
||||
|
||||
#define DRVTABLE "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cDrv )
|
||||
|
||||
QOut( "Disk size: " + Str( FT_DSKSIZE( cDrv ) ) )
|
||||
QOut( "Free bytes: " + Str( FT_DSKFREE( cDrv ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_DSKSIZE( cDrive )
|
||||
RETURN DiskSpace( iif( cDrive == NIL, 0, At( Upper( cDrive ), DRVTABLE ) ), HB_DISK_TOTAL )
|
||||
|
||||
|
||||
@@ -30,70 +30,6 @@
|
||||
#include "setcurs.ch"
|
||||
|
||||
// beginning of demo program
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cDosScrn
|
||||
LOCAL nDosRow
|
||||
LOCAL nDosCol
|
||||
LOCAL lColor
|
||||
LOCAL nMaxRow
|
||||
LOCAL nType
|
||||
|
||||
// color variables
|
||||
LOCAL cNormH, cNormN
|
||||
LOCAL cWindH, cWindN
|
||||
LOCAL cErrH, cErrN
|
||||
|
||||
// main routine starts here
|
||||
SET SCOREBOARD OFF
|
||||
|
||||
lColor := .T.
|
||||
|
||||
cNormH := iif( lColor, "W+/BG", "W+/N" )
|
||||
cNormN := iif( lColor, "N/BG" , "W/N" )
|
||||
cWindH := iif( lColor, "W+/B", "W+/N" )
|
||||
cWindN := iif( lColor, "W/B" , "W/N" )
|
||||
cErrH := iif( lColor, "W+/R", "W+/N" )
|
||||
cErrN := iif( lColor, "W/R" , "W/N" )
|
||||
|
||||
cDosScrn := SaveScreen()
|
||||
nDosRow := Row()
|
||||
nDosCol := Col()
|
||||
SetColor( "W/N" )
|
||||
CLS
|
||||
nMaxRow := MaxRow()
|
||||
SetBlink( .F. )
|
||||
SetColor( cWindN + "*" )
|
||||
CLS
|
||||
SetColor( cNormN )
|
||||
|
||||
FT_DispMsg( { { "[Esc] To Abort Changes [PgDn] To Continue" }, { cNormN, , cNormH } }, , nMaxRow - 5 )
|
||||
|
||||
FT_DispMsg( { { "[E]dit [P]rint [D]elete", ;
|
||||
"[Esc]ape [Alt-Q]" }, ;
|
||||
{ cErrN, cErrN, cErrH } }, , 2 )
|
||||
|
||||
nType := FT_DispMsg( { { ;
|
||||
"Create Or Edit [I]nvoice" ,;
|
||||
"Create Or Edit [O]rder" ,;
|
||||
"Create Or Edit [B]ack Order" ,;
|
||||
"Create Or Edit [Q]uote" ,;
|
||||
"[Esc] To Exit" } ,;
|
||||
{ cWindN, , , , , cWindH } }, "BIOQ" + Chr( K_ESC ) )
|
||||
|
||||
HB_SYMBOL_UNUSED( nType )
|
||||
|
||||
SetColor( "W/N" )
|
||||
SetCursor( SC_NORMAL )
|
||||
SetBlink( .T. )
|
||||
RestScreen( , , , , cDosScrn )
|
||||
SetPos( nDosRow, nDosCol )
|
||||
QUIT
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow )
|
||||
|
||||
LOCAL xRtnVal := .F.
|
||||
|
||||
@@ -29,16 +29,6 @@
|
||||
#define DOS 33
|
||||
#define DOSVER 48
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "Dos version: " + FT_DOSVER() )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_DOSVER()
|
||||
|
||||
// LOCAL aRegs[ INT86_MAX_REGS ]
|
||||
|
||||
@@ -23,16 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( sNumE )
|
||||
|
||||
QOut( FT_E2D( sNumE ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION ft_e2d( sNumE )
|
||||
|
||||
LOCAL nMant, nExp
|
||||
|
||||
@@ -26,28 +26,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL dStart, dEnd, cTimeStart, cTimeEnd, n, aDataTest
|
||||
|
||||
dStart := SToD( "19901128" )
|
||||
dEnd := SToD( "19901130" )
|
||||
cTimeStart := "08:00:00"
|
||||
cTimeEnd := "12:10:30"
|
||||
|
||||
aDataTest := FT_ELAPSED( dStart, dEnd, cTimeStart, cTimeEnd )
|
||||
FOR n := 1 TO 4
|
||||
? aDataTest[ n, 1 ], Str( aDataTest[ n, 2 ], 12, 4 )
|
||||
?? " "
|
||||
?? iif( n == 1, "Days", iif( n == 2, "Hours", iif( n == 3, "Mins.", "Secs." ) ) )
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_ELAPSED( dStart, dEnd, cTimeStart, cTimeEnd )
|
||||
|
||||
LOCAL nTotalSec, nCtr, nConstant, nTemp, aRetVal[ 4, 2 ]
|
||||
|
||||
@@ -26,29 +26,6 @@
|
||||
#define MAKE_UPPER( cString ) ( cString := UPPER( cString ) )
|
||||
#define NULL ""
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cCk, cStr, nOcc, xCase )
|
||||
|
||||
LOCAL nFind
|
||||
|
||||
IF PCount() != 4
|
||||
QOut( "usage: findith cCk cStr nOcc xCase" )
|
||||
QUIT
|
||||
ENDIF
|
||||
|
||||
xCase := iif( xCase == "Y", .T. , .F. )
|
||||
nOcc := Val( nOcc )
|
||||
QOut( iif( xCase, "Ignoring ", "Observing " ) + "case:" )
|
||||
|
||||
QOut( cStr )
|
||||
nFind := FT_FINDITH( cCk, cStr, nOcc, xCase )
|
||||
QOut( iif( nFind > 0, Space( nFind - 1 ) + "^" , "Not found" ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_FINDITH( cCheckFor, cCheckIn, nWhichOccurrence, lIgnoreCase )
|
||||
|
||||
LOCAL nIthOccurrence
|
||||
|
||||
@@ -44,23 +44,6 @@
|
||||
#define ERR_WRITE_PROTECTED 3
|
||||
#define ERR_UNKNOWN 4
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cArg1 )
|
||||
|
||||
LOCAL nErrCode
|
||||
|
||||
IF HB_ISSTRING( cArg1 )
|
||||
nErrCode := FT_FLOPTST( Asc( Upper( cArg1 ) ) - Asc( "A" ) )
|
||||
OutStd( "Return Code is " + hb_ntos( nErrCode ) + hb_eol() )
|
||||
ELSE
|
||||
OutStd( "Usage: floptst cDrive" + hb_eol() + " where cDrive is 'A' or 'B' etc..." + hb_eol() )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
// error code defined by ERR_*
|
||||
FUNCTION FT_FLOPTST( nDriveNum_i /* letter of floppy drive */ )
|
||||
LOCAL cBuffer
|
||||
|
||||
@@ -23,16 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cNum1, cNum2 )
|
||||
|
||||
OutStd( Str( FT_GCD( Val( cNum1 ), Val( cNum2 ) ) ) + hb_eol() )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_GCD( nNumber1, nNumber2 )
|
||||
|
||||
LOCAL nHold1 // Temporarily Hold the Maximum Number
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
hbnf.hbc
|
||||
|
||||
-w3 -es2
|
||||
|
||||
-DFT_TEST
|
||||
@@ -28,16 +28,6 @@
|
||||
|
||||
#define HEXTABLE "0123456789ABCDEF"
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cHexNum )
|
||||
|
||||
QOut( FT_HEX2DEC( cHexNum ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_HEX2DEC( cHexNum )
|
||||
|
||||
LOCAL n, nDec := 0, nHexPower := 1
|
||||
|
||||
@@ -29,27 +29,6 @@
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nLoaded := ft_isshare()
|
||||
|
||||
DO CASE
|
||||
CASE nLoaded == 0
|
||||
QOut( "Share not loaded, but ok to load" )
|
||||
CASE nLoaded == 1
|
||||
QOut( "Share not loaded, but NOT ok to load!" )
|
||||
CASE nLoaded == 255
|
||||
QOut( "Share is loaded!" )
|
||||
ENDCASE
|
||||
|
||||
QOut( "Retcode: " + Str( nLoaded ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION ft_isshare()
|
||||
/*
|
||||
LOCAL aRegs[ INT86_MAX_REGS ] // Declare the register array
|
||||
|
||||
@@ -23,33 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aString := { ;
|
||||
"RTrim('abc ')" ,;
|
||||
"NotARealFunc()" ,;
|
||||
"FT_DispMsg()" ,;
|
||||
'RTrim(cVar+"abc"+Left(cString)), Found()' ,;
|
||||
"IsItLinked()" ,;
|
||||
"lRetVal := Found()" ,;
|
||||
"!EOF() .AND. Month(Date())=12 .AND. YeeHa()" ,;
|
||||
"!EOF() .AND. Month(Date())=12" ,;
|
||||
"!EOF() .AND. Month(Date(YeeHa()))=12" ,;
|
||||
"Left(SubStr(nNum,4,Val(cChar+Asc(c))))" ,;
|
||||
"EOF(>> Note: Syntax IS NOT checked! <<)" }
|
||||
|
||||
CLS
|
||||
@ 1, 0 SAY "String Tested Result"
|
||||
@ 2, 0 TO 2, MaxCol()
|
||||
AEval( aString, {| ele | QOut( ele, Space( 45 - Len( ele ) ), FT_Linked( ele ) ) } )
|
||||
@ MaxRow() - 2, 0
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
// A function is detected by the left parenthesis, "(", and it begins
|
||||
// at the space, comma or start-of-string preceeding the "("
|
||||
|
||||
|
||||
@@ -49,137 +49,6 @@ THREAD STATIC t_nVPos
|
||||
THREAD STATIC t_nMaxRow
|
||||
THREAD STATIC t_nMaxCol
|
||||
|
||||
// BEGINNING OF DEMO PROGRAM
|
||||
#ifdef FT_TEST
|
||||
// DUMMY PROCEDURE NAME SO "CCMDLINE" WILL BE LOCAL
|
||||
|
||||
PROCEDURE Main( cCmdLine )
|
||||
|
||||
LOCAL sDosScrn, nDosRow, nDosCol, lColor
|
||||
|
||||
// my approach to color variables
|
||||
// see colorchg.arc on NANFORUM
|
||||
LOCAL cNormN
|
||||
LOCAL cWindN
|
||||
LOCAL cErrH
|
||||
LOCAL cErrN
|
||||
|
||||
// options on menu bar
|
||||
LOCAL aColors
|
||||
LOCAL aBar := { " ENTER/EDIT ", " REPORTS ", " DISPLAY ", " MAINTENANCE ", " QUIT " }
|
||||
LOCAL aOptions[ Len( aBar ) ]
|
||||
AEval( aBar, {| x, i | HB_SYMBOL_UNUSED( x ), aOptions[ i ] := { {}, {}, {} } } )
|
||||
|
||||
cCmdLine := iif( cCmdLine == NIL, "", cCmdLine )
|
||||
|
||||
lColor := iif( "MONO" $ Upper( cCmdLine ), .F. , IsColor() )
|
||||
|
||||
// Border, Box, Bar, Current, Unselected
|
||||
aColors := iif( lColor, { "W+/G", "N/G", "N/G", "N/W", "N+/G" }, ;
|
||||
{ "W+/N", "W+/N", "W/N", "N/W", "W/N" } )
|
||||
|
||||
FT_FILL( aOptions[ 1 ], "A. Execute A Dummy Procedure" , {|| fubar() }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "B. Enter Daily Charge/Credit Slips" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "C. Enter Payments On Accounts" , {|| .T. }, .F. )
|
||||
FT_FILL( aOptions[ 1 ], "D. Edit Daily Transactions" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "E. Enter/Update Member File" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "F. Update Code File" , {|| .T. }, .F. )
|
||||
FT_FILL( aOptions[ 1 ], "G. Add/Update Auto Charge File" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "H. Post All Transactions To A/R File", {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "I. Increment Next Posting Date" , {|| .T. }, .T. )
|
||||
|
||||
FT_FILL( aOptions[ 2 ], "A. Print Member List" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "B. Print Active Auto Charges" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "C. Print Edit List" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "D. Print Pro-Usage Report" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "E. Print A/R Transaction Report" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "F. Aging Report Preparation" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "G. Add Interest Charges" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "H. Print Aging Report" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "I. Print Monthly Statements" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "J. Print Mailing Labels" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "K. Print Transaction Totals" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "L. Print Transaction Codes File" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "M. Print No-Activity List" , {|| .T. }, .T. )
|
||||
|
||||
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. Accounts Receivable Display" , {|| .T. }, .T. )
|
||||
|
||||
FT_FILL( aOptions[ 4 ], "A. Backup Database Files" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 4 ], "B. Reindex Database Files" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 4 ], "C. Set System Parameters" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 4 ], "D. This EXITs Too" , {|| .F. }, .T. )
|
||||
|
||||
FT_FILL( aOptions[ 5 ], "A. Does Nothing" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 5 ], "B. Exit To DOS" , {|| .F. }, .T. )
|
||||
|
||||
// main routine starts here
|
||||
SET SCOREBOARD OFF
|
||||
|
||||
cNormN := iif( lColor, "N/G" , "W/N" )
|
||||
cWindN := iif( lColor, "W/B" , "W/N" )
|
||||
cErrH := iif( lColor, "W+/R", "W+/N" )
|
||||
cErrN := iif( lColor, "W/R" , "W/N" )
|
||||
|
||||
SAVE SCREEN TO sDosScrn
|
||||
nDosRow := Row()
|
||||
nDosCol := Col()
|
||||
SetColor( "w/n" )
|
||||
CLS
|
||||
NoSnow( "NOSNOW" $ Upper( cCmdLine ) )
|
||||
IF "VGA" $ Upper( cCmdLine )
|
||||
SetMode( 50, 80 )
|
||||
ENDIF
|
||||
t_nMaxRow := MaxRow()
|
||||
SetBlink( .F. )
|
||||
SetColor( cWindN + "*" )
|
||||
CLS
|
||||
SetColor( cNormN )
|
||||
@ t_nMaxRow, 0
|
||||
@ t_nMaxRow, 0 SAY hb_UTF8ToStr( " FT_MENU1 1.0 │ " )
|
||||
@ t_nMaxRow, 16 SAY "WRITTEN BY PAUL FERRARA [76702,556] FOR NANFORUM.LIB"
|
||||
@ t_nMaxRow, 69 SAY hb_UTF8ToStr( "│ " ) + DToC( Date() )
|
||||
|
||||
SetColor( cErrH )
|
||||
@ t_nMaxRow - 11, 23, t_nMaxRow - 3, 56 BOX hb_UTF8ToStr( "┌─┐│┘─└│ " )
|
||||
@ t_nMaxRow - 9, 23 SAY hb_UTF8ToStr( "├────────────────────────────────┤" )
|
||||
SetColor( cErrN )
|
||||
@ t_nMaxRow - 10, 33 SAY "Navigation Keys"
|
||||
@ t_nMaxRow - 8, 25 SAY "LeftArrow RightArrow Alt-E"
|
||||
@ t_nMaxRow - 7, 25 SAY "Home End Alt-R"
|
||||
@ t_nMaxRow - 6, 25 SAY "Tab Shift-Tab Alt-D"
|
||||
@ t_nMaxRow - 5, 25 SAY "PgUp PgDn Alt-M"
|
||||
@ t_nMaxRow - 4, 25 SAY "Enter ESCape Alt-Q"
|
||||
SetColor( cNormN )
|
||||
|
||||
FT_MENU1( aBar, aOptions, aColors )
|
||||
|
||||
SetColor( "W/N" )
|
||||
SetCursor( SC_NORMAL )
|
||||
SetBlink( .T. )
|
||||
IF "VGA" $ Upper( cCmdLine )
|
||||
SetMode( 25, 80 )
|
||||
ENDIF
|
||||
RESTORE SCREEN FROM sDosScrn
|
||||
SetPos( nDosRow, nDosCol )
|
||||
QUIT
|
||||
|
||||
FUNCTION fubar()
|
||||
|
||||
LOCAL OldColor := SetColor( "W/N" )
|
||||
|
||||
CLS
|
||||
QOut( "Press Any Key" )
|
||||
Inkey( 0 )
|
||||
SetColor( OldColor )
|
||||
|
||||
RETURN .T.
|
||||
|
||||
#endif
|
||||
|
||||
// end of demo program
|
||||
|
||||
FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow )
|
||||
|
||||
LOCAL nTtlUsed
|
||||
|
||||
@@ -91,107 +91,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aNames := {}
|
||||
|
||||
Set( _SET_SCOREBOARD, .F. )
|
||||
Set( _SET_COLOR, "W/B" )
|
||||
CLS
|
||||
|
||||
// Demo will create an array of names and display in 3 columns
|
||||
// _ftRow() and _ftCol() will calculate the screen co-ordinates
|
||||
// by evaluating the element number
|
||||
|
||||
AAdd( aNames, "Adams" )
|
||||
AAdd( aNames, "Addams" )
|
||||
AAdd( aNames, "Atoms" )
|
||||
AAdd( aNames, "Adamson" )
|
||||
AAdd( aNames, "Cajun" )
|
||||
AAdd( aNames, "Cagen" )
|
||||
AAdd( aNames, "Cochy" )
|
||||
AAdd( aNames, "Cocci" )
|
||||
AAdd( aNames, "Smith" )
|
||||
AAdd( aNames, "Smythe" )
|
||||
AAdd( aNames, "Naylor" )
|
||||
AAdd( aNames, "Nailer" )
|
||||
AAdd( aNames, "Holberry" )
|
||||
AAdd( aNames, "Wholebary" )
|
||||
AAdd( aNames, "Jackson" )
|
||||
AAdd( aNames, "Jekksen" )
|
||||
AAdd( aNames, "The Source" )
|
||||
AAdd( aNames, "The Sores" )
|
||||
AAdd( aNames, "Jones" )
|
||||
AAdd( aNames, "Johns" )
|
||||
AAdd( aNames, "Lennon" )
|
||||
AAdd( aNames, "Lenin" )
|
||||
AAdd( aNames, "Fischer" )
|
||||
AAdd( aNames, "Fisher" )
|
||||
AAdd( aNames, "O'Donnell" )
|
||||
AAdd( aNames, "O Donald" )
|
||||
AAdd( aNames, "Pugh" )
|
||||
AAdd( aNames, "Pew" )
|
||||
AAdd( aNames, "Heimendinger" )
|
||||
AAdd( aNames, "Hymendinker" )
|
||||
AAdd( aNames, "Knight" )
|
||||
AAdd( aNames, "Nite" )
|
||||
AAdd( aNames, "Lamb" )
|
||||
AAdd( aNames, "Lamb Chops" )
|
||||
AAdd( aNames, "Stephens" )
|
||||
AAdd( aNames, "Stevens" )
|
||||
AAdd( aNames, "Neilson" )
|
||||
AAdd( aNames, "Nelson" )
|
||||
AAdd( aNames, "Tchaikovski" )
|
||||
AAdd( aNames, "Chikofski" )
|
||||
AAdd( aNames, "Caton" )
|
||||
AAdd( aNames, "Wright" )
|
||||
AAdd( aNames, "Write" )
|
||||
AAdd( aNames, "Right" )
|
||||
AAdd( aNames, "Manual" )
|
||||
AAdd( aNames, "Now" )
|
||||
AAdd( aNames, "Wheatabix" )
|
||||
AAdd( aNames, "Science" )
|
||||
AAdd( aNames, "Cinzano" )
|
||||
AAdd( aNames, "Lucy" )
|
||||
AAdd( aNames, "Reece" )
|
||||
AAdd( aNames, "Righetti" )
|
||||
AAdd( aNames, "Oppermann" )
|
||||
AAdd( aNames, "Bookkeeper" )
|
||||
AAdd( aNames, "McGill" )
|
||||
AAdd( aNames, "Magic" )
|
||||
AAdd( aNames, "McLean" )
|
||||
AAdd( aNames, "McLane" )
|
||||
AAdd( aNames, "Maclean" )
|
||||
AAdd( aNames, "Exxon" )
|
||||
|
||||
// display names and metaphones in 3 columns on screen
|
||||
AEval( aNames, ;
|
||||
{| cName, nElem | ;
|
||||
SetPos( _ftRow( nElem ), _ftCol( nElem ) ), ;
|
||||
QQOut( PadR( cName, 18, "." ) + FT_METAPH( cName ) ) ;
|
||||
} )
|
||||
|
||||
SetPos( 21, 00 )
|
||||
QUIT
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
STATIC FUNCTION _ftRow( nElem ) // Determine which row to print on
|
||||
|
||||
RETURN iif( nElem > 40, nElem - 40, iif( nElem > 20, nElem - 20, nElem ) )
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
STATIC FUNCTION _ftCol( nElem ) // Determine which column to start print
|
||||
|
||||
RETURN iif( nElem > 40, 55, iif( nElem > 20, 28, 1 ) )
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
FUNCTION FT_METAPH( cName, nSize )
|
||||
|
||||
@@ -23,45 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
CLS
|
||||
? "am-pm"
|
||||
? ft_civ2mil( " 5:40 pm" )
|
||||
? ft_civ2mil( "05:40 pm" )
|
||||
? ft_civ2mil( " 5:40 PM" )
|
||||
? ft_civ2mil( " 5:40 am" )
|
||||
? ft_civ2mil( "05:40 am" )
|
||||
? ft_civ2mil( " 5:40 AM" )
|
||||
?
|
||||
Inkey( 0 )
|
||||
CLS
|
||||
? "noon-midnight"
|
||||
? ft_civ2mil( "12:00 m" )
|
||||
? ft_civ2mil( "12:00 M" )
|
||||
? ft_civ2mil( "12:00 m" )
|
||||
? ft_civ2mil( "12:00 n" )
|
||||
? ft_civ2mil( "12:00 N" )
|
||||
? ft_civ2mil( "12:00 n" )
|
||||
?
|
||||
Inkey( 0 )
|
||||
CLS
|
||||
? "errors in noon-midnight"
|
||||
? ft_civ2mil( "12:01 n" )
|
||||
? ft_civ2mil( "22:00 n" )
|
||||
? ft_civ2mil( "12:01 m" )
|
||||
? ft_civ2mil( "22:00 n" )
|
||||
?
|
||||
? "sys to mil"
|
||||
? Time()
|
||||
? ft_sys2mil()
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_MIL2MIN( cMILTIME )
|
||||
|
||||
RETURN Int( Val( Left( cMILTIME, 2 ) ) * 60 + Val( Right( cMILTIME, 2 ) ) )
|
||||
|
||||
@@ -5,194 +5,6 @@
|
||||
THREAD STATIC t_lCrsState := .F.
|
||||
THREAD STATIC t_lMinit := .F.
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( nRow, nCol )
|
||||
|
||||
// Pass valid row and column values for different video modes to change modes
|
||||
|
||||
LOCAL nX, nY, cSavClr
|
||||
LOCAL cSavScr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
|
||||
LOCAL nSaveRow := MaxRow() + 1, nSaveCol := MaxCol() + 1
|
||||
LOCAL nMinor, nType, nIRQ
|
||||
LOCAL aType := { "Bus", "Serial", "InPort", "PS/2", "HP" }
|
||||
LOCAL nHoriz, nVert, nDouble
|
||||
|
||||
IF nRow == NIL
|
||||
nRow := MaxRow() + 1
|
||||
ELSE
|
||||
nRow := Val( nRow )
|
||||
ENDIF
|
||||
|
||||
IF nCol == NIL
|
||||
nCol := MaxCol() + 1
|
||||
ELSE
|
||||
nCol := Val( nCol )
|
||||
ENDIF
|
||||
|
||||
IF !FT_MINIT()
|
||||
@ MaxRow(), 0 SAY "Mouse driver is not installed!"
|
||||
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
// ..... Set up the screen
|
||||
cSavClr := SetColor( "w/n" )
|
||||
@ 0, 0, MaxRow(), MaxCol() BOX hb_UTF8ToStr( "░░░░░░░░░" )
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
// Scroll( 7, 2, 19, 63, 0 )
|
||||
@ 7, 2 TO 20, 63
|
||||
|
||||
@ 17, 10 TO 19, 40 double
|
||||
|
||||
SetColor( "N/W" )
|
||||
@ 18, 11 SAY " Double Click here to Quit "
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
|
||||
// ..... Start the demo
|
||||
|
||||
@ MaxRow(), 0 SAY "Driver version: " + ;
|
||||
AllTrim( Str( FT_MVERSION( @nMinor, @nType, @nIRQ ), 2, 0 ) ) + "." + ;
|
||||
AllTrim( Str( nMinor, 2, 0 ) )
|
||||
@ Row(), Col() SAY " " + aType[ nType ] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
|
||||
|
||||
FT_MGETSENS( @nHoriz, @nVert, @nDouble ) // Get the current sensitivities
|
||||
FT_MSETSENS( 70, 70, 60 ) // Bump up the sensitivity of the mouse
|
||||
|
||||
FT_MSHOWCRS()
|
||||
FT_MSETCOORD( 10, 20 ) // just an arbitrary place for demo
|
||||
|
||||
// put the unchanging stuff
|
||||
|
||||
DevPos( 9, 10 )
|
||||
DevOut( "FT_MMICKEYS :" )
|
||||
|
||||
DevPos( 10, 10 )
|
||||
DevOut( "FT_MGETPOS :" )
|
||||
|
||||
DevPos( 11, 10 )
|
||||
DevOut( "FT_MGETX :" )
|
||||
|
||||
DevPos( 12, 10 )
|
||||
DevOut( "FT_MGETY :" )
|
||||
|
||||
DevPos( 13, 10 )
|
||||
DevOut( "FT_MGETCOORD:" )
|
||||
|
||||
DevPos( 14, 10 )
|
||||
DevOut( "FT_MBUTPRS :" )
|
||||
|
||||
DevPos( 16, 10 )
|
||||
DevOut( "FT_MBUTREL :" )
|
||||
|
||||
nX := nY := 1
|
||||
DO WHILE .T.
|
||||
|
||||
// If we are not moving then wait for movement.
|
||||
// This whole demo is a bit artificial in its requirements when compared
|
||||
// to a "normal" CLIPPER program so some of these examples are a bit out of
|
||||
// the ordinary.
|
||||
|
||||
DO WHILE nX == 0 .AND. nY == 0
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
// tell the mouse driver where updates will be taking place so it can hide
|
||||
// the cursor when necessary.
|
||||
|
||||
FT_MCONOFF( 9, 23, 16, 53 )
|
||||
|
||||
DevPos( 9, 23 )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 10, 23 )
|
||||
DevOut( FT_MGETPOS( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 11, 23 )
|
||||
DevOut( FT_MGETX() )
|
||||
|
||||
DevPos( 12, 23 )
|
||||
DevOut( FT_MGETY() )
|
||||
|
||||
DevPos( 13, 23 )
|
||||
DevOut( FT_MGETCOORD( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 14, 23 )
|
||||
DevOut( FT_MBUTPRS( 1 ) )
|
||||
DevOut( FT_MBUTPRS( 0,, nX, nY ) )
|
||||
DevPos( 15, 23 )
|
||||
|
||||
// show only the last Press since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 16, 23 )
|
||||
DevOut( FT_MBUTREL( 0,, @nX, @nY ) )
|
||||
|
||||
// show only the last release since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
// Restore the cursor if it has been hidden
|
||||
|
||||
FT_MSHOWCRS()
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
IF FT_MDBLCLK( 2, 0, 0.8 )
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
ELSE
|
||||
|
||||
// Put the cursor back to normal mode
|
||||
|
||||
FT_MDEFCRS( 0, 30719, 30464 )
|
||||
ENDIF
|
||||
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
|
||||
FT_MHIDECRS()
|
||||
|
||||
SetMode( nSaveRow, nSaveCol )
|
||||
SetColor( cSavClr )
|
||||
RestScreen( 0, 0, MaxRow(), MaxCol(), cSavScr )
|
||||
DevPos( MaxRow(), 0 )
|
||||
|
||||
// Reset sensitivity
|
||||
|
||||
FT_MSETSENS( nHoriz, nVert, nDouble )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_MMICKEYS( nX, nY ) // read mouse motion counters
|
||||
/*
|
||||
aReg[ AX ] := 11 // set mouse function call 11
|
||||
|
||||
@@ -69,200 +69,6 @@ THREAD STATIC t_aReg[ 10 ]
|
||||
THREAD STATIC t_lCrsState := .F.
|
||||
THREAD STATIC t_lMinit := .F.
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
// Pass valid row and column values for different video modes to change modes
|
||||
|
||||
PROCEDURE Main( nRow, nCol )
|
||||
|
||||
LOCAL nX, nY, cSavClr
|
||||
LOCAL cSavScr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
|
||||
LOCAL nSaveRow := MaxRow() + 1, nSaveCol := MaxCol() + 1
|
||||
LOCAL nMinor, nType, nIRQ
|
||||
LOCAL aType := { "Bus", "Serial", "InPort", "PS/2", "HP" }
|
||||
LOCAL nHoriz, nVert, nDouble
|
||||
|
||||
IF nRow == NIL
|
||||
nRow := MaxRow() + 1
|
||||
ELSE
|
||||
nRow := Val( nRow )
|
||||
ENDIF
|
||||
|
||||
IF nCol == NIL
|
||||
nCol := MaxCol() + 1
|
||||
ELSE
|
||||
nCol := Val( nCol )
|
||||
ENDIF
|
||||
|
||||
IF ! SetMode( nRow, nCol )
|
||||
@ MaxRow(), 0 SAY "Mode Change unsuccessful:" + Str( nRow, 2, 0 ) + " by";
|
||||
+ Str( nCol, 3, 0 )
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
IF Empty( FT_MINIT() )
|
||||
@ MaxRow(), 0 SAY "Mouse driver is not installed!"
|
||||
SetMode( nSaveRow, nSaveCol )
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
// ..... Set up the screen
|
||||
cSavClr := SetColor( "w/n" )
|
||||
@ 0, 0, MaxRow(), MaxCol() BOX hb_UTF8ToStr( "░░░░░░░░░" )
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
Scroll( 7, 2, 19, 63, 0 )
|
||||
@ 7, 2 TO 20, 63
|
||||
|
||||
@ 17, 10 TO 19, 40 double
|
||||
|
||||
SetColor( "N/W" )
|
||||
@ 18, 11 SAY " Double Click here to Quit "
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
|
||||
// ..... Start the demo
|
||||
|
||||
@ MaxRow(), 0 SAY "Driver version: " + ;
|
||||
AllTrim( Str( FT_MVERSION( @nMinor, @nType, @nIRQ ), 2, 0 ) ) + "." + ;
|
||||
AllTrim( Str( nMinor, 2, 0 ) )
|
||||
@ Row(), Col() SAY " " + aType[ nType ] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
|
||||
|
||||
FT_MGETSENS( @nHoriz, @nVert, @nDouble ) // Get the current sensitivities
|
||||
FT_MSETSENS( 70, 70, 60 ) // Bump up the sensitivity of the mouse
|
||||
|
||||
FT_MSHOWCRS()
|
||||
FT_MSETCOORD( 10, 20 ) // just an arbitrary place for demo
|
||||
|
||||
// put the unchanging stuff
|
||||
|
||||
DevPos( 9, 10 )
|
||||
DevOut( "FT_MMICKEYS :" )
|
||||
|
||||
DevPos( 10, 10 )
|
||||
DevOut( "FT_MGETPOS :" )
|
||||
|
||||
DevPos( 11, 10 )
|
||||
DevOut( "FT_MGETX :" )
|
||||
|
||||
DevPos( 12, 10 )
|
||||
DevOut( "FT_MGETY :" )
|
||||
|
||||
DevPos( 13, 10 )
|
||||
DevOut( "FT_MGETCOORD:" )
|
||||
|
||||
DevPos( 14, 10 )
|
||||
DevOut( "FT_MBUTPRS :" )
|
||||
|
||||
DevPos( 16, 10 )
|
||||
DevOut( "FT_MBUTREL :" )
|
||||
|
||||
nX := nY := 1
|
||||
DO WHILE .T.
|
||||
|
||||
// If we are not moving then wait for movement.
|
||||
// This whole demo is a bit artificial in its requirements when compared
|
||||
// to a "normal" CLIPPER program so some of these examples are a bit out of
|
||||
// the ordinary.
|
||||
|
||||
DO WHILE nX == 0 .AND. nY == 0
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
// tell the mouse driver where updates will be taking place so it can hide
|
||||
// the cursor when necessary.
|
||||
|
||||
FT_MCONOFF( 9, 23, 16, 53 )
|
||||
|
||||
DevPos( 9, 23 )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 10, 23 )
|
||||
DevOut( FT_MGETPOS( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 11, 23 )
|
||||
DevOut( FT_MGETX() )
|
||||
|
||||
DevPos( 12, 23 )
|
||||
DevOut( FT_MGETY() )
|
||||
|
||||
DevPos( 13, 23 )
|
||||
DevOut( FT_MGETCOORD( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 14, 23 )
|
||||
DevOut( FT_MBUTPRS( 1 ) )
|
||||
DevOut( FT_MBUTPRS( 0,, nX, nY ) )
|
||||
DevPos( 15, 23 )
|
||||
|
||||
// show only the last Press since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 16, 23 )
|
||||
DevOut( FT_MBUTREL( 0,, @nX, @nY ) )
|
||||
|
||||
// show only the last release since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
// Restore the cursor if it has been hidden
|
||||
|
||||
FT_MSHOWCRS()
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
IF FT_MDBLCLK( 2, 0, 0.8 )
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
ELSE
|
||||
|
||||
// Put the cursor back to normal mode
|
||||
|
||||
FT_MDEFCRS( 0, 30719, 30464 )
|
||||
ENDIF
|
||||
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
|
||||
FT_MHIDECRS()
|
||||
|
||||
SetMode( nSaveRow, nSaveCol )
|
||||
SetColor( cSavClr )
|
||||
RestScreen( 0, 0, MaxRow(), MaxCol(), cSavScr )
|
||||
DevPos( MaxRow(), 0 )
|
||||
|
||||
// Reset sensitivity
|
||||
|
||||
FT_MSETSENS( nHoriz, nVert, nDouble )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_MINIT()
|
||||
|
||||
// If not previously initialized then try
|
||||
|
||||
@@ -23,16 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
? FT_NETPV( 10000, 10, { 10000, 15000, 16000, 17000 } )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_NETPV( nInitialInvestment, nInterestRate, aCashFlow, nNoOfCashFlows )
|
||||
|
||||
LOCAL nNetPresentValue := 0
|
||||
|
||||
@@ -35,16 +35,6 @@ STATIC sc_tens := { "", "", " Twenty", " Thirty", " Forty", " Fifty", ;
|
||||
|
||||
STATIC sc_qualifiers := { "", " Thousand", " Million", " Billion", " Trillion" }
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cNum )
|
||||
|
||||
QOut( ft_ntow( Val( cNum ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION ft_ntow( nAmount )
|
||||
|
||||
LOCAL nTemp, sResult := " ", nQualNo
|
||||
|
||||
@@ -29,16 +29,6 @@
|
||||
#define DOS 33
|
||||
#define STATNUM 220
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "Logical station: " + Str( FT_NWLSTAT() ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_NWLSTAT()
|
||||
|
||||
// LOCAL aRegs[ INT86_MAX_REGS ]
|
||||
|
||||
@@ -48,56 +48,6 @@
|
||||
// Sorry this test routine is pretty lame but it sort of gets
|
||||
// the point across
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
#define INITIAL_SEMAPHORE_VALUE 2
|
||||
#define WAIT_SECONDS 1
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nInitVal, nRc, nHandle, nValue, nOpenCnt
|
||||
|
||||
CLS
|
||||
|
||||
nInitVal := INITIAL_SEMAPHORE_VALUE
|
||||
FT_NWSEMOPEN( "TEST", nInitVal, @nHandle, @nOpenCnt )
|
||||
|
||||
QOut( "Waiting ten seconds..." )
|
||||
nRc := ft_nwSemWait( nHandle, 180 )
|
||||
QOut( "Final nRc value = " + Str( nRc ) )
|
||||
Inkey( 0 )
|
||||
IF nRc == 254
|
||||
QOut( "Couldn't get the semaphore. Try again." )
|
||||
QUIT
|
||||
ENDIF
|
||||
|
||||
CLS
|
||||
|
||||
@ 24, 0 SAY "Any key to exit"
|
||||
@ 0, 0 SAY "Handle: " + Str( nHandle )
|
||||
|
||||
ft_nwSemEx( nHandle, @nValue, @nOpenCnt )
|
||||
WHILE .T.
|
||||
@ 23, 0 SAY "Semaphore test -> Open at [" + ;
|
||||
hb_ntos( nOpenCnt ) + ;
|
||||
"] stations, value is [" + ;
|
||||
hb_ntos( nValue ) + "]"
|
||||
|
||||
IF Inkey( WAIT_SECONDS ) != 0
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
Tone( nHandle, .5 )
|
||||
ft_nwSemEx( nHandle, @nValue, @nOpenCnt )
|
||||
ENDDO
|
||||
|
||||
QOut( "Signal returns: " + Str( ft_nwsemSig( nHandle ) ) )
|
||||
QOut( "Close returns: " + Str( ft_nwsemClose( nHandle ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt )
|
||||
|
||||
LOCAL aRegs[ INT86_MAX_REGS ], cRequest, nRet
|
||||
|
||||
@@ -36,26 +36,6 @@
|
||||
#define DOS 33
|
||||
#define NW_LOG 227
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL x, cUid
|
||||
|
||||
QOut( "I am: [" + FT_NWUID() + "]" )
|
||||
QOut( "---------------------" )
|
||||
|
||||
FOR x := 1 TO 100
|
||||
cUid := FT_NWUID( x )
|
||||
IF ! Empty( cUid )
|
||||
QOut( Str( x, 3 ) + Space( 3 ) + cUid )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_NWUID( nConn )
|
||||
|
||||
LOCAL aRegs[ INT86_MAX_REGS ]
|
||||
|
||||
@@ -20,22 +20,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
@ 0, 0 CLEAR
|
||||
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.
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_PENDING( cMsg, nRow, nCol, nWait, cColor )
|
||||
|
||||
THREAD STATIC t_nLast_Time := 0
|
||||
|
||||
@@ -24,16 +24,6 @@
|
||||
*/
|
||||
|
||||
// test code
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "You selected " + FT_PICKDAY() )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_PICKDAY()
|
||||
|
||||
LOCAL days := { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", ;
|
||||
|
||||
@@ -114,50 +114,6 @@ THREAD STATIC t_nWinColor
|
||||
THREAD STATIC t_aWinColor
|
||||
THREAD STATIC t_aStdColor
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nSickHrs := 0
|
||||
LOCAL nPersHrs := 0
|
||||
LOCAL nVacaHrs := 0
|
||||
LOCAL GetList := {}
|
||||
|
||||
SET SCOREBOARD OFF
|
||||
_ftSetScrColor( STD_SCREEN, STD_VARIABLE )
|
||||
CLS
|
||||
|
||||
SET KEY K_ALT_A TO FT_Adder // Make <ALT-A> call FT_Adder
|
||||
|
||||
// SIMPLE Sample of program data entry!
|
||||
|
||||
@ 12, 5 SAY "Please enter the total Sick, Personal, and Vacation hours."
|
||||
@ 15, 22 SAY "Sick hrs."
|
||||
@ 15, 40 SAY "Pers. hrs."
|
||||
@ 15, 60 SAY "Vaca. hrs."
|
||||
@ 23, 20 SAY "Press <ALT-A> to Pop - Up the Adder."
|
||||
@ 24, 20 SAY "Press <ESC> to Quit the adder Demo."
|
||||
DO WHILE .T. // Get the sick, personal, & vaca
|
||||
@ 16, 24 GET nSickHrs PICTURE "9999.999" // Normally I have a VALID()
|
||||
@ 16, 43 GET nPersHrs PICTURE "9999.999" // to make sure the value is
|
||||
@ 16, 63 GET nVacaHrs PICTURE "9999.999" // within the allowable range.
|
||||
SET CURSOR ON // But, like I said it is a
|
||||
CLEAR TYPEAHEAD // SIMPLE example <g>.
|
||||
READ
|
||||
SET CURSOR OFF
|
||||
IF LastKey() == K_ESC // <ESC> - ABORT
|
||||
CLEAR TYPEAHEAD
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDDO
|
||||
SET CURSOR ON
|
||||
|
||||
SET KEY K_ALT_A // Reset <ALT-A>
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
/*+- Function ---------------------------------------------------------------+
|
||||
| Name: FT_Adder() Docs: Keith A. Wire |
|
||||
| Description: Pop Up Adder / Calculator with Tape Display |
|
||||
|
||||
@@ -23,26 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cParm1 )
|
||||
|
||||
//-------------------------------------------------------
|
||||
// Sample routine to test function from command line
|
||||
//-------------------------------------------------------
|
||||
|
||||
IF PCount() > 0
|
||||
? FT_ESCCODE( cParm1 )
|
||||
ELSE
|
||||
? "Usage: PRT_ESC 'escape code sequence' "
|
||||
? " outputs converted code to standard output"
|
||||
?
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_ESCCODE( cInput )
|
||||
|
||||
LOCAL cOutput := ""
|
||||
|
||||
@@ -23,25 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
// Write 100 random numbers from 1 to 100 to stdout.
|
||||
// Run it multiple times and redirect output to a file
|
||||
// to check it
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL x
|
||||
|
||||
FOR x := 1 TO 100
|
||||
OutStd( Int( ft_rand1(100 ) ) )
|
||||
OutStd( hb_eol() )
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION ft_rand1( nMax )
|
||||
|
||||
THREAD STATIC t_nSeed
|
||||
|
||||
@@ -32,50 +32,6 @@
|
||||
|
||||
MEMVAR lRet
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aArray := {;
|
||||
{ "Invoice 1", SToD( "19910415" ), 1234.32, .T. }, ;
|
||||
{ "Invoice 2", Date(), 234.98, .F. }, ;
|
||||
{ "Invoice 3", Date() + 1, 0, .T. } }, aSave
|
||||
LOCAL nErrorCode := 0
|
||||
|
||||
FT_SAVEARR( aArray, "invoice.dat", @nErrorCode )
|
||||
IF nErrorCode == 0
|
||||
CLS
|
||||
DispArray( aArray )
|
||||
aSave := FT_RESTARR( "invoice.dat", @nErrorCode )
|
||||
IF nErrorCode == 0
|
||||
DispArray( aSave )
|
||||
ELSE
|
||||
? "Error restoring array"
|
||||
ENDIF
|
||||
ELSE
|
||||
? "Error writing array"
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
FUNCTION DispArray( aTest )
|
||||
|
||||
LOCAL nk
|
||||
|
||||
FOR nk := 1 TO Len( aTest )
|
||||
? aTest[ nk, 1 ]
|
||||
?? " "
|
||||
?? DToC( aTest[ nk, 2 ] )
|
||||
?? " "
|
||||
?? Str( aTest[ nk, 3 ] )
|
||||
?? " "
|
||||
?? iif( aTest[ nk, 4 ], "true", "false" )
|
||||
NEXT
|
||||
|
||||
RETURN NIL
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_SAVEARR( aArray, cFileName, nErrorCode )
|
||||
|
||||
LOCAL nHandle, lRet
|
||||
|
||||
@@ -32,20 +32,6 @@
|
||||
#define FT_SET_CENTURY _SET_COUNT + 1
|
||||
#define FT_SET_BLINK _SET_COUNT + 2
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aSets := FT_SAVESETS()
|
||||
|
||||
HB_SYMBOL_UNUSED( aSets )
|
||||
|
||||
Inkey( 0 )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_SAVESETS()
|
||||
|
||||
LOCAL aOldSets := Array( _SET_COUNT + FT_EXTRA_SETS )
|
||||
|
||||
@@ -28,29 +28,6 @@
|
||||
|
||||
#include "ftint86.ch"
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
#define SCANCODE_ESCAPE ( hb_BChar( 27 ) + hb_BChar( 1 ) )
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cKey
|
||||
|
||||
CLS
|
||||
QOut( "Press any key, ESCape to exit:" )
|
||||
|
||||
DO WHILE .T.
|
||||
cKey := FT_SCANCODE()
|
||||
QOut( Str( hb_BCode( hb_BSubStr( cKey, 1, 1 ) ), 3 ) + ", " + Str( hb_BCode( hb_BSubStr( cKey, 2, 1 ) ), 3 ) + hb_eol() )
|
||||
IF cKey == SCANCODE_ESCAPE
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDDO
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
#define KEYB 22
|
||||
|
||||
FUNCTION FT_SCANCODE()
|
||||
|
||||
@@ -32,19 +32,6 @@
|
||||
#define DOS 33
|
||||
#define SETDATE 43
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cDate )
|
||||
|
||||
cDate := iif( cDate == NIL, DToC( Date() ), cDate )
|
||||
QOut( "Setting date to: " + cDate + "... " )
|
||||
FT_SETDATE( CToD( cDate ) )
|
||||
QOut( "Today is now: " + DToC( Date() ) )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_SETDATE( dDate )
|
||||
|
||||
LOCAL aRegs[ INT86_MAX_REGS ]
|
||||
|
||||
@@ -32,22 +32,9 @@
|
||||
#define DOS 33
|
||||
#define SETTIME 45
|
||||
|
||||
#define SECS( ts ) ( val( substr( ts, 7 ) ) )
|
||||
#define HRS( ts ) ( val( substr( ts, 1, 2 ) ) )
|
||||
#define MINS( ts ) ( val( substr( ts, 4, 2 ) ) )
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cTime )
|
||||
|
||||
cTime := iif( cTime == NIL, Time(), cTime )
|
||||
QOut( "Setting time to: " + cTime + "... " )
|
||||
FT_SETTIME( cTime )
|
||||
QOut( "Time is now: " + Time() )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
#define SECS( ts ) ( Val( SubStr( ts, 7 ) ) )
|
||||
#define HRS( ts ) ( Val( SubStr( ts, 1, 2 ) ) )
|
||||
#define MINS( ts ) ( Val( SubStr( ts, 4, 2 ) ) )
|
||||
|
||||
FUNCTION FT_SETTIME( cTime )
|
||||
|
||||
|
||||
@@ -20,21 +20,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
// Test routine
|
||||
// Invoke by running SLEEP 1.0 to sleep 1.0 seconds
|
||||
|
||||
PROCEDURE Main( nSleep )
|
||||
|
||||
? "Time is now: " + Time()
|
||||
FT_SLEEP( Val( nSleep ) )
|
||||
? "Time is now: " + Time()
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_SLEEP( nSeconds, nInitial )
|
||||
|
||||
IF ! HB_ISNUMERIC( nInitial )
|
||||
|
||||
@@ -33,16 +33,6 @@
|
||||
|
||||
#define MEMSIZE 18
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "Conventional memory: " + Str( FT_SYSMEM() ) + "K installed" )
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
FUNCTION FT_SYSMEM()
|
||||
|
||||
LOCAL aRegs[ INT86_MAX_REGS ]
|
||||
|
||||
@@ -59,113 +59,6 @@
|
||||
#include "set.ch"
|
||||
#include "setcurs.ch"
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
/*
|
||||
* THIS DEMO SHOWS tbnames.dbf CONSISTING OF LAST, FIRST, ADDR, CITY,
|
||||
* STATE, ZIP WITH ACTIVE INDEX ON LAST + FIRST. IT SHOWS LAST NAME,
|
||||
* FIRST NAME, CITY ONLY FOR THOSE LAST NAMES THAT BEGIN WITH LETTER
|
||||
* THAT YOU INPUT FOR THE CKEY GET.
|
||||
*
|
||||
* tbnames.dbf/.ntx ARE AUTOMATICALLY CREATED BY THIS TEST PROGRAM
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aFields := {}, cKey := "O", cOldColor
|
||||
LOCAL nFreeze := 1, lSaveScrn := .T. , nRecSel
|
||||
LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R"
|
||||
LOCAL cColorShad := "N/N"
|
||||
FIELD last, first
|
||||
MEMVAR GetList
|
||||
|
||||
IF ! hb_FileExists( "tbnames.dbf" )
|
||||
MAKE_DBF()
|
||||
ENDIF
|
||||
|
||||
USE TBNames
|
||||
|
||||
IF ! hb_FileExists( "tbnames.ntx" )
|
||||
INDEX ON last + first TO TBNAMES
|
||||
ENDIF
|
||||
|
||||
SET INDEX TO TBNAMES
|
||||
|
||||
// Pass Heading as character and Field as Block including Alias
|
||||
// To eliminate the need to use FIELDWBLOCK() function in FT_BRWSWHL()
|
||||
|
||||
AAdd( aFields, { "Last Name" , {|| TBNames->Last } } )
|
||||
AAdd( aFields, { "First Name", {|| TBNames->First } } )
|
||||
AAdd( aFields, { "City" , {|| TBNames->City } } )
|
||||
|
||||
cOldColor := SetColor( "N/BG" )
|
||||
CLS
|
||||
@ 5, 10 SAY "Enter First Letter Of Last Name:" GET cKey PICTURE "!"
|
||||
READ
|
||||
|
||||
// TBNames->Last = cKey is the Conditional Block passed to this function
|
||||
// you can make it as complicated as you want, but you would then
|
||||
// have to modify TBWhileSet() to find first and last records
|
||||
// matching your key.
|
||||
nRecSel := FT_BRWSWHL( aFields, {|| TBNames->Last = cKey }, cKey, nFreeze, ;
|
||||
lSaveScrn, cColorList, cColorShad, 3, 6, MaxRow() - 2, MaxCol() - 6 )
|
||||
// Note you can use Compound Condition
|
||||
// such as cLast =: "Pierce " and cFirst =: "Hawkeye "
|
||||
// by changing above block to:
|
||||
// {|| TBNames->Last = cLast .AND. TBNames->First = cFirst }
|
||||
// and setting cKey := cLast + cFirst
|
||||
|
||||
?
|
||||
IF nRecSel == 0
|
||||
? "Sorry, NO Records Were Selected"
|
||||
ELSE
|
||||
? "You Selected " + TBNames->Last + " " + ;
|
||||
TBNames->First + " " + TBNames->City
|
||||
ENDIF
|
||||
?
|
||||
|
||||
WAIT
|
||||
SetColor( cOldColor )
|
||||
CLS
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC FUNCTION make_dbf()
|
||||
|
||||
LOCAL x, aData := { ;
|
||||
{ "SHAEFER", "KATHRYN", "415 WEST CITRUS ROAD #150", "LOS ANGELES", "CA", "90030" }, ;
|
||||
{ "OLSON", "JAMES", "225 NORTH RANCH ROAD", "LOS ANGELES", "CA", "90023" }, ;
|
||||
{ "KAYBEE", "JOHN", "123 SANDS ROAD", "CAMARILLO", "CA", "93010" }, ;
|
||||
{ "HERMAN", "JIM", "123 TOON PAGE ROAD", "VENTURA", "CA", "93001" }, ;
|
||||
{ "BURNS", "FRANK", "123 VIRGINA STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "PIERCE", "HAWKEYE", "123 OLD TOWN ROAD", "PORT MUGU", "CA", "93043" }, ;
|
||||
{ "MORGAN", "JESSICA", "123 FRONTAGE ROAD", "CAMARILLO", "CA", "93010" }, ;
|
||||
{ "POTTER", "ROBERT", "123 FIR STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "WORTH", "MARY", "123-1/2 JOHNSON DRIVE", "OXNARD", "CA", "93033" }, ;
|
||||
{ "JOHNSON", "SUSAN", "123 QUEENS STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "SAMSON", "SAM", "215 MAIN STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "NEWNAME", "JAMES", "215 MAIN STREET", "LOS ANGELES", "CA", "90000" }, ;
|
||||
{ "OLEANDAR", "JILL", "425 FLORAL PARK DRIVE", "FLORAL PARK", "NY", "10093" }, ;
|
||||
{ "SUGARMAN", "CANDY", "1541 SWEETHEART ROAD", "HERSHEY", "PA", "10132" } }
|
||||
|
||||
dbCreate( "TBNAMES", {;
|
||||
{ "LAST ", "C", 18, 0, } , ;
|
||||
{ "FIRST", "C", 9, 0, } , ;
|
||||
{ "ADDR ", "C", 28, 0, } , ;
|
||||
{ "CITY ", "C", 21, 0, } , ;
|
||||
{ "STATE", "C", 2, 0, } , ;
|
||||
{ "ZIP ", "C", 9, 0, } } )
|
||||
USE tbnames
|
||||
FOR x := 1 TO Len( aData )
|
||||
APPEND BLANK
|
||||
AEval( aData[ x ], {| e, n | FieldPut( n, e ) } )
|
||||
NEXT
|
||||
USE
|
||||
|
||||
RETURN NIL
|
||||
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------- */
|
||||
|
||||
FUNCTION FT_BRWSWHL( aFields, bWhileCond, cKey, nFreeze, lSaveScrn, ;
|
||||
|
||||
@@ -112,24 +112,3 @@ FUNCTION FT_TEMPFIL( cPath, lHide, nHandle )
|
||||
RETURN cFile
|
||||
|
||||
#endif /* FT_TEMPFILE_ORIGINAL */
|
||||
|
||||
#ifdef FT_TEST
|
||||
|
||||
PROCEDURE Main( cPath, cHide )
|
||||
|
||||
LOCAL cFile, nHandle
|
||||
|
||||
cFile := FT_TEMPFIL( cPath, ( cHide == "Y" ) )
|
||||
|
||||
IF ! Empty( cFile )
|
||||
QOut( cFile )
|
||||
nHandle := FOpen( cFile, FO_WRITE )
|
||||
FWrite( nHandle, "This is a test!" )
|
||||
FClose( nHandle )
|
||||
ELSE
|
||||
QOut( "An error occurred" )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
#endif
|
||||
|
||||
42
harbour/contrib/hbnf/tests/aading.prg
Normal file
42
harbour/contrib/hbnf/tests/aading.prg
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aList1, aList2, var0, nstart, nstop, nelapsed, nCtr
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AADDITION"
|
||||
?
|
||||
aList1 := { "apple", "orange", "pear" }
|
||||
aList2 := { "apple ", "banana", "PEAR" }
|
||||
? "aList1 : "
|
||||
AEval( aList1, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
? "aList2 : "
|
||||
AEval( aList2, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
|
||||
nstart := Seconds()
|
||||
FOR nCtr := 1 TO 100
|
||||
var0 := FT_AADDITION( aList1, aList2 )
|
||||
NEXT
|
||||
nstop := Seconds()
|
||||
nelapsed := nstop - nstart
|
||||
? "time for 100 merges:", nelapsed
|
||||
|
||||
? PadR( "FT_AADDITION( aList1, aList2 ) ->", 44 )
|
||||
AEval( var0, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
var0 := FT_AADDITION( aList1, aList2, , .F. )
|
||||
? PadR( "FT_AADDITION( aList1, aList2, , .F. ) ->", 44 )
|
||||
AEval( var0, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
var0 := FT_AADDITION( aList1, aList2, .F. , .F. )
|
||||
? PadR( "FT_AADDITION( aList1, aList2, .F., .F. ) ->", 44 )
|
||||
AEval( var0, {| x | QQOut( x + "," ) } )
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
32
harbour/contrib/hbnf/tests/aemaxlen.prg
Normal file
32
harbour/contrib/hbnf/tests/aemaxlen.prg
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL var0, myarray1 := Directory()
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMAXLEN"
|
||||
?
|
||||
? "myarray1 := DIRECTORY()"
|
||||
?
|
||||
var0 := FT_AEMAXLEN( myarray1 )
|
||||
? PadR( "FT_AEMAXLEN( myarray1 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMAXLEN( myarray1, 2 )
|
||||
? PadR( "FT_AEMAXLEN( myarray1, 2 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMAXLEN( myarray1, 3 )
|
||||
? PadR( "FT_AEMAXLEN( myarray1, 3 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMAXLEN( ATail( myarray1 ) )
|
||||
? PadR( "FT_AEMAXLEN( aTail( myarray1 ) ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
35
harbour/contrib/hbnf/tests/aeminlen.prg
Normal file
35
harbour/contrib/hbnf/tests/aeminlen.prg
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL var0, myarray1 := Directory()
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMINLEN"
|
||||
?
|
||||
? "myarray1 := DIRECTORY()"
|
||||
?
|
||||
AEval( myarray1, {| v | QOut( PadR( v[ 1 ], 12 ), v[ 2 ], v[ 3 ], v[ 4 ], v[ 5 ] ) } )
|
||||
var0 := FT_AEMINLEN( myarray1 )
|
||||
? PadR( "FT_AEMINLEN( myarray1 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AEMINLEN( myarray1, 2 )
|
||||
? PadR( "FT_AEMINLEN( myarray1, 2 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
?
|
||||
var0 := FT_AEMINLEN( myarray1[ 2 ] )
|
||||
? PadR( "FT_AEMINLEN( myarray1[ 2 ] ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
?
|
||||
var0 := FT_AEMINLEN( myarray1, 3 )
|
||||
? PadR( "FT_AEMINLEN( myarray1, 3 ) ->", 30 )
|
||||
?? var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
33
harbour/contrib/hbnf/tests/amedian.prg
Normal file
33
harbour/contrib/hbnf/tests/amedian.prg
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "directry.ch"
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL var0, myarray0 := Directory(), myarray1 := {}
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AMEDIAN"
|
||||
?
|
||||
AEval( myarray0, {| x | AAdd( myarray1, x[ F_SIZE ] ) } )
|
||||
var0 := FT_AMEDIAN( myarray1 )
|
||||
? PadR( "FT_AMEDIAN( myarray1 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AMEDIAN( myarray1, 2 )
|
||||
? PadR( "FT_AMEDIAN( myarray1, 2 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AMEDIAN( myarray1, , 9 )
|
||||
? PadR( "FT_AMEDIAN( myarray1, , 9 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
var0 := FT_AMEDIAN( myarray1, 8, 40 )
|
||||
? PadR( "FT_AMEDIAN( myarray1, 8, 40 ) ->", 35 )
|
||||
?? var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
67
harbour/contrib/hbnf/tests/aredit.prg
Normal file
67
harbour/contrib/hbnf/tests/aredit.prg
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
// Thanks to Jim Gale for helping me understand the basics
|
||||
LOCAL i, ar[ 3, 26 ], aBlocks[ 3 ], aHeadings, nElem := 1, bGetFunc, cRet
|
||||
// set up 2 dimensional array ar[]
|
||||
FOR i := 1 TO 26
|
||||
ar[ 1, i ] := i // 1 -> 26 Numeric
|
||||
ar[ 2, i ] := Chr( Asc( "A" ) + i - 1 ) // "A" -> "Z" Character
|
||||
ar[ 3, i ] := Chr( Asc( "Z" ) - i + 1 ) // "Z" -> "A" Character
|
||||
NEXT i
|
||||
// Set Up aHeadings[] for column headings
|
||||
aHeadings := { "Numbers", "Letters", "Reverse" }
|
||||
// Set Up Blocks Describing Individual Elements in Array ar[]
|
||||
aBlocks[ 1 ] := {|| Str( ar[ 1, nElem ], 2 ) } // to prevent default 10 spaces
|
||||
aBlocks[ 2 ] := {|| ar[ 2, nElem ] }
|
||||
aBlocks[ 3 ] := {|| ar[ 3, nElem ] }
|
||||
// Set up TestGet() as bGetFunc
|
||||
bGetFunc := {| b, ar, nDim, nElem | TestGet( b, ar, nDim, nElem ) }
|
||||
|
||||
SET SCOREBOARD OFF
|
||||
SetColor( "W/N" )
|
||||
CLS
|
||||
@ 21, 4 SAY "Use Cursor Keys To Move Between Fields, <F7> = Delete Row, <F8> = Add Row"
|
||||
@ 22, 7 SAY "<ESC> = Quit Array Edit, <Enter> or <Any Other Key> Edits Element"
|
||||
SetColor( "N/W, W/N, , , W/N" )
|
||||
cRet := FT_ArEdit( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc )
|
||||
SetColor( "W/N" )
|
||||
CLS
|
||||
? cRet
|
||||
? "Lastkey() = ESC:", LastKey() == K_ESC
|
||||
|
||||
RETURN
|
||||
|
||||
FUNCTION TestGet( b, ar, nDim, nElem )
|
||||
|
||||
LOCAL GetList := {}
|
||||
LOCAL nRow := Row()
|
||||
LOCAL nCol := Col()
|
||||
LOCAL cSaveScrn := SaveScreen( 21, 0, 22, MaxCol() )
|
||||
LOCAL cOldColor := SetColor( "W/N" )
|
||||
|
||||
@ 21, 0 CLEAR TO 22, MaxCol()
|
||||
@ 21, 29 SAY "Editing Array Element"
|
||||
SetColor( cOldColor )
|
||||
DO CASE
|
||||
CASE nDim == 1
|
||||
@ nRow, nCol GET ar[ 1, nElem ] PICTURE "99"
|
||||
READ
|
||||
b:refreshAll()
|
||||
CASE nDim == 2
|
||||
@ nRow, nCol GET ar[ 2, nElem ] PICTURE "!"
|
||||
READ
|
||||
b:refreshAll()
|
||||
CASE nDim == 3
|
||||
@ nRow, nCol GET ar[ 3, nElem ] PICTURE "!"
|
||||
READ
|
||||
b:refreshAll()
|
||||
ENDCASE
|
||||
RestScreen( 21, 0, 22, MaxCol(), cSaveScrn )
|
||||
@ nRow, nCol SAY ""
|
||||
|
||||
RETURN .T.
|
||||
|
||||
31
harbour/contrib/hbnf/tests/at2.prg
Normal file
31
harbour/contrib/hbnf/tests/at2.prg
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cSearch, cTarget, var0
|
||||
|
||||
CLS
|
||||
? "TEST TO DEMONSTRATE EXAMPLES OF FT_AT2"
|
||||
?
|
||||
cSearch := "t"
|
||||
? "Find occurrences of 't' in: "
|
||||
cTarget := "This is the day that the Lord has made."
|
||||
?? cTarget
|
||||
?
|
||||
var0 := ft_at2( cSearch, cTarget )
|
||||
? PadR( "FT_AT2( cSearch, cTarget ) -> ", 40 )
|
||||
?? var0
|
||||
?
|
||||
var0 := ft_at2( cSearch, cTarget, 2 )
|
||||
? PadR( "FT_AT2( cSearch, cTarget, 2 ) -> ", 40 )
|
||||
??var0
|
||||
?
|
||||
var0 := ft_at2( cSearch, cTarget, 2, .F. )
|
||||
? PadR( "FT_AT2( cSearch, cTarget, 2, .F. ) -> ", 40 )
|
||||
??var0
|
||||
?
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/blink.prg
Normal file
10
harbour/contrib/hbnf/tests/blink.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
FT_BLINK( "WAIT", 5, 10 )
|
||||
|
||||
RETURN
|
||||
|
||||
26
harbour/contrib/hbnf/tests/calendar.prg
Normal file
26
harbour/contrib/hbnf/tests/calendar.prg
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aRet
|
||||
|
||||
SetColor( "w+/b" )
|
||||
CLS
|
||||
IF ft_numlock()
|
||||
ft_numlock( .F. )
|
||||
ENDIF
|
||||
hb_keyPut( K_F1 )
|
||||
aRet := ft_calendar( 10, 40, "w+/rb", .T. , .T. ) //display calendar, return all.
|
||||
@ 1, 0 SAY "Date :" + DToC( aRet[ 1 ] )
|
||||
@ 2, 0 SAY "Month Number:" + Str( aRet[ 2 ], 2, 0 )
|
||||
@ 3, 0 SAY "Day Number :" + Str( aRet[ 3 ], 2, 0 )
|
||||
@ 4, 0 SAY "Year Number :" + Str( aRet[ 4 ], 4, 0 )
|
||||
@ 5, 0 SAY "Month :" + aRet[ 5 ]
|
||||
@ 6, 0 SAY "Day :" + aRet[ 6 ]
|
||||
@ 7, 0 SAY "Julian Day :" + Str( aRet[ 7 ], 3, 0 )
|
||||
@ 8, 0 SAY "Current Time:" + aRet[ 8 ]
|
||||
|
||||
RETURN
|
||||
|
||||
53
harbour/contrib/hbnf/tests/clrsel.prg
Normal file
53
harbour/contrib/hbnf/tests/clrsel.prg
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cVidMode )
|
||||
|
||||
LOCAL nRowDos := Row()
|
||||
LOCAL nColDos := Col()
|
||||
LOCAL aEnvDos := FT_SaveSets()
|
||||
LOCAL cScrDos := SaveScreen( 0, 0, MaxRow(), MaxCol() )
|
||||
LOCAL lColour
|
||||
LOCAL aClrs
|
||||
|
||||
DEFAULT cVidMode TO ""
|
||||
NoSnow( ( "NOSNOW" $ Upper( cVidMode ) ) )
|
||||
IF "VGA" $ Upper( cVidMode )
|
||||
SetMode( 50, 80 )
|
||||
ENDIF
|
||||
IF "EGA" $ Upper( cVidMode )
|
||||
SetMode( 43, 80 )
|
||||
ENDIF
|
||||
lColour := iif( "MONO" $ Upper( cVidMode ), .F. , IsColor() )
|
||||
|
||||
SET SCOREBOARD OFF
|
||||
SetCursor( SC_NONE )
|
||||
SetBlink( .F. )
|
||||
|
||||
//.... a typical application might have the following different settings
|
||||
// normally these would be stored in a .dbf/.dbv
|
||||
aClrs := { ;
|
||||
{ "Desktop", "N/BG", "D", hb_UTF8ToStr( "▒" ) }, ;
|
||||
{ "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 )
|
||||
|
||||
HB_SYMBOL_UNUSED( aClrs )
|
||||
|
||||
//.... restore the DOS environment
|
||||
FT_RestSets( aEnvDos )
|
||||
RestScreen( 0, 0, MaxRow(), MaxCol(), cScrDos )
|
||||
SetPos( nRowDos, nColDos )
|
||||
SetBlink( .F. ) // doesn't appear to be reset from FT_RestSets
|
||||
|
||||
RETURN
|
||||
|
||||
11
harbour/contrib/hbnf/tests/d2e.prg
Normal file
11
harbour/contrib/hbnf/tests/d2e.prg
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cNum, cPrec )
|
||||
|
||||
DEFAULT cPrec TO Str( DEFAULT_PRECISION )
|
||||
QOut( ft_d2e( Val( cNum ), Val( cPrec ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
204
harbour/contrib/hbnf/tests/datecnfg.prg
Normal file
204
harbour/contrib/hbnf/tests/datecnfg.prg
Normal file
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
// NOTES: 1) The date functions are 'international'; i.e., the
|
||||
// system date format is maintained, although ANSI is
|
||||
// temporarily used within certain functions.
|
||||
//
|
||||
// 2) The date functions fall into two categories:
|
||||
//
|
||||
// a) Calendar or fiscal periods.
|
||||
// A calendar or fiscal year is identified by the year()
|
||||
// of the last date in the year.
|
||||
//
|
||||
// b) Accounting Periods. 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.
|
||||
//
|
||||
// 3) The date functions require the presence of two variables:
|
||||
//
|
||||
// a) cFY_Start is a character string used to define the
|
||||
// first day of a calendar or fiscal year. It's format
|
||||
// is ANSI; e.g., "1980.01.01" defines a calendar year,
|
||||
// "1980.10.01" defines a fiscal year, starting October 1.
|
||||
//
|
||||
// The year may be any valid year. It's value has no
|
||||
// effect on the date functions. The day is assumed to be
|
||||
// less than 29. See function: FT_DATECNFG().
|
||||
//
|
||||
// B) nDow_Start is a number from 1 to 7 which defines the
|
||||
// starting day, DOW(), of a work week; e.g., 1 == Sunday.
|
||||
//
|
||||
// See function: FT_DATECNFG()
|
||||
//
|
||||
// COMPILE ALL PROGRAMS WITH /N /W /A
|
||||
//
|
||||
//*******************************************************************
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nNum, dDate, aTestData, aTemp, cFY_Start, nDOW_Start
|
||||
|
||||
SET DATE ANSI // User's normal date format
|
||||
aTemp := FT_DATECNFG() // Get/Set cFY_Start & nDOW_Start.
|
||||
// aTemp := FT_DATECNFG( "1980.01.03", 1 ) // Date string in user's format.
|
||||
cFY_Start := aTemp[ 1 ] // See FT_DATECNFG() in ft_date0.prg
|
||||
nDOW_Start := ATEMP[ 2 ] // FOR PARAMETERS.
|
||||
dDate := Date()
|
||||
// dDate := SToD( "19880229" ) // Test date, in user's normal date format
|
||||
|
||||
CLS
|
||||
? "Given Date: "
|
||||
?? dDate
|
||||
?? " cFY_Start: " + cFY_Start
|
||||
?? " nDOW_Start:" + Str( nDOW_Start, 2 )
|
||||
? "---- Fiscal Year Data -----------"
|
||||
|
||||
aTestData := FT_YEAR( dDate )
|
||||
? "FYYear ", aTestData[ 1 ] + " ", aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_QTR( dDate )
|
||||
? "FYQtr ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_QTR( dDate, nNum )
|
||||
? "FYQtr " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_MONTH( dDate )
|
||||
? "FYMonth ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_MONTH( dDate, nNum )
|
||||
? "FYMonth " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_WEEK( dDate )
|
||||
? "FYWeek ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_WEEK( dDate, nNum )
|
||||
? "FYWeek " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_DAYOFYR( dDate )
|
||||
? "FYDay ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 3 ) )
|
||||
aTestData := FT_DAYOFYR( dDate, nNum )
|
||||
? "FYDAY " + Str( nNum, 3 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
?
|
||||
? "---- Accounting Year Data -------"
|
||||
|
||||
aTestData := FT_ACCTYEAR( dDate )
|
||||
? "ACCTYear ", aTestData[ 1 ] + " ", aTestData[ 2 ], aTestData[ 3 ], ;
|
||||
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks"
|
||||
|
||||
aTestData := FT_ACCTQTR( dDate )
|
||||
? "ACCTQtr ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ], ;
|
||||
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks"
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_ACCTQTR( dDate, nNum )
|
||||
? "ACCTQtr " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_ACCTMONTH( dDate )
|
||||
? "ACCTMonth ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ], ;
|
||||
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks"
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_ACCTMONTH( dDate, nNum )
|
||||
? "ACCTMonth" + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_ACCTWEEK( dDate )
|
||||
? "ACCTWeek ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
|
||||
aTestData := FT_ACCTWEEK( dDate, nNum )
|
||||
? "ACCTWeek " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
aTestData := FT_DAYOFYR( dDate, , .T. )
|
||||
? "ACCTDay ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
nNum := Val( SubStr( aTestData[ 1 ], 5, 3 ) )
|
||||
aTestData := FT_DAYOFYR( dDate, nNum, .T. )
|
||||
? "ACCTDay " + Str( nNum, 3 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
|
||||
|
||||
WAIT
|
||||
|
||||
FT_CAL( dDate )
|
||||
FT_CAL( dDate, 1 )
|
||||
|
||||
RETURN
|
||||
|
||||
// DEMO Monthly Calendar function.
|
||||
// nType : 0 -> FT_MONTH, 1 -> FT_ACCTMONTH
|
||||
|
||||
STATIC FUNCTION FT_CAL( dGivenDate, nType )
|
||||
|
||||
LOCAL nTemp, dTemp, aTemp, cFY_Start, dStart, dEnd
|
||||
|
||||
aTemp := FT_DATECNFG()
|
||||
cFY_Start := aTemp[ 1 ]
|
||||
|
||||
IF dGivenDate == NIL .OR. !( ValType( dGivenDate ) $ "ND" )
|
||||
dGivenDate := Date()
|
||||
ELSEIF HB_ISNUMERIC( dGivenDate )
|
||||
nType := dGivenDate
|
||||
dGivenDate := Date()
|
||||
ENDIF
|
||||
|
||||
nType := iif( HB_ISNUMERIC( nType ), nType, 0 )
|
||||
|
||||
IF nType == 0
|
||||
IF SubStr( cFY_Start, 6, 5 ) == "01.01"
|
||||
? " Calendar Month Calendar containing " + DToC( dGivenDate )
|
||||
ELSE
|
||||
? " Fiscal Month Calendar containing " + DToC( dGivenDate )
|
||||
ENDIF
|
||||
|
||||
aTemp := FT_MONTH( dGivenDate )
|
||||
dStart := aTemp[ 2 ]
|
||||
dEnd := aTemp[ 3 ]
|
||||
aTemp[ 2 ] -= FT_DAYTOBOW( aTemp[ 2 ] )
|
||||
aTemp[ 3 ] += 6 - FT_DAYTOBOW( aTemp[ 3 ] )
|
||||
ELSE
|
||||
? " Accounting Month Calendar containing " + DToC( dGivenDate )
|
||||
aTemp := FT_ACCTMONTH( dGivenDate )
|
||||
ENDIF
|
||||
|
||||
?
|
||||
dTemp := aTemp[ 2 ]
|
||||
|
||||
FOR nTemp := 0 TO 6
|
||||
?? PadC( CDOW( dTemp + nTemp ), 10 )
|
||||
NEXT
|
||||
|
||||
?
|
||||
WHILE dTemp <= aTemp[ 3 ]
|
||||
FOR nTemp := 1 TO 7
|
||||
?? " "
|
||||
IF nType == 0 .AND. ( dTemp < dStart .OR. dTemp > dEnd )
|
||||
?? Space( 8 )
|
||||
ELSE
|
||||
?? dTemp
|
||||
ENDIF
|
||||
?? " "
|
||||
dTemp++
|
||||
NEXT
|
||||
?
|
||||
END
|
||||
|
||||
RETURN NIL
|
||||
|
||||
14
harbour/contrib/hbnf/tests/dectobin.prg
Normal file
14
harbour/contrib/hbnf/tests/dectobin.prg
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL X
|
||||
|
||||
FOR X := 1 TO 255
|
||||
QOut( FT_DEC2BIN( x ) )
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
53
harbour/contrib/hbnf/tests/dfile.prg
Normal file
53
harbour/contrib/hbnf/tests/dfile.prg
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cInFile := "dfile.prg"
|
||||
LOCAL CKEY
|
||||
LOCAL NNCOLOR := 7
|
||||
LOCAL NHCOLOR := 15
|
||||
LOCAL NCOLSKIP := 5
|
||||
LOCAL NRMARGIN := 132
|
||||
LOCAL CEXITKEYS := "AABBC "
|
||||
LOCAL LBROWSE := .F.
|
||||
LOCAL NSTART := 1
|
||||
LOCAL NBUFFSIZE := 4096
|
||||
LOCAL GetList := {}
|
||||
|
||||
@ 0, 0 CLEAR
|
||||
|
||||
@ 0, 0 SAY "ENTER FILENAME: " GET CINFILE
|
||||
@ 1, 0 SAY " FOREGROUND: " GET NNCOLOR PICTURE "999"
|
||||
@ 2, 0 SAY " HIGHLIGHT: " GET NHCOLOR PICTURE "999"
|
||||
@ 3, 0 SAY " EXIT KEYS: " GET CEXITKEYS
|
||||
@ 4, 0 SAY " BUFFER SIZE: " GET NBUFFSIZE PICTURE "9999"
|
||||
@ 1, 40 SAY "COLUMN INCREMENT: " GET NCOLSKIP PICTURE "999"
|
||||
@ 2, 40 SAY " MAX LINE SIZE: " GET NRMARGIN PICTURE "999"
|
||||
@ 3, 40 SAY " BROWSE MODE? " GET LBROWSE PICTURE "Y"
|
||||
|
||||
READ
|
||||
|
||||
/*
|
||||
* REMEMBER A WINDOW WILL BE ONE SIZE LESS AND GREATER THAN THE PASSED COORD.'S
|
||||
*
|
||||
* THE 9TH PARAMETER CONTAINS THE KEYS THAT THE ROUTINE WILL TERMINATE ON
|
||||
* AND THE hb_BChar(143) represents the F3 key.
|
||||
*
|
||||
*/
|
||||
|
||||
@ 4, 9 TO 11, 71
|
||||
|
||||
FT_DFSETUP( cInFile, 5, 10, 10, 70, nStart, ;
|
||||
nNColor, nHColor, cExitKeys + hb_BChar( 143 ), ;
|
||||
lBrowse, nColSkip, nRMargin, nBuffSize )
|
||||
|
||||
cKey := FT_DISPFILE()
|
||||
|
||||
FT_DFCLOSE()
|
||||
|
||||
@ 20, 0 SAY "Key pressed was: " + "[" + cKey + "]"
|
||||
|
||||
RETURN
|
||||
|
||||
11
harbour/contrib/hbnf/tests/diskfunc.prg
Normal file
11
harbour/contrib/hbnf/tests/diskfunc.prg
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cDrv )
|
||||
|
||||
QOut( "Disk size: " + Str( FT_DSKSIZE( cDrv ) ) )
|
||||
QOut( "Free bytes: " + Str( FT_DSKFREE( cDrv ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
64
harbour/contrib/hbnf/tests/dispmsg.prg
Normal file
64
harbour/contrib/hbnf/tests/dispmsg.prg
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cDosScrn
|
||||
LOCAL nDosRow
|
||||
LOCAL nDosCol
|
||||
LOCAL lColor
|
||||
LOCAL nMaxRow
|
||||
LOCAL nType
|
||||
|
||||
// color variables
|
||||
LOCAL cNormH, cNormN
|
||||
LOCAL cWindH, cWindN
|
||||
LOCAL cErrH, cErrN
|
||||
|
||||
// main routine starts here
|
||||
SET SCOREBOARD OFF
|
||||
|
||||
lColor := .T.
|
||||
|
||||
cNormH := iif( lColor, "W+/BG", "W+/N" )
|
||||
cNormN := iif( lColor, "N/BG" , "W/N" )
|
||||
cWindH := iif( lColor, "W+/B", "W+/N" )
|
||||
cWindN := iif( lColor, "W/B" , "W/N" )
|
||||
cErrH := iif( lColor, "W+/R", "W+/N" )
|
||||
cErrN := iif( lColor, "W/R" , "W/N" )
|
||||
|
||||
cDosScrn := SaveScreen()
|
||||
nDosRow := Row()
|
||||
nDosCol := Col()
|
||||
SetColor( "W/N" )
|
||||
CLS
|
||||
nMaxRow := MaxRow()
|
||||
SetBlink( .F. )
|
||||
SetColor( cWindN + "*" )
|
||||
CLS
|
||||
SetColor( cNormN )
|
||||
|
||||
FT_DispMsg( { { "[Esc] To Abort Changes [PgDn] To Continue" }, { cNormN, , cNormH } }, , nMaxRow - 5 )
|
||||
|
||||
FT_DispMsg( { { "[E]dit [P]rint [D]elete", ;
|
||||
"[Esc]ape [Alt-Q]" }, ;
|
||||
{ cErrN, cErrN, cErrH } }, , 2 )
|
||||
|
||||
nType := FT_DispMsg( { { ;
|
||||
"Create Or Edit [I]nvoice" ,;
|
||||
"Create Or Edit [O]rder" ,;
|
||||
"Create Or Edit [B]ack Order" ,;
|
||||
"Create Or Edit [Q]uote" ,;
|
||||
"[Esc] To Exit" } ,;
|
||||
{ cWindN, , , , , cWindH } }, "BIOQ" + Chr( K_ESC ) )
|
||||
|
||||
HB_SYMBOL_UNUSED( nType )
|
||||
|
||||
SetColor( "W/N" )
|
||||
SetCursor( SC_NORMAL )
|
||||
SetBlink( .T. )
|
||||
RestScreen( , , , , cDosScrn )
|
||||
SetPos( nDosRow, nDosCol )
|
||||
QUIT
|
||||
|
||||
10
harbour/contrib/hbnf/tests/dosver.prg
Normal file
10
harbour/contrib/hbnf/tests/dosver.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "Dos version: " + FT_DOSVER() )
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/e2d.prg
Normal file
10
harbour/contrib/hbnf/tests/e2d.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( sNumE )
|
||||
|
||||
QOut( FT_E2D( sNumE ) )
|
||||
|
||||
RETURN
|
||||
|
||||
22
harbour/contrib/hbnf/tests/elapsed.prg
Normal file
22
harbour/contrib/hbnf/tests/elapsed.prg
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL dStart, dEnd, cTimeStart, cTimeEnd, n, aDataTest
|
||||
|
||||
dStart := SToD( "19901128" )
|
||||
dEnd := SToD( "19901130" )
|
||||
cTimeStart := "08:00:00"
|
||||
cTimeEnd := "12:10:30"
|
||||
|
||||
aDataTest := FT_ELAPSED( dStart, dEnd, cTimeStart, cTimeEnd )
|
||||
FOR n := 1 TO 4
|
||||
? aDataTest[ n, 1 ], Str( aDataTest[ n, 2 ], 12, 4 )
|
||||
?? " "
|
||||
?? iif( n == 1, "Days", iif( n == 2, "Hours", iif( n == 3, "Mins.", "Secs." ) ) )
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
23
harbour/contrib/hbnf/tests/findith.prg
Normal file
23
harbour/contrib/hbnf/tests/findith.prg
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cCk, cStr, nOcc, xCase )
|
||||
|
||||
LOCAL nFind
|
||||
|
||||
IF PCount() != 4
|
||||
QOut( "usage: findith cCk cStr nOcc xCase" )
|
||||
QUIT
|
||||
ENDIF
|
||||
|
||||
xCase := iif( xCase == "Y", .T. , .F. )
|
||||
nOcc := Val( nOcc )
|
||||
QOut( iif( xCase, "Ignoring ", "Observing " ) + "case:" )
|
||||
|
||||
QOut( cStr )
|
||||
nFind := FT_FINDITH( cCk, cStr, nOcc, xCase )
|
||||
QOut( iif( nFind > 0, Space( nFind - 1 ) + "^" , "Not found" ) )
|
||||
|
||||
RETURN
|
||||
|
||||
17
harbour/contrib/hbnf/tests/floptst.prg
Normal file
17
harbour/contrib/hbnf/tests/floptst.prg
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cArg1 )
|
||||
|
||||
LOCAL nErrCode
|
||||
|
||||
IF HB_ISSTRING( cArg1 )
|
||||
nErrCode := FT_FLOPTST( Asc( Upper( cArg1 ) ) - Asc( "A" ) )
|
||||
OutStd( "Return Code is " + hb_ntos( nErrCode ) + hb_eol() )
|
||||
ELSE
|
||||
OutStd( "Usage: floptst cDrive" + hb_eol() + " where cDrive is 'A' or 'B' etc..." + hb_eol() )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/gcd.prg
Normal file
10
harbour/contrib/hbnf/tests/gcd.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cNum1, cNum2 )
|
||||
|
||||
OutStd( Str( FT_GCD( Val( cNum1 ), Val( cNum2 ) ) ) + hb_eol() )
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/hex2dec.prg
Normal file
10
harbour/contrib/hbnf/tests/hex2dec.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cHexNum )
|
||||
|
||||
QOut( FT_HEX2DEC( cHexNum ) )
|
||||
|
||||
RETURN
|
||||
|
||||
21
harbour/contrib/hbnf/tests/isshare.prg
Normal file
21
harbour/contrib/hbnf/tests/isshare.prg
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nLoaded := ft_isshare()
|
||||
|
||||
DO CASE
|
||||
CASE nLoaded == 0
|
||||
QOut( "Share not loaded, but ok to load" )
|
||||
CASE nLoaded == 1
|
||||
QOut( "Share not loaded, but NOT ok to load!" )
|
||||
CASE nLoaded == 255
|
||||
QOut( "Share is loaded!" )
|
||||
ENDCASE
|
||||
|
||||
QOut( "Retcode: " + Str( nLoaded ) )
|
||||
|
||||
RETURN
|
||||
|
||||
27
harbour/contrib/hbnf/tests/linked.prg
Normal file
27
harbour/contrib/hbnf/tests/linked.prg
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aString := { ;
|
||||
"RTrim('abc ')" ,;
|
||||
"NotARealFunc()" ,;
|
||||
"FT_DispMsg()" ,;
|
||||
'RTrim(cVar+"abc"+Left(cString)), Found()' ,;
|
||||
"IsItLinked()" ,;
|
||||
"lRetVal := Found()" ,;
|
||||
"!EOF() .AND. Month(Date())=12 .AND. YeeHa()" ,;
|
||||
"!EOF() .AND. Month(Date())=12" ,;
|
||||
"!EOF() .AND. Month(Date(YeeHa()))=12" ,;
|
||||
"Left(SubStr(nNum,4,Val(cChar+Asc(c))))" ,;
|
||||
"EOF(>> Note: Syntax IS NOT checked! <<)" }
|
||||
|
||||
CLS
|
||||
@ 1, 0 SAY "String Tested Result"
|
||||
@ 2, 0 TO 2, MaxCol()
|
||||
AEval( aString, {| ele | QOut( ele, Space( 45 - Len( ele ) ), FT_Linked( ele ) ) } )
|
||||
@ MaxRow() - 2, 0
|
||||
|
||||
RETURN
|
||||
|
||||
128
harbour/contrib/hbnf/tests/menu1.prg
Normal file
128
harbour/contrib/hbnf/tests/menu1.prg
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
// DUMMY PROCEDURE NAME SO "CCMDLINE" WILL BE LOCAL
|
||||
|
||||
PROCEDURE Main( cCmdLine )
|
||||
|
||||
LOCAL sDosScrn, nDosRow, nDosCol, lColor
|
||||
|
||||
// my approach to color variables
|
||||
// see colorchg.arc on NANFORUM
|
||||
LOCAL cNormN
|
||||
LOCAL cWindN
|
||||
LOCAL cErrH
|
||||
LOCAL cErrN
|
||||
|
||||
// options on menu bar
|
||||
LOCAL aColors
|
||||
LOCAL aBar := { " ENTER/EDIT ", " REPORTS ", " DISPLAY ", " MAINTENANCE ", " QUIT " }
|
||||
LOCAL aOptions[ Len( aBar ) ]
|
||||
AEval( aBar, {| x, i | HB_SYMBOL_UNUSED( x ), aOptions[ i ] := { {}, {}, {} } } )
|
||||
|
||||
cCmdLine := iif( cCmdLine == NIL, "", cCmdLine )
|
||||
|
||||
lColor := iif( "MONO" $ Upper( cCmdLine ), .F. , IsColor() )
|
||||
|
||||
// Border, Box, Bar, Current, Unselected
|
||||
aColors := iif( lColor, { "W+/G", "N/G", "N/G", "N/W", "N+/G" }, ;
|
||||
{ "W+/N", "W+/N", "W/N", "N/W", "W/N" } )
|
||||
|
||||
FT_FILL( aOptions[ 1 ], "A. Execute A Dummy Procedure" , {|| fubar() }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "B. Enter Daily Charge/Credit Slips" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "C. Enter Payments On Accounts" , {|| .T. }, .F. )
|
||||
FT_FILL( aOptions[ 1 ], "D. Edit Daily Transactions" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "E. Enter/Update Member File" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "F. Update Code File" , {|| .T. }, .F. )
|
||||
FT_FILL( aOptions[ 1 ], "G. Add/Update Auto Charge File" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "H. Post All Transactions To A/R File", {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 1 ], "I. Increment Next Posting Date" , {|| .T. }, .T. )
|
||||
|
||||
FT_FILL( aOptions[ 2 ], "A. Print Member List" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "B. Print Active Auto Charges" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "C. Print Edit List" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "D. Print Pro-Usage Report" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "E. Print A/R Transaction Report" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "F. Aging Report Preparation" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "G. Add Interest Charges" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "H. Print Aging Report" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "I. Print Monthly Statements" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "J. Print Mailing Labels" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "K. Print Transaction Totals" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "L. Print Transaction Codes File" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 2 ], "M. Print No-Activity List" , {|| .T. }, .T. )
|
||||
|
||||
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. Accounts Receivable Display" , {|| .T. }, .T. )
|
||||
|
||||
FT_FILL( aOptions[ 4 ], "A. Backup Database Files" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 4 ], "B. Reindex Database Files" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 4 ], "C. Set System Parameters" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 4 ], "D. This EXITs Too" , {|| .F. }, .T. )
|
||||
|
||||
FT_FILL( aOptions[ 5 ], "A. Does Nothing" , {|| .T. }, .T. )
|
||||
FT_FILL( aOptions[ 5 ], "B. Exit To DOS" , {|| .F. }, .T. )
|
||||
|
||||
// main routine starts here
|
||||
SET SCOREBOARD OFF
|
||||
|
||||
cNormN := iif( lColor, "N/G" , "W/N" )
|
||||
cWindN := iif( lColor, "W/B" , "W/N" )
|
||||
cErrH := iif( lColor, "W+/R", "W+/N" )
|
||||
cErrN := iif( lColor, "W/R" , "W/N" )
|
||||
|
||||
SAVE SCREEN TO sDosScrn
|
||||
nDosRow := Row()
|
||||
nDosCol := Col()
|
||||
SetColor( "w/n" )
|
||||
CLS
|
||||
NoSnow( "NOSNOW" $ Upper( cCmdLine ) )
|
||||
IF "VGA" $ Upper( cCmdLine )
|
||||
SetMode( 50, 80 )
|
||||
ENDIF
|
||||
t_nMaxRow := MaxRow()
|
||||
SetBlink( .F. )
|
||||
SetColor( cWindN + "*" )
|
||||
CLS
|
||||
SetColor( cNormN )
|
||||
@ t_nMaxRow, 0
|
||||
@ t_nMaxRow, 0 SAY hb_UTF8ToStr( " FT_MENU1 1.0 │ " )
|
||||
@ t_nMaxRow, 16 SAY "WRITTEN BY PAUL FERRARA [76702,556] FOR NANFORUM.LIB"
|
||||
@ t_nMaxRow, 69 SAY hb_UTF8ToStr( "│ " ) + DToC( Date() )
|
||||
|
||||
SetColor( cErrH )
|
||||
@ t_nMaxRow - 11, 23, t_nMaxRow - 3, 56 BOX hb_UTF8ToStr( "┌─┐│┘─└│ " )
|
||||
@ t_nMaxRow - 9, 23 SAY hb_UTF8ToStr( "├────────────────────────────────┤" )
|
||||
SetColor( cErrN )
|
||||
@ t_nMaxRow - 10, 33 SAY "Navigation Keys"
|
||||
@ t_nMaxRow - 8, 25 SAY "LeftArrow RightArrow Alt-E"
|
||||
@ t_nMaxRow - 7, 25 SAY "Home End Alt-R"
|
||||
@ t_nMaxRow - 6, 25 SAY "Tab Shift-Tab Alt-D"
|
||||
@ t_nMaxRow - 5, 25 SAY "PgUp PgDn Alt-M"
|
||||
@ t_nMaxRow - 4, 25 SAY "Enter ESCape Alt-Q"
|
||||
SetColor( cNormN )
|
||||
|
||||
FT_MENU1( aBar, aOptions, aColors )
|
||||
|
||||
SetColor( "W/N" )
|
||||
SetCursor( SC_NORMAL )
|
||||
SetBlink( .T. )
|
||||
IF "VGA" $ Upper( cCmdLine )
|
||||
SetMode( 25, 80 )
|
||||
ENDIF
|
||||
RESTORE SCREEN FROM sDosScrn
|
||||
SetPos( nDosRow, nDosCol )
|
||||
QUIT
|
||||
|
||||
FUNCTION fubar()
|
||||
|
||||
LOCAL OldColor := SetColor( "W/N" )
|
||||
|
||||
CLS
|
||||
QOut( "Press Any Key" )
|
||||
Inkey( 0 )
|
||||
SetColor( OldColor )
|
||||
|
||||
RETURN .T.
|
||||
101
harbour/contrib/hbnf/tests/metaph.prg
Normal file
101
harbour/contrib/hbnf/tests/metaph.prg
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aNames := {}
|
||||
|
||||
Set( _SET_SCOREBOARD, .F. )
|
||||
Set( _SET_COLOR, "W/B" )
|
||||
CLS
|
||||
|
||||
// Demo will create an array of names and display in 3 columns
|
||||
// _ftRow() and _ftCol() will calculate the screen co-ordinates
|
||||
// by evaluating the element number
|
||||
|
||||
AAdd( aNames, "Adams" )
|
||||
AAdd( aNames, "Addams" )
|
||||
AAdd( aNames, "Atoms" )
|
||||
AAdd( aNames, "Adamson" )
|
||||
AAdd( aNames, "Cajun" )
|
||||
AAdd( aNames, "Cagen" )
|
||||
AAdd( aNames, "Cochy" )
|
||||
AAdd( aNames, "Cocci" )
|
||||
AAdd( aNames, "Smith" )
|
||||
AAdd( aNames, "Smythe" )
|
||||
AAdd( aNames, "Naylor" )
|
||||
AAdd( aNames, "Nailer" )
|
||||
AAdd( aNames, "Holberry" )
|
||||
AAdd( aNames, "Wholebary" )
|
||||
AAdd( aNames, "Jackson" )
|
||||
AAdd( aNames, "Jekksen" )
|
||||
AAdd( aNames, "The Source" )
|
||||
AAdd( aNames, "The Sores" )
|
||||
AAdd( aNames, "Jones" )
|
||||
AAdd( aNames, "Johns" )
|
||||
AAdd( aNames, "Lennon" )
|
||||
AAdd( aNames, "Lenin" )
|
||||
AAdd( aNames, "Fischer" )
|
||||
AAdd( aNames, "Fisher" )
|
||||
AAdd( aNames, "O'Donnell" )
|
||||
AAdd( aNames, "O Donald" )
|
||||
AAdd( aNames, "Pugh" )
|
||||
AAdd( aNames, "Pew" )
|
||||
AAdd( aNames, "Heimendinger" )
|
||||
AAdd( aNames, "Hymendinker" )
|
||||
AAdd( aNames, "Knight" )
|
||||
AAdd( aNames, "Nite" )
|
||||
AAdd( aNames, "Lamb" )
|
||||
AAdd( aNames, "Lamb Chops" )
|
||||
AAdd( aNames, "Stephens" )
|
||||
AAdd( aNames, "Stevens" )
|
||||
AAdd( aNames, "Neilson" )
|
||||
AAdd( aNames, "Nelson" )
|
||||
AAdd( aNames, "Tchaikovski" )
|
||||
AAdd( aNames, "Chikofski" )
|
||||
AAdd( aNames, "Caton" )
|
||||
AAdd( aNames, "Wright" )
|
||||
AAdd( aNames, "Write" )
|
||||
AAdd( aNames, "Right" )
|
||||
AAdd( aNames, "Manual" )
|
||||
AAdd( aNames, "Now" )
|
||||
AAdd( aNames, "Wheatabix" )
|
||||
AAdd( aNames, "Science" )
|
||||
AAdd( aNames, "Cinzano" )
|
||||
AAdd( aNames, "Lucy" )
|
||||
AAdd( aNames, "Reece" )
|
||||
AAdd( aNames, "Righetti" )
|
||||
AAdd( aNames, "Oppermann" )
|
||||
AAdd( aNames, "Bookkeeper" )
|
||||
AAdd( aNames, "McGill" )
|
||||
AAdd( aNames, "Magic" )
|
||||
AAdd( aNames, "McLean" )
|
||||
AAdd( aNames, "McLane" )
|
||||
AAdd( aNames, "Maclean" )
|
||||
AAdd( aNames, "Exxon" )
|
||||
|
||||
// display names and metaphones in 3 columns on screen
|
||||
AEval( aNames, ;
|
||||
{| cName, nElem | ;
|
||||
SetPos( _ftRow( nElem ), _ftCol( nElem ) ), ;
|
||||
QQOut( PadR( cName, 18, "." ) + FT_METAPH( cName ) ) ;
|
||||
} )
|
||||
|
||||
SetPos( 21, 00 )
|
||||
QUIT
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
STATIC FUNCTION _ftRow( nElem ) // Determine which row to print on
|
||||
|
||||
RETURN iif( nElem > 40, nElem - 40, iif( nElem > 20, nElem - 20, nElem ) )
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
STATIC FUNCTION _ftCol( nElem ) // Determine which column to start print
|
||||
|
||||
RETURN iif( nElem > 40, 55, iif( nElem > 20, 28, 1 ) )
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
39
harbour/contrib/hbnf/tests/miltime.prg
Normal file
39
harbour/contrib/hbnf/tests/miltime.prg
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
CLS
|
||||
? "am-pm"
|
||||
? ft_civ2mil( " 5:40 pm" )
|
||||
? ft_civ2mil( "05:40 pm" )
|
||||
? ft_civ2mil( " 5:40 PM" )
|
||||
? ft_civ2mil( " 5:40 am" )
|
||||
? ft_civ2mil( "05:40 am" )
|
||||
? ft_civ2mil( " 5:40 AM" )
|
||||
?
|
||||
Inkey( 0 )
|
||||
CLS
|
||||
? "noon-midnight"
|
||||
? ft_civ2mil( "12:00 m" )
|
||||
? ft_civ2mil( "12:00 M" )
|
||||
? ft_civ2mil( "12:00 m" )
|
||||
? ft_civ2mil( "12:00 n" )
|
||||
? ft_civ2mil( "12:00 N" )
|
||||
? ft_civ2mil( "12:00 n" )
|
||||
?
|
||||
Inkey( 0 )
|
||||
CLS
|
||||
? "errors in noon-midnight"
|
||||
? ft_civ2mil( "12:01 n" )
|
||||
? ft_civ2mil( "22:00 n" )
|
||||
? ft_civ2mil( "12:01 m" )
|
||||
? ft_civ2mil( "22:00 n" )
|
||||
?
|
||||
? "sys to mil"
|
||||
? Time()
|
||||
? ft_sys2mil()
|
||||
|
||||
RETURN
|
||||
|
||||
188
harbour/contrib/hbnf/tests/mouse1.prg
Normal file
188
harbour/contrib/hbnf/tests/mouse1.prg
Normal file
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( nRow, nCol )
|
||||
|
||||
// Pass valid row and column values for different video modes to change modes
|
||||
|
||||
LOCAL nX, nY, cSavClr
|
||||
LOCAL cSavScr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
|
||||
LOCAL nSaveRow := MaxRow() + 1, nSaveCol := MaxCol() + 1
|
||||
LOCAL nMinor, nType, nIRQ
|
||||
LOCAL aType := { "Bus", "Serial", "InPort", "PS/2", "HP" }
|
||||
LOCAL nHoriz, nVert, nDouble
|
||||
|
||||
IF nRow == NIL
|
||||
nRow := MaxRow() + 1
|
||||
ELSE
|
||||
nRow := Val( nRow )
|
||||
ENDIF
|
||||
|
||||
IF nCol == NIL
|
||||
nCol := MaxCol() + 1
|
||||
ELSE
|
||||
nCol := Val( nCol )
|
||||
ENDIF
|
||||
|
||||
IF !FT_MINIT()
|
||||
@ MaxRow(), 0 SAY "Mouse driver is not installed!"
|
||||
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
// ..... Set up the screen
|
||||
cSavClr := SetColor( "w/n" )
|
||||
@ 0, 0, MaxRow(), MaxCol() BOX hb_UTF8ToStr( "░░░░░░░░░" )
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
// Scroll( 7, 2, 19, 63, 0 )
|
||||
@ 7, 2 TO 20, 63
|
||||
|
||||
@ 17, 10 TO 19, 40 double
|
||||
|
||||
SetColor( "N/W" )
|
||||
@ 18, 11 SAY " Double Click here to Quit "
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
|
||||
// ..... Start the demo
|
||||
|
||||
@ MaxRow(), 0 SAY "Driver version: " + ;
|
||||
AllTrim( Str( FT_MVERSION( @nMinor, @nType, @nIRQ ), 2, 0 ) ) + "." + ;
|
||||
AllTrim( Str( nMinor, 2, 0 ) )
|
||||
@ Row(), Col() SAY " " + aType[ nType ] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
|
||||
|
||||
FT_MGETSENS( @nHoriz, @nVert, @nDouble ) // Get the current sensitivities
|
||||
FT_MSETSENS( 70, 70, 60 ) // Bump up the sensitivity of the mouse
|
||||
|
||||
FT_MSHOWCRS()
|
||||
FT_MSETCOORD( 10, 20 ) // just an arbitrary place for demo
|
||||
|
||||
// put the unchanging stuff
|
||||
|
||||
DevPos( 9, 10 )
|
||||
DevOut( "FT_MMICKEYS :" )
|
||||
|
||||
DevPos( 10, 10 )
|
||||
DevOut( "FT_MGETPOS :" )
|
||||
|
||||
DevPos( 11, 10 )
|
||||
DevOut( "FT_MGETX :" )
|
||||
|
||||
DevPos( 12, 10 )
|
||||
DevOut( "FT_MGETY :" )
|
||||
|
||||
DevPos( 13, 10 )
|
||||
DevOut( "FT_MGETCOORD:" )
|
||||
|
||||
DevPos( 14, 10 )
|
||||
DevOut( "FT_MBUTPRS :" )
|
||||
|
||||
DevPos( 16, 10 )
|
||||
DevOut( "FT_MBUTREL :" )
|
||||
|
||||
nX := nY := 1
|
||||
DO WHILE .T.
|
||||
|
||||
// If we are not moving then wait for movement.
|
||||
// This whole demo is a bit artificial in its requirements when compared
|
||||
// to a "normal" CLIPPER program so some of these examples are a bit out of
|
||||
// the ordinary.
|
||||
|
||||
DO WHILE nX == 0 .AND. nY == 0
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
// tell the mouse driver where updates will be taking place so it can hide
|
||||
// the cursor when necessary.
|
||||
|
||||
FT_MCONOFF( 9, 23, 16, 53 )
|
||||
|
||||
DevPos( 9, 23 )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 10, 23 )
|
||||
DevOut( FT_MGETPOS( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 11, 23 )
|
||||
DevOut( FT_MGETX() )
|
||||
|
||||
DevPos( 12, 23 )
|
||||
DevOut( FT_MGETY() )
|
||||
|
||||
DevPos( 13, 23 )
|
||||
DevOut( FT_MGETCOORD( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 14, 23 )
|
||||
DevOut( FT_MBUTPRS( 1 ) )
|
||||
DevOut( FT_MBUTPRS( 0,, nX, nY ) )
|
||||
DevPos( 15, 23 )
|
||||
|
||||
// show only the last Press since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 16, 23 )
|
||||
DevOut( FT_MBUTREL( 0,, @nX, @nY ) )
|
||||
|
||||
// show only the last release since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
// Restore the cursor if it has been hidden
|
||||
|
||||
FT_MSHOWCRS()
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
IF FT_MDBLCLK( 2, 0, 0.8 )
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
ELSE
|
||||
|
||||
// Put the cursor back to normal mode
|
||||
|
||||
FT_MDEFCRS( 0, 30719, 30464 )
|
||||
ENDIF
|
||||
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
|
||||
FT_MHIDECRS()
|
||||
|
||||
SetMode( nSaveRow, nSaveCol )
|
||||
SetColor( cSavClr )
|
||||
RestScreen( 0, 0, MaxRow(), MaxCol(), cSavScr )
|
||||
DevPos( MaxRow(), 0 )
|
||||
|
||||
// Reset sensitivity
|
||||
|
||||
FT_MSETSENS( nHoriz, nVert, nDouble )
|
||||
|
||||
RETURN
|
||||
|
||||
194
harbour/contrib/hbnf/tests/mouse2.prg
Normal file
194
harbour/contrib/hbnf/tests/mouse2.prg
Normal file
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
// Pass valid row and column values for different video modes to change modes
|
||||
|
||||
PROCEDURE Main( nRow, nCol )
|
||||
|
||||
LOCAL nX, nY, cSavClr
|
||||
LOCAL cSavScr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
|
||||
LOCAL nSaveRow := MaxRow() + 1, nSaveCol := MaxCol() + 1
|
||||
LOCAL nMinor, nType, nIRQ
|
||||
LOCAL aType := { "Bus", "Serial", "InPort", "PS/2", "HP" }
|
||||
LOCAL nHoriz, nVert, nDouble
|
||||
|
||||
IF nRow == NIL
|
||||
nRow := MaxRow() + 1
|
||||
ELSE
|
||||
nRow := Val( nRow )
|
||||
ENDIF
|
||||
|
||||
IF nCol == NIL
|
||||
nCol := MaxCol() + 1
|
||||
ELSE
|
||||
nCol := Val( nCol )
|
||||
ENDIF
|
||||
|
||||
IF ! SetMode( nRow, nCol )
|
||||
@ MaxRow(), 0 SAY "Mode Change unsuccessful:" + Str( nRow, 2, 0 ) + " by";
|
||||
+ Str( nCol, 3, 0 )
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
IF Empty( FT_MINIT() )
|
||||
@ MaxRow(), 0 SAY "Mouse driver is not installed!"
|
||||
SetMode( nSaveRow, nSaveCol )
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
// ..... Set up the screen
|
||||
cSavClr := SetColor( "w/n" )
|
||||
@ 0, 0, MaxRow(), MaxCol() BOX hb_UTF8ToStr( "░░░░░░░░░" )
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
Scroll( 7, 2, 19, 63, 0 )
|
||||
@ 7, 2 TO 20, 63
|
||||
|
||||
@ 17, 10 TO 19, 40 double
|
||||
|
||||
SetColor( "N/W" )
|
||||
@ 18, 11 SAY " Double Click here to Quit "
|
||||
|
||||
SetColor( "GR+/RB" )
|
||||
|
||||
// ..... Start the demo
|
||||
|
||||
@ MaxRow(), 0 SAY "Driver version: " + ;
|
||||
AllTrim( Str( FT_MVERSION( @nMinor, @nType, @nIRQ ), 2, 0 ) ) + "." + ;
|
||||
AllTrim( Str( nMinor, 2, 0 ) )
|
||||
@ Row(), Col() SAY " " + aType[ nType ] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
|
||||
|
||||
FT_MGETSENS( @nHoriz, @nVert, @nDouble ) // Get the current sensitivities
|
||||
FT_MSETSENS( 70, 70, 60 ) // Bump up the sensitivity of the mouse
|
||||
|
||||
FT_MSHOWCRS()
|
||||
FT_MSETCOORD( 10, 20 ) // just an arbitrary place for demo
|
||||
|
||||
// put the unchanging stuff
|
||||
|
||||
DevPos( 9, 10 )
|
||||
DevOut( "FT_MMICKEYS :" )
|
||||
|
||||
DevPos( 10, 10 )
|
||||
DevOut( "FT_MGETPOS :" )
|
||||
|
||||
DevPos( 11, 10 )
|
||||
DevOut( "FT_MGETX :" )
|
||||
|
||||
DevPos( 12, 10 )
|
||||
DevOut( "FT_MGETY :" )
|
||||
|
||||
DevPos( 13, 10 )
|
||||
DevOut( "FT_MGETCOORD:" )
|
||||
|
||||
DevPos( 14, 10 )
|
||||
DevOut( "FT_MBUTPRS :" )
|
||||
|
||||
DevPos( 16, 10 )
|
||||
DevOut( "FT_MBUTREL :" )
|
||||
|
||||
nX := nY := 1
|
||||
DO WHILE .T.
|
||||
|
||||
// If we are not moving then wait for movement.
|
||||
// This whole demo is a bit artificial in its requirements when compared
|
||||
// to a "normal" CLIPPER program so some of these examples are a bit out of
|
||||
// the ordinary.
|
||||
|
||||
DO WHILE nX == 0 .AND. nY == 0
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
// tell the mouse driver where updates will be taking place so it can hide
|
||||
// the cursor when necessary.
|
||||
|
||||
FT_MCONOFF( 9, 23, 16, 53 )
|
||||
|
||||
DevPos( 9, 23 )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 10, 23 )
|
||||
DevOut( FT_MGETPOS( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
DevPos( 11, 23 )
|
||||
DevOut( FT_MGETX() )
|
||||
|
||||
DevPos( 12, 23 )
|
||||
DevOut( FT_MGETY() )
|
||||
|
||||
DevPos( 13, 23 )
|
||||
DevOut( FT_MGETCOORD( @nX, @nY ) )
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 14, 23 )
|
||||
DevOut( FT_MBUTPRS( 1 ) )
|
||||
DevOut( FT_MBUTPRS( 0,, nX, nY ) )
|
||||
DevPos( 15, 23 )
|
||||
|
||||
// show only the last Press since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
nX := nY := 0
|
||||
DevPos( 16, 23 )
|
||||
DevOut( FT_MBUTREL( 0,, @nX, @nY ) )
|
||||
|
||||
// show only the last release since it flashes by so quickly
|
||||
|
||||
IF nX != 0 .OR. nY != 0
|
||||
DevOut( nX )
|
||||
DevOut( nY )
|
||||
ENDIF
|
||||
|
||||
// Restore the cursor if it has been hidden
|
||||
|
||||
FT_MSHOWCRS()
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
IF FT_MDBLCLK( 2, 0, 0.8 )
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF FT_MINREGION( 18, 11, 18, 39 )
|
||||
|
||||
// Change the type of cursor when in the box. Just slightly different than the
|
||||
// normal. The character is shown in high intensity.
|
||||
|
||||
FT_MDEFCRS( 0, 32767, 32512 )
|
||||
ELSE
|
||||
|
||||
// Put the cursor back to normal mode
|
||||
|
||||
FT_MDEFCRS( 0, 30719, 30464 )
|
||||
ENDIF
|
||||
|
||||
FT_MMICKEYS( @nX, @nY )
|
||||
ENDDO
|
||||
|
||||
FT_MHIDECRS()
|
||||
|
||||
SetMode( nSaveRow, nSaveCol )
|
||||
SetColor( cSavClr )
|
||||
RestScreen( 0, 0, MaxRow(), MaxCol(), cSavScr )
|
||||
DevPos( MaxRow(), 0 )
|
||||
|
||||
// Reset sensitivity
|
||||
|
||||
FT_MSETSENS( nHoriz, nVert, nDouble )
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/netpv.prg
Normal file
10
harbour/contrib/hbnf/tests/netpv.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
? FT_NETPV( 10000, 10, { 10000, 15000, 16000, 17000 } )
|
||||
|
||||
RETURN
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
10
harbour/contrib/hbnf/tests/ntow.prg
Normal file
10
harbour/contrib/hbnf/tests/ntow.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cNum )
|
||||
|
||||
QOut( ft_ntow( Val( cNum ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/nwlstat.prg
Normal file
10
harbour/contrib/hbnf/tests/nwlstat.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "Logical station: " + Str( FT_NWLSTAT() ) )
|
||||
|
||||
RETURN
|
||||
|
||||
50
harbour/contrib/hbnf/tests/nwsem.prg
Normal file
50
harbour/contrib/hbnf/tests/nwsem.prg
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define INITIAL_SEMAPHORE_VALUE 2
|
||||
#define WAIT_SECONDS 1
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nInitVal, nRc, nHandle, nValue, nOpenCnt
|
||||
|
||||
CLS
|
||||
|
||||
nInitVal := INITIAL_SEMAPHORE_VALUE
|
||||
FT_NWSEMOPEN( "TEST", nInitVal, @nHandle, @nOpenCnt )
|
||||
|
||||
QOut( "Waiting ten seconds..." )
|
||||
nRc := ft_nwSemWait( nHandle, 180 )
|
||||
QOut( "Final nRc value = " + Str( nRc ) )
|
||||
Inkey( 0 )
|
||||
IF nRc == 254
|
||||
QOut( "Couldn't get the semaphore. Try again." )
|
||||
QUIT
|
||||
ENDIF
|
||||
|
||||
CLS
|
||||
|
||||
@ 24, 0 SAY "Any key to exit"
|
||||
@ 0, 0 SAY "Handle: " + Str( nHandle )
|
||||
|
||||
ft_nwSemEx( nHandle, @nValue, @nOpenCnt )
|
||||
WHILE .T.
|
||||
@ 23, 0 SAY "Semaphore test -> Open at [" + ;
|
||||
hb_ntos( nOpenCnt ) + ;
|
||||
"] stations, value is [" + ;
|
||||
hb_ntos( nValue ) + "]"
|
||||
|
||||
IF Inkey( WAIT_SECONDS ) != 0
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
Tone( nHandle, .5 )
|
||||
ft_nwSemEx( nHandle, @nValue, @nOpenCnt )
|
||||
ENDDO
|
||||
|
||||
QOut( "Signal returns: " + Str( ft_nwsemSig( nHandle ) ) )
|
||||
QOut( "Close returns: " + Str( ft_nwsemClose( nHandle ) ) )
|
||||
|
||||
RETURN
|
||||
|
||||
20
harbour/contrib/hbnf/tests/nwuid.prg
Normal file
20
harbour/contrib/hbnf/tests/nwuid.prg
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL x, cUid
|
||||
|
||||
QOut( "I am: [" + FT_NWUID() + "]" )
|
||||
QOut( "---------------------" )
|
||||
|
||||
FOR x := 1 TO 100
|
||||
cUid := FT_NWUID( x )
|
||||
IF ! Empty( cUid )
|
||||
QOut( Str( x, 3 ) + Space( 3 ) + cUid )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
16
harbour/contrib/hbnf/tests/pending.prg
Normal file
16
harbour/contrib/hbnf/tests/pending.prg
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
@ 0, 0 CLEAR
|
||||
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.
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/pickday.prg
Normal file
10
harbour/contrib/hbnf/tests/pickday.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "You selected " + FT_PICKDAY() )
|
||||
|
||||
RETURN
|
||||
|
||||
44
harbour/contrib/hbnf/tests/popadder.prg
Normal file
44
harbour/contrib/hbnf/tests/popadder.prg
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL nSickHrs := 0
|
||||
LOCAL nPersHrs := 0
|
||||
LOCAL nVacaHrs := 0
|
||||
LOCAL GetList := {}
|
||||
|
||||
SET SCOREBOARD OFF
|
||||
_ftSetScrColor( STD_SCREEN, STD_VARIABLE )
|
||||
CLS
|
||||
|
||||
SET KEY K_ALT_A TO FT_Adder // Make <ALT-A> call FT_Adder
|
||||
|
||||
// SIMPLE Sample of program data entry!
|
||||
|
||||
@ 12, 5 SAY "Please enter the total Sick, Personal, and Vacation hours."
|
||||
@ 15, 22 SAY "Sick hrs."
|
||||
@ 15, 40 SAY "Pers. hrs."
|
||||
@ 15, 60 SAY "Vaca. hrs."
|
||||
@ 23, 20 SAY "Press <ALT-A> to Pop - Up the Adder."
|
||||
@ 24, 20 SAY "Press <ESC> to Quit the adder Demo."
|
||||
DO WHILE .T. // Get the sick, personal, & vaca
|
||||
@ 16, 24 GET nSickHrs PICTURE "9999.999" // Normally I have a VALID()
|
||||
@ 16, 43 GET nPersHrs PICTURE "9999.999" // to make sure the value is
|
||||
@ 16, 63 GET nVacaHrs PICTURE "9999.999" // within the allowable range.
|
||||
SET CURSOR ON // But, like I said it is a
|
||||
CLEAR TYPEAHEAD // SIMPLE example <g>.
|
||||
READ
|
||||
SET CURSOR OFF
|
||||
IF LastKey() == K_ESC // <ESC> - ABORT
|
||||
CLEAR TYPEAHEAD
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDDO
|
||||
SET CURSOR ON
|
||||
|
||||
SET KEY K_ALT_A // Reset <ALT-A>
|
||||
|
||||
RETURN
|
||||
|
||||
20
harbour/contrib/hbnf/tests/prtesc.prg
Normal file
20
harbour/contrib/hbnf/tests/prtesc.prg
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cParm1 )
|
||||
|
||||
//-------------------------------------------------------
|
||||
// Sample routine to test function from command line
|
||||
//-------------------------------------------------------
|
||||
|
||||
IF PCount() > 0
|
||||
? FT_ESCCODE( cParm1 )
|
||||
ELSE
|
||||
? "Usage: PRT_ESC 'escape code sequence' "
|
||||
? " outputs converted code to standard output"
|
||||
?
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
19
harbour/contrib/hbnf/tests/rand1.prg
Normal file
19
harbour/contrib/hbnf/tests/rand1.prg
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
// Write 100 random numbers from 1 to 100 to stdout.
|
||||
// Run it multiple times and redirect output to a file
|
||||
// to check it
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL x
|
||||
|
||||
FOR x := 1 TO 100
|
||||
OutStd( Int( ft_rand1(100 ) ) )
|
||||
OutStd( hb_eol() )
|
||||
NEXT
|
||||
|
||||
RETURN
|
||||
|
||||
44
harbour/contrib/hbnf/tests/savearr.prg
Normal file
44
harbour/contrib/hbnf/tests/savearr.prg
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aArray := {;
|
||||
{ "Invoice 1", SToD( "19910415" ), 1234.32, .T. }, ;
|
||||
{ "Invoice 2", Date(), 234.98, .F. }, ;
|
||||
{ "Invoice 3", Date() + 1, 0, .T. } }, aSave
|
||||
LOCAL nErrorCode := 0
|
||||
|
||||
FT_SAVEARR( aArray, "invoice.dat", @nErrorCode )
|
||||
IF nErrorCode == 0
|
||||
CLS
|
||||
DispArray( aArray )
|
||||
aSave := FT_RESTARR( "invoice.dat", @nErrorCode )
|
||||
IF nErrorCode == 0
|
||||
DispArray( aSave )
|
||||
ELSE
|
||||
? "Error restoring array"
|
||||
ENDIF
|
||||
ELSE
|
||||
? "Error writing array"
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
FUNCTION DispArray( aTest )
|
||||
|
||||
LOCAL nk
|
||||
|
||||
FOR nk := 1 TO Len( aTest )
|
||||
? aTest[ nk, 1 ]
|
||||
?? " "
|
||||
?? DToC( aTest[ nk, 2 ] )
|
||||
?? " "
|
||||
?? Str( aTest[ nk, 3 ] )
|
||||
?? " "
|
||||
?? iif( aTest[ nk, 4 ], "true", "false" )
|
||||
NEXT
|
||||
|
||||
RETURN NIL
|
||||
|
||||
14
harbour/contrib/hbnf/tests/savesets.prg
Normal file
14
harbour/contrib/hbnf/tests/savesets.prg
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aSets := FT_SAVESETS()
|
||||
|
||||
HB_SYMBOL_UNUSED( aSets )
|
||||
|
||||
Inkey( 0 )
|
||||
|
||||
RETURN
|
||||
|
||||
23
harbour/contrib/hbnf/tests/scancode.prg
Normal file
23
harbour/contrib/hbnf/tests/scancode.prg
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define SCANCODE_ESCAPE ( hb_BChar( 27 ) + hb_BChar( 1 ) )
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL cKey
|
||||
|
||||
CLS
|
||||
QOut( "Press any key, ESCape to exit:" )
|
||||
|
||||
DO WHILE .T.
|
||||
cKey := FT_SCANCODE()
|
||||
QOut( Str( hb_BCode( hb_BSubStr( cKey, 1, 1 ) ), 3 ) + ", " + Str( hb_BCode( hb_BSubStr( cKey, 2, 1 ) ), 3 ) + hb_eol() )
|
||||
IF cKey == SCANCODE_ESCAPE
|
||||
EXIT
|
||||
ENDIF
|
||||
ENDDO
|
||||
|
||||
RETURN
|
||||
|
||||
13
harbour/contrib/hbnf/tests/setdate.prg
Normal file
13
harbour/contrib/hbnf/tests/setdate.prg
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cDate )
|
||||
|
||||
cDate := iif( cDate == NIL, DToC( Date() ), cDate )
|
||||
QOut( "Setting date to: " + cDate + "... " )
|
||||
FT_SETDATE( CToD( cDate ) )
|
||||
QOut( "Today is now: " + DToC( Date() ) )
|
||||
|
||||
RETURN
|
||||
|
||||
13
harbour/contrib/hbnf/tests/settime.prg
Normal file
13
harbour/contrib/hbnf/tests/settime.prg
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cTime )
|
||||
|
||||
cTime := iif( cTime == NIL, Time(), cTime )
|
||||
QOut( "Setting time to: " + cTime + "... " )
|
||||
FT_SETTIME( cTime )
|
||||
QOut( "Time is now: " + Time() )
|
||||
|
||||
RETURN
|
||||
|
||||
15
harbour/contrib/hbnf/tests/sleep.prg
Normal file
15
harbour/contrib/hbnf/tests/sleep.prg
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
// Test routine
|
||||
// Invoke by running SLEEP 1.0 to sleep 1.0 seconds
|
||||
|
||||
PROCEDURE Main( nSleep )
|
||||
|
||||
? "Time is now: " + Time()
|
||||
FT_SLEEP( Val( nSleep ) )
|
||||
? "Time is now: " + Time()
|
||||
|
||||
RETURN
|
||||
|
||||
10
harbour/contrib/hbnf/tests/sysmem.prg
Normal file
10
harbour/contrib/hbnf/tests/sysmem.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
QOut( "Conventional memory: " + Str( FT_SYSMEM() ) + "K installed" )
|
||||
|
||||
RETURN
|
||||
|
||||
107
harbour/contrib/hbnf/tests/tbwhile.prg
Normal file
107
harbour/contrib/hbnf/tests/tbwhile.prg
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS DEMO SHOWS tbnames.dbf CONSISTING OF LAST, FIRST, ADDR, CITY,
|
||||
* STATE, ZIP WITH ACTIVE INDEX ON LAST + FIRST. IT SHOWS LAST NAME,
|
||||
* FIRST NAME, CITY ONLY FOR THOSE LAST NAMES THAT BEGIN WITH LETTER
|
||||
* THAT YOU INPUT FOR THE CKEY GET.
|
||||
*
|
||||
* tbnames.dbf/.ntx ARE AUTOMATICALLY CREATED BY THIS TEST PROGRAM
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL aFields := {}, cKey := "O", cOldColor
|
||||
LOCAL nFreeze := 1, lSaveScrn := .T. , nRecSel
|
||||
LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R"
|
||||
LOCAL cColorShad := "N/N"
|
||||
FIELD last, first
|
||||
MEMVAR GetList
|
||||
|
||||
IF ! hb_FileExists( "tbnames.dbf" )
|
||||
MAKE_DBF()
|
||||
ENDIF
|
||||
|
||||
USE TBNames
|
||||
|
||||
IF ! hb_FileExists( "tbnames.ntx" )
|
||||
INDEX ON last + first TO TBNAMES
|
||||
ENDIF
|
||||
|
||||
SET INDEX TO TBNAMES
|
||||
|
||||
// Pass Heading as character and Field as Block including Alias
|
||||
// To eliminate the need to use FIELDWBLOCK() function in FT_BRWSWHL()
|
||||
|
||||
AAdd( aFields, { "Last Name" , {|| TBNames->Last } } )
|
||||
AAdd( aFields, { "First Name", {|| TBNames->First } } )
|
||||
AAdd( aFields, { "City" , {|| TBNames->City } } )
|
||||
|
||||
cOldColor := SetColor( "N/BG" )
|
||||
CLS
|
||||
@ 5, 10 SAY "Enter First Letter Of Last Name:" GET cKey PICTURE "!"
|
||||
READ
|
||||
|
||||
// TBNames->Last = cKey is the Conditional Block passed to this function
|
||||
// you can make it as complicated as you want, but you would then
|
||||
// have to modify TBWhileSet() to find first and last records
|
||||
// matching your key.
|
||||
nRecSel := FT_BRWSWHL( aFields, {|| TBNames->Last = cKey }, cKey, nFreeze, ;
|
||||
lSaveScrn, cColorList, cColorShad, 3, 6, MaxRow() - 2, MaxCol() - 6 )
|
||||
// Note you can use Compound Condition
|
||||
// such as cLast =: "Pierce " and cFirst =: "Hawkeye "
|
||||
// by changing above block to:
|
||||
// {|| TBNames->Last = cLast .AND. TBNames->First = cFirst }
|
||||
// and setting cKey := cLast + cFirst
|
||||
|
||||
?
|
||||
IF nRecSel == 0
|
||||
? "Sorry, NO Records Were Selected"
|
||||
ELSE
|
||||
? "You Selected " + TBNames->Last + " " + ;
|
||||
TBNames->First + " " + TBNames->City
|
||||
ENDIF
|
||||
?
|
||||
|
||||
WAIT
|
||||
SetColor( cOldColor )
|
||||
CLS
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC FUNCTION make_dbf()
|
||||
|
||||
LOCAL x, aData := { ;
|
||||
{ "SHAEFER", "KATHRYN", "415 WEST CITRUS ROAD #150", "LOS ANGELES", "CA", "90030" }, ;
|
||||
{ "OLSON", "JAMES", "225 NORTH RANCH ROAD", "LOS ANGELES", "CA", "90023" }, ;
|
||||
{ "KAYBEE", "JOHN", "123 SANDS ROAD", "CAMARILLO", "CA", "93010" }, ;
|
||||
{ "HERMAN", "JIM", "123 TOON PAGE ROAD", "VENTURA", "CA", "93001" }, ;
|
||||
{ "BURNS", "FRANK", "123 VIRGINA STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "PIERCE", "HAWKEYE", "123 OLD TOWN ROAD", "PORT MUGU", "CA", "93043" }, ;
|
||||
{ "MORGAN", "JESSICA", "123 FRONTAGE ROAD", "CAMARILLO", "CA", "93010" }, ;
|
||||
{ "POTTER", "ROBERT", "123 FIR STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "WORTH", "MARY", "123-1/2 JOHNSON DRIVE", "OXNARD", "CA", "93033" }, ;
|
||||
{ "JOHNSON", "SUSAN", "123 QUEENS STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "SAMSON", "SAM", "215 MAIN STREET", "OXNARD", "CA", "93030" }, ;
|
||||
{ "NEWNAME", "JAMES", "215 MAIN STREET", "LOS ANGELES", "CA", "90000" }, ;
|
||||
{ "OLEANDAR", "JILL", "425 FLORAL PARK DRIVE", "FLORAL PARK", "NY", "10093" }, ;
|
||||
{ "SUGARMAN", "CANDY", "1541 SWEETHEART ROAD", "HERSHEY", "PA", "10132" } }
|
||||
|
||||
dbCreate( "TBNAMES", {;
|
||||
{ "LAST ", "C", 18, 0, } , ;
|
||||
{ "FIRST", "C", 9, 0, } , ;
|
||||
{ "ADDR ", "C", 28, 0, } , ;
|
||||
{ "CITY ", "C", 21, 0, } , ;
|
||||
{ "STATE", "C", 2, 0, } , ;
|
||||
{ "ZIP ", "C", 9, 0, } } )
|
||||
USE tbnames
|
||||
FOR x := 1 TO Len( aData )
|
||||
APPEND BLANK
|
||||
AEval( aData[ x ], {| e, n | FieldPut( n, e ) } )
|
||||
NEXT
|
||||
USE
|
||||
|
||||
RETURN NIL
|
||||
|
||||
21
harbour/contrib/hbnf/tests/tempfile.prg
Normal file
21
harbour/contrib/hbnf/tests/tempfile.prg
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main( cPath, cHide )
|
||||
|
||||
LOCAL cFile, nHandle
|
||||
|
||||
cFile := FT_TEMPFIL( cPath, ( cHide == "Y" ) )
|
||||
|
||||
IF ! Empty( cFile )
|
||||
QOut( cFile )
|
||||
nHandle := FOpen( cFile, FO_WRITE )
|
||||
FWrite( nHandle, "This is a test!" )
|
||||
FClose( nHandle )
|
||||
ELSE
|
||||
QOut( "An error occurred" )
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
50
harbour/contrib/hbnf/tests/vertmenu.prg
Normal file
50
harbour/contrib/hbnf/tests/vertmenu.prg
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
LOCAL datamenu := { ;
|
||||
{ "Customers", , {|| cust() } } , ;
|
||||
{ "Invoices", , {|| inv() } } , ;
|
||||
{ "Vendors", , {|| vendors() } }, ;
|
||||
{ "Exit", "Return to Main Menu" } }
|
||||
|
||||
LOCAL repmenu := { ;
|
||||
{ "Customer List", , {|| custrep() } } , ;
|
||||
{ "Past Due", , {|| pastdue() } } , ;
|
||||
{ "Weekly Sales", , {|| weeksales() } }, ;
|
||||
{ "Monthly P&L", , {|| monthpl() } } , ;
|
||||
{ "Vendor List", , {|| vendorrep() } }, ;
|
||||
{ "Exit", "Return to Main Menu" } }
|
||||
|
||||
LOCAL maintmenu := { ;
|
||||
{ "Reindex", "Rebuild index files", {|| re_ntx() } } , ;
|
||||
{ "Backup", "Backup data files" , {|| backup() } } , ;
|
||||
{ "Compress", "Compress data files", {|| compress() } }, ;
|
||||
{ "Exit", "Return to Main Menu" } }
|
||||
|
||||
LOCAL MAINMENU := { ;
|
||||
{ "DATA ENTRY", "ENTER DATA", {|| FT_MENU2( datamenu ) } }, ;
|
||||
{ "Reports", "Hard copy", {|| FT_MENU2( repmenu ) } }, ;
|
||||
{ "Maintenance", "Reindex files, etc.", {|| FT_MENU2( maintmenu ) } }, ;
|
||||
{ "Quit", "See ya later" } }
|
||||
|
||||
FT_MENU2( mainmenu )
|
||||
|
||||
RETURN
|
||||
|
||||
/* stub functions to avoid missing symbols */
|
||||
|
||||
STATIC PROCEDURE cust() ; RETURN
|
||||
STATIC PROCEDURE inv() ; RETURN
|
||||
STATIC PROCEDURE vendors() ; RETURN
|
||||
STATIC PROCEDURE custrep() ; RETURN
|
||||
STATIC PROCEDURE pastdue() ; RETURN
|
||||
STATIC PROCEDURE weeksales() ; RETURN
|
||||
STATIC PROCEDURE monthpl() ; RETURN
|
||||
STATIC PROCEDURE vendorrep() ; RETURN
|
||||
STATIC PROCEDURE re_ntx() ; RETURN
|
||||
STATIC PROCEDURE backup() ; RETURN
|
||||
STATIC PROCEDURE compress() ; RETURN
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user