diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e7ade1edaf..37993a3fb3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,50 @@ The license applies to all entries newer than 2009-04-28. */ +2012-09-29 18:34 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbnf/aavg.prg + * contrib/hbnf/adessort.prg + * contrib/hbnf/aemaxlen.prg + * contrib/hbnf/aeminlen.prg + * contrib/hbnf/amedian.prg + * contrib/hbnf/anomatch.prg + * contrib/hbnf/asum.prg + * contrib/hbnf/at2.prg + * contrib/hbnf/blink.prg + * contrib/hbnf/clrsel.prg + * contrib/hbnf/datecnfg.prg + * contrib/hbnf/dosver.prg + * contrib/hbnf/findith.prg + * contrib/hbnf/gcd.prg + * contrib/hbnf/invclr.prg + * contrib/hbnf/lastday.prg + * contrib/hbnf/menutonf.prg + * contrib/hbnf/metaph.prg + * contrib/hbnf/miltime.prg + * contrib/hbnf/mouse1.prg + * contrib/hbnf/nooccur.prg + * contrib/hbnf/nwlstat.prg + * contrib/hbnf/pegs.prg + * contrib/hbnf/pending.prg + * contrib/hbnf/pickday.prg + * contrib/hbnf/popadder.prg + * contrib/hbnf/settime.prg + * contrib/hbnf/sleep.prg + * contrib/hbnf/tbwhile.prg + * contrib/hbnf/week.prg + * manual formatting (comments mostly) + + added TOFIXes where savescreen() buffers are manipulated + + * contrib/hbnf/tests/ftgete.prg + * contrib/hbnf/tests/nftest.prg + * contrib/hbnf/tests/test.prg + * formatting + + * contrib/hbpre.hbm + * contrib/make.hb + ! fix to prev for disabling hbmk.hbm (it makes cmdline longer though, + which might be a problem on MS-DOS) + 2012-09-29 17:24 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbnf/aading.prg * contrib/hbnf/clrsel.prg diff --git a/harbour/contrib/hbnf/aavg.prg b/harbour/contrib/hbnf/aavg.prg index a27bd66544..16bd967c3d 100644 --- a/harbour/contrib/hbnf/aavg.prg +++ b/harbour/contrib/hbnf/aavg.prg @@ -32,7 +32,7 @@ FUNCTION FT_AAVG( aArray, nStartIndex, nEndIndex ) DEFAULT nStartIndex TO 1 DEFAULT nEndIndex TO Len( aArray ) -// Make Sure Bounds are in Range + // Make Sure Bounds are in Range FORCE_BETWEEN( 1, nEndIndex, Len( aArray ) ) FORCE_BETWEEN( 1, nStartIndex, nEndIndex ) diff --git a/harbour/contrib/hbnf/adessort.prg b/harbour/contrib/hbnf/adessort.prg index d34dd785b2..26137a2b23 100644 --- a/harbour/contrib/hbnf/adessort.prg +++ b/harbour/contrib/hbnf/adessort.prg @@ -32,7 +32,7 @@ FUNCTION FT_ADESSORT( aArray, nStartIndex, nEndIndex ) DEFAULT nStartIndex TO 1 DEFAULT nEndIndex TO Len( aArray ) -// Make Sure Bounds are in Range + // Make Sure Bounds are in Range FORCE_BETWEEN( 1, nEndIndex, Len( aArray ) ) FORCE_BETWEEN( 1, nStartIndex, nEndIndex ) diff --git a/harbour/contrib/hbnf/aemaxlen.prg b/harbour/contrib/hbnf/aemaxlen.prg index e006714b4a..edbc6bf3a7 100644 --- a/harbour/contrib/hbnf/aemaxlen.prg +++ b/harbour/contrib/hbnf/aemaxlen.prg @@ -57,7 +57,7 @@ FUNCTION FT_AEmaxlen( aArray, nDimension, nStart, nCount ) LOCAL i, nLast, cType, nMaxlen := 0 -// Set default parameters as necessary. + // Set default parameters as necessary. IF nDimension == NIL nDimension := 1 ENDIF diff --git a/harbour/contrib/hbnf/aeminlen.prg b/harbour/contrib/hbnf/aeminlen.prg index bcace67af9..1d7b3c1827 100644 --- a/harbour/contrib/hbnf/aeminlen.prg +++ b/harbour/contrib/hbnf/aeminlen.prg @@ -60,7 +60,7 @@ FUNCTION FT_AEminlen( aArray, nDimension, nStart, nCount ) LOCAL i, nLast, cType, nMinlen := 65519 -// Set default parameters as necessary. + // Set default parameters as necessary. IF nDimension == NIL nDimension := 1 ENDIF diff --git a/harbour/contrib/hbnf/amedian.prg b/harbour/contrib/hbnf/amedian.prg index 6b90deccb3..cb600ecb3b 100644 --- a/harbour/contrib/hbnf/amedian.prg +++ b/harbour/contrib/hbnf/amedian.prg @@ -67,20 +67,20 @@ FUNCTION FT_AMEDIAN( aArray, nStart, nEnd ) DEFAULT nStart TO 1 DEFAULT nEnd TO Len( aArray ) -// Make Sure Bounds are in Range + // Make Sure Bounds are in Range FORCE_BETWEEN( 1, nEnd, Len( aArray ) ) FORCE_BETWEEN( 1, nStart, nEnd ) -// Length of aTemparray + // Length of aTemparray nTemplen := ( nEnd - nStart ) + 1 -// Initialize aTemparray + // Initialize aTemparray aTemparray := ACopy( aArray, Array( nTemplen ), nStart, nTemplen ) -// Sort aTemparray + // Sort aTemparray aTemparray := ASort( aTemparray ) -// Determine middle value(s) + // Determine middle value(s) IF ( nTemplen % 2 ) == 0 nMiddle1 := aTemparray[ ( nTemplen / 2 ) ] nMiddle2 := aTemparray[ Int( nTemplen / 2 ) + 1 ] diff --git a/harbour/contrib/hbnf/anomatch.prg b/harbour/contrib/hbnf/anomatch.prg index 9e7d2fbd6d..4ca6025b87 100644 --- a/harbour/contrib/hbnf/anomatch.prg +++ b/harbour/contrib/hbnf/anomatch.prg @@ -34,7 +34,7 @@ FUNCTION FT_ANOMATCHES( aArray, bCompareBlock, nStartIndex, nEndIndex ) DEFAULT nStartIndex TO 1 DEFAULT nEndIndex TO Len( aArray ) -// Make Sure Bounds are in Range + // Make Sure Bounds are in Range FORCE_BETWEEN( 1, nEndIndex, Len( aArray ) ) FORCE_BETWEEN( 1, nStartIndex, nEndIndex ) diff --git a/harbour/contrib/hbnf/asum.prg b/harbour/contrib/hbnf/asum.prg index ba96fea4b5..4adfcb7df6 100644 --- a/harbour/contrib/hbnf/asum.prg +++ b/harbour/contrib/hbnf/asum.prg @@ -35,7 +35,7 @@ FUNCTION FT_ASUM( aArray, nStartIndex, nEndIndex ) DEFAULT nStartIndex TO 1 DEFAULT nEndIndex TO Len( aArray ) -// Make Sure Bounds are in Range + // Make Sure Bounds are in Range FORCE_BETWEEN( 1, nEndIndex, Len( aArray ) ) FORCE_BETWEEN( 1, nStartIndex, nEndIndex ) diff --git a/harbour/contrib/hbnf/at2.prg b/harbour/contrib/hbnf/at2.prg index a25444b7f4..d2d24f51bb 100644 --- a/harbour/contrib/hbnf/at2.prg +++ b/harbour/contrib/hbnf/at2.prg @@ -62,7 +62,7 @@ FUNCTION FT_AT2( cSearch, cTarget, nOccurs, lCaseSens ) LOCAL nCount, nPos, nPos2 := 0 LOCAL cSubstr := cTarget -// Set default parameters as necessary. + // Set default parameters as necessary. IF lCaseSens == NIL lCaseSens := .T. ENDIF @@ -103,7 +103,7 @@ FUNCTION FT_RAT2( cSearch, cTarget, nOccurs, lCaseSens ) LOCAL nCount, nPos, nPos2 := 0 LOCAL cSubstr := cTarget -// Set default parameters as necessary. + // Set default parameters as necessary. IF lCaseSens == NIL lCaseSens := .T. ENDIF diff --git a/harbour/contrib/hbnf/blink.prg b/harbour/contrib/hbnf/blink.prg index af8a8acfd2..7480418b0f 100644 --- a/harbour/contrib/hbnf/blink.prg +++ b/harbour/contrib/hbnf/blink.prg @@ -35,21 +35,21 @@ PROCEDURE Main() FUNCTION FT_BLINK( cMsg, nRow, nCol ) -// Declare color restore var. + // Declare color restore var. LOCAL cSavColor -// Return if no msg. + // Return if no msg. IF cMsg == NIL RETURN NIL ENDIF -// Set default row and col to current. + // Set default row and col to current. nRow := iif( nRow == NIL, Row(), nRow ) nCol := iif( nCol == NIL, Col(), nCol ) cSavColor := SetColor() // Save colors to restore on exit. -// IF blink colors not already set, add blink to current foreground color. + // IF blink colors not already set, add blink to current foreground color. SetColor( iif( ( "*" $ Left( cSavColor, 4 ) ), cSavColor, "*" + cSavColor ) ) @ nRow, nCol SAY cMsg // Say the dreaded blinking msg. diff --git a/harbour/contrib/hbnf/clrsel.prg b/harbour/contrib/hbnf/clrsel.prg index 07dedef607..266f3d08ff 100644 --- a/harbour/contrib/hbnf/clrsel.prg +++ b/harbour/contrib/hbnf/clrsel.prg @@ -129,8 +129,7 @@ PROCEDURE Main( cVidMode ) { "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" } ; - } + { "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } } aClrs := FT_ClrSel( aClrs, lColour ) @@ -516,12 +515,12 @@ STATIC FUNCTION _ftClrSel( aClrPal, cClr, nElem, aOpt ) //.... check key movement and modify co-ordinates DO CASE - CASE nKey == K_ESC ; EXIT - CASE nKey == K_ENTER ; cClr := aClrPal[ nR, nC ] ; EXIT - CASE nKey == K_UP ; --nR - CASE nKey == K_DOWN ; ++nR - CASE nKey == K_LEFT ; --nC - CASE nKey == K_RIGHT ; ++nC + CASE nKey == K_ESC ; EXIT + CASE nKey == K_ENTER ; cClr := aClrPal[ nR, nC ] ; EXIT + CASE nKey == K_UP ; --nR + CASE nKey == K_DOWN ; ++nR + CASE nKey == K_LEFT ; --nC + CASE nKey == K_RIGHT ; ++nC ENDCASE ENDDO diff --git a/harbour/contrib/hbnf/datecnfg.prg b/harbour/contrib/hbnf/datecnfg.prg index 458983115c..e8a57071d3 100644 --- a/harbour/contrib/hbnf/datecnfg.prg +++ b/harbour/contrib/hbnf/datecnfg.prg @@ -170,9 +170,8 @@ PROCEDURE Main() // DEMO Monthly Calendar function. // nType : 0 -> FT_MONTH, 1 -> FT_ACCTMONTH -// -FUNCTION FT_CAL( dGivenDate, nType ) +STATIC FUNCTION FT_CAL( dGivenDate, nType ) LOCAL nTemp, dTemp, aTemp, cFY_Start, dStart, dEnd diff --git a/harbour/contrib/hbnf/dosver.prg b/harbour/contrib/hbnf/dosver.prg index aab7fb5637..501fa115c3 100644 --- a/harbour/contrib/hbnf/dosver.prg +++ b/harbour/contrib/hbnf/dosver.prg @@ -41,7 +41,7 @@ PROCEDURE Main() FUNCTION FT_DOSVER() - /* LOCAL aRegs[ INT86_MAX_REGS ] */ +// LOCAL aRegs[ INT86_MAX_REGS ] LOCAL cResult /* aRegs[ AX ] := MAKEHI( DOSVER ) diff --git a/harbour/contrib/hbnf/findith.prg b/harbour/contrib/hbnf/findith.prg index 8abb9834c2..7b29eb1d44 100644 --- a/harbour/contrib/hbnf/findith.prg +++ b/harbour/contrib/hbnf/findith.prg @@ -53,7 +53,7 @@ FUNCTION FT_FINDITH( cCheckFor, cCheckIn, nWhichOccurrence, lIgnoreCase ) LOCAL nIthOccurrence -// Is Case Sensitivity Important?? + // Is Case Sensitivity Important?? IF ! HB_ISLOGICAL( lIgnoreCase ) .OR. ; lIgnoreCase @@ -61,7 +61,7 @@ FUNCTION FT_FINDITH( cCheckFor, cCheckIn, nWhichOccurrence, lIgnoreCase ) MAKE_UPPER( cCheckIn ) ENDIF // IS_NOT_LOGICAL(lIgnoreCase) or -// lIgnoreCase + // lIgnoreCase RETURN iif( nWhichOccurrence == 1, ; At( cCheckFor, cCheckIn ), ; diff --git a/harbour/contrib/hbnf/gcd.prg b/harbour/contrib/hbnf/gcd.prg index 7cac320ef5..2b532e8291 100644 --- a/harbour/contrib/hbnf/gcd.prg +++ b/harbour/contrib/hbnf/gcd.prg @@ -39,7 +39,7 @@ FUNCTION FT_GCD( nNumber1, nNumber2 ) LOCAL nHold2 // Temporarily Hold the Minimum Number LOCAL nResult // GCD -// Either Number Zero?? + // Either Number Zero?? IF nNumber1 == 0 .OR. nNumber2 == 0 nResult := 0 // Yes, Can't Have a GCD ELSE // No, Calculate the GCD diff --git a/harbour/contrib/hbnf/invclr.prg b/harbour/contrib/hbnf/invclr.prg index c93cbb99de..de3cef98ec 100644 --- a/harbour/contrib/hbnf/invclr.prg +++ b/harbour/contrib/hbnf/invclr.prg @@ -34,14 +34,14 @@ FUNCTION FT_INVCLR( cDsrdColor ) LOCAL cModifiers // Any Color Modifiers (+*) DEFAULT cDsrdColor TO SetColor() -// Remove Anything Past 1st Color + // Remove Anything Past 1st Color cDsrdColor := Left( cDsrdColor, At( ",", cDsrdColor + "," ) - 1 ) -// Get Any Modifiers + // Get Any Modifiers cModifiers := iif( "*" $ cDsrdColor, "*", NULL ) + ; iif( "+" $ cDsrdColor, "+", NULL ) -// Separate the Fore/Background Colors + // Separate the Fore/Background Colors cForeground := AllTrim( Left( cDsrdColor, At( "/", cDsrdColor ) - 1 ) ) cBackground := AllTrim( SubStr( cDsrdColor, At( "/", cDsrdColor ) + 1 ) ) diff --git a/harbour/contrib/hbnf/lastday.prg b/harbour/contrib/hbnf/lastday.prg index e16f5ac87a..a70bd79bc6 100644 --- a/harbour/contrib/hbnf/lastday.prg +++ b/harbour/contrib/hbnf/lastday.prg @@ -21,11 +21,11 @@ * */ - /* Librarian's note: The toolkit's original ft_lday() function was - submitted by Jeff Bryant. Mike saw it and optimized it. Thanks - to you both for your great code! +/* Librarian's note: The toolkit's original ft_lday() function was + submitted by Jeff Bryant. Mike saw it and optimized it. Thanks + to you both for your great code! - */ + */ FUNCTION ft_lday( dDate ) diff --git a/harbour/contrib/hbnf/menutonf.prg b/harbour/contrib/hbnf/menutonf.prg index f207772772..50c02b92c6 100644 --- a/harbour/contrib/hbnf/menutonf.prg +++ b/harbour/contrib/hbnf/menutonf.prg @@ -46,7 +46,7 @@ ( \ > 0 .AND. \ <= nCount ) #xtranslate isBetween( , , ) => ; - ( < val > \ >= < lower > .AND. < val > \ <= < upper > ) + ( \ >= .AND. \ <= ) #define nTriggerInkey hb_keyCode( Upper( SubStr( cPrompt, nTrigger, 1 ) ) ) #define cTrigger SubStr( cPrompt, nTrigger, 1 ) @@ -230,7 +230,7 @@ FUNCTION FT_MenuTo( bGetSet, cReadVar, lCold ) DispBegin() IF t_aMessage[ nCurrent ] != NIL - cScreen := SaveScreen( t_aMsgRow[ nCurrent ], t_aMsgCol[ nCurrent ], ; + cScreen := SaveScreen( t_aMsgRow[ nCurrent ], t_aMsgCol[ nCurrent ], ; t_aMsgRow[ nCurrent ], t_aMsgCol[ nCurrent ] + ; Len( t_aMessage[ nCurrent ] ) - 1 ) diff --git a/harbour/contrib/hbnf/metaph.prg b/harbour/contrib/hbnf/metaph.prg index 6eaa243bf1..b438b2e235 100644 --- a/harbour/contrib/hbnf/metaph.prg +++ b/harbour/contrib/hbnf/metaph.prg @@ -191,26 +191,25 @@ STATIC FUNCTION _ftCol( nElem ) // Determine which column to start print //------------------------------------------------ #endif -// End of Test program //------------------------------------------------ FUNCTION FT_METAPH( cName, nSize ) -// Calculates the metaphone of a character string + // Calculates the metaphone of a character string LOCAL cMeta cName := iif( cName == NIL, "", cName ) // catch-all nSize := iif( nSize == NIL, 4, nSize ) // default size: 4-bytes -// Remove non-alpha characters and make upper case. -// The string is padded with 1 space at the beginning & end. -// Spaces, if present inside the string, are not removed until all -// the prefix/suffix checking has been completed. + // Remove non-alpha characters and make upper case. + // The string is padded with 1 space at the beginning & end. + // Spaces, if present inside the string, are not removed until all + // the prefix/suffix checking has been completed. cMeta := " " + _ftMakeAlpha( Upper( AllTrim( cName ) ) ) + " " -// prefixes which need special consideration + // prefixes which need special consideration IF " KN" $ cMeta ; cMeta := StrTran( cMeta, " KN" , " N" ) ; ENDIF IF " GN" $ cMeta ; cMeta := StrTran( cMeta, " GN" , " N" ) ; ENDIF IF " PN" $ cMeta ; cMeta := StrTran( cMeta, " PN" , " N" ) ; ENDIF @@ -225,16 +224,16 @@ FUNCTION FT_METAPH( cName, nSize ) IF " MAC" $ cMeta ; cMeta := StrTran( cMeta, " MAC", " MK" ) ; ENDIF IF " GI" $ cMeta ; cMeta := StrTran( cMeta, " GI", " K" ) ; ENDIF -// Suffixes which need special consideration + // Suffixes which need special consideration IF "MB " $ cMeta ; cMeta := StrTran( cMeta, "MB " , "M " ) ; ENDIF IF "NG " $ cMeta ; cMeta := StrTran( cMeta, "NG " , "N " ) ; ENDIF -// Remove inner spaces (1st and last byte are spaces) + // Remove inner spaces (1st and last byte are spaces) IF " " $ SubStr( cMeta, 2, Len( cMeta ) - 2 ) cMeta := " " + StrTran( cMeta, " " , "" ) + " " ENDIF -// Double consonants sound much the same as singles + // Double consonants sound much the same as singles IF "BB" $ cMeta ; cMeta := StrTran( cMeta, "BB" , "B" ) ; ENDIF IF "CC" $ cMeta ; cMeta := StrTran( cMeta, "CC" , "CH" ) ; ENDIF IF "DD" $ cMeta ; cMeta := StrTran( cMeta, "DD" , "T" ) ; ENDIF @@ -251,7 +250,7 @@ FUNCTION FT_METAPH( cName, nSize ) IF "XX" $ cMeta ; cMeta := StrTran( cMeta, "XX" , "KS" ) ; ENDIF IF "ZZ" $ cMeta ; cMeta := StrTran( cMeta, "ZZ" , "S" ) ; ENDIF -// J sounds + // J sounds IF "DGE" $ cMeta ; cMeta := StrTran( cMeta, "DGE" , "J" ) ; ENDIF IF "DGY" $ cMeta ; cMeta := StrTran( cMeta, "DGY" , "J" ) ; ENDIF IF "DGI" $ cMeta ; cMeta := StrTran( cMeta, "DGI" , "J" ) ; ENDIF @@ -259,14 +258,14 @@ FUNCTION FT_METAPH( cName, nSize ) IF "GE" $ cMeta ; cMeta := StrTran( cMeta, "GE" , "J" ) ; ENDIF IF "GY" $ cMeta ; cMeta := StrTran( cMeta, "GY" , "J" ) ; ENDIF -// X sounds (KS) + // X sounds (KS) IF "X" $ cMeta ; cMeta := StrTran( cMeta, "X" , "KS" ) ; ENDIF -// special consideration for SCH + // special consideration for SCH IF "ISCH" $ cMeta; cMeta := StrTran( cMeta, "ISCH", "IX" ) ; ENDIF IF "SCH" $ cMeta ; cMeta := StrTran( cMeta, "SCH" , "SK" ) ; ENDIF -// sh sounds (X) + // sh sounds (X) IF "CIA" $ cMeta ; cMeta := StrTran( cMeta, "CIA" , "X" ) ; ENDIF IF "SIO" $ cMeta ; cMeta := StrTran( cMeta, "SIO" , "X" ) ; ENDIF IF "C" $ cMeta ; cMeta := StrTran( cMeta, "SIA" , "X" ) ; ENDIF @@ -276,7 +275,7 @@ FUNCTION FT_METAPH( cName, nSize ) IF "TCH" $ cMeta ; cMeta := StrTran( cMeta, "TCH" , "X" ) ; ENDIF IF "CH" $ cMeta ; cMeta := StrTran( cMeta, "CH" , "X" ) ; ENDIF -// hissing sounds (S) + // hissing sounds (S) IF "SCI" $ cMeta ; cMeta := StrTran( cMeta, "SCI" , "S" ) ; ENDIF IF "SCE" $ cMeta ; cMeta := StrTran( cMeta, "SCE" , "S" ) ; ENDIF IF "SCY" $ cMeta ; cMeta := StrTran( cMeta, "SCY" , "S" ) ; ENDIF @@ -285,43 +284,43 @@ FUNCTION FT_METAPH( cName, nSize ) IF "CY" $ cMeta ; cMeta := StrTran( cMeta, "CY" , "S" ) ; ENDIF IF "Z" $ cMeta ; cMeta := StrTran( cMeta, "Z" , "S" ) ; ENDIF -// th sound (0) + // th sound (0) IF "TH" $ cMeta ; cMeta := StrTran( cMeta, "TH" , "0" ) ; ENDIF -// Convert all vowels to 'v' from 3rd byte on + // Convert all vowels to 'v' from 3rd byte on cMeta := Left( cMeta, 2 ) + _ftConvVowel( SubStr( cMeta, 3 ) ) -// Make Y's silent if not followed by vowel + // Make Y's silent if not followed by vowel IF "Y" $ cMeta cMeta := StrTran( cMeta, "Yv" , "#" ) // Y followed by vowel cMeta := StrTran( cMeta, "Y" , "" ) // not followed by vowel cMeta := StrTran( cMeta, "#" , "Yv" ) // restore Y and vowel ENDIF -// More G sounds, looking at surrounding vowels + // More G sounds, looking at surrounding vowels IF "GHv" $ cMeta ; cMeta := StrTran( cMeta, "GHv" , "G" ) ; ENDIF IF "vGHT" $ cMeta; cMeta := StrTran( cMeta, "vGHT", "T" ) ; ENDIF IF "vGH" $ cMeta ; cMeta := StrTran( cMeta, "vGH" , "W" ) ; ENDIF IF "GN" $ cMeta ; cMeta := StrTran( cMeta, "GN" , "N" ) ; ENDIF IF "G" $ cMeta ; cMeta := StrTran( cMeta, "G" , "K" ) ; ENDIF -// H sounds, looking at surrounding vowels + // H sounds, looking at surrounding vowels IF "vHv" $ cMeta ; cMeta := StrTran( cMeta, "vHv" , "H" ) ; ENDIF IF "vH" $ cMeta ; cMeta := StrTran( cMeta, "vH" , "" ) ; ENDIF -// F sounds + // F sounds IF "PH" $ cMeta ; cMeta := StrTran( cMeta, "PH" , "F" ) ; ENDIF IF "V" $ cMeta ; cMeta := StrTran( cMeta, "V" , "F" ) ; ENDIF -// D sounds a bit like T + // D sounds a bit like T IF "D" $ cMeta ; cMeta := StrTran( cMeta, "D" , "T" ) ; ENDIF -// K sounds + // K sounds IF "CK" $ cMeta ; cMeta := StrTran( cMeta, "CK" , "K" ) ; ENDIF IF "Q" $ cMeta ; cMeta := StrTran( cMeta, "Q" , "K" ) ; ENDIF IF "C" $ cMeta ; cMeta := StrTran( cMeta, "C" , "K" ) ; ENDIF -// Remove vowels + // Remove vowels cMeta := StrTran( cMeta, "v", "" ) RETURN PadR( AllTrim( cMeta ), nSize ) @@ -330,7 +329,7 @@ FUNCTION FT_METAPH( cName, nSize ) STATIC FUNCTION _ftMakeAlpha( cStr ) -// Strips non-alpha characters from a string, leaving spaces + // Strips non-alpha characters from a string, leaving spaces LOCAL x, cAlpha := "" @@ -346,7 +345,7 @@ STATIC FUNCTION _ftMakeAlpha( cStr ) STATIC FUNCTION _ftConvVowel( cStr ) -// Converts all vowels to letter 'v' + // Converts all vowels to letter 'v' LOCAL x, cConverted := "" diff --git a/harbour/contrib/hbnf/miltime.prg b/harbour/contrib/hbnf/miltime.prg index 17bb67c02d..f15ae0db57 100644 --- a/harbour/contrib/hbnf/miltime.prg +++ b/harbour/contrib/hbnf/miltime.prg @@ -27,7 +27,7 @@ PROCEDURE Main() - cls + CLS ? "am-pm" ? ft_civ2mil( " 5:40 pm" ) ? ft_civ2mil( "05:40 pm" ) @@ -37,7 +37,7 @@ PROCEDURE Main() ? ft_civ2mil( " 5:40 AM" ) ? Inkey( 0 ) - cls + CLS ? "noon-midnight" ? ft_civ2mil( "12:00 m" ) ? ft_civ2mil( "12:00 M" ) @@ -47,7 +47,7 @@ PROCEDURE Main() ? ft_civ2mil( "12:00 n" ) ? Inkey( 0 ) - cls + CLS ? "errors in noon-midnight" ? ft_civ2mil( "12:01 n" ) ? ft_civ2mil( "22:00 n" ) diff --git a/harbour/contrib/hbnf/mouse1.prg b/harbour/contrib/hbnf/mouse1.prg index 878c55e756..44d6a370b9 100644 --- a/harbour/contrib/hbnf/mouse1.prg +++ b/harbour/contrib/hbnf/mouse1.prg @@ -185,7 +185,7 @@ PROCEDURE Main( nRow, nCol ) RestScreen( 0, 0, MaxRow(), MaxCol(), cSavScr ) DevPos( MaxRow(), 0 ) -// Reset sensitivity + // Reset sensitivity FT_MSETSENS( nHoriz, nVert, nDouble ) @@ -340,7 +340,7 @@ FUNCTION FT_MSETSENS( nHoriz, nVert, nDouble ) // Fill the registers _mset_sensitive( nHoriz, nVert, nDouble ) - RETURN nil + RETURN NIL FUNCTION FT_MGETSENS( nHoriz, nVert, nDouble ) /* @@ -434,11 +434,11 @@ FUNCTION FT_MRESET() /* aReg[ AX ] := 0 // set mouse function call 0 FT_INT86( 51, aReg ) // execute mouse interrupt - */ +*/ t_lCrsState := .F. // Cursor is off after reset lStatus := _m_reset() -// Reset maximum x and y limits + // Reset maximum x and y limits FT_MYLIMIT( 0, 8 * MaxRow() ) FT_MXLIMIT( 0, 8 * MaxCol() ) diff --git a/harbour/contrib/hbnf/nooccur.prg b/harbour/contrib/hbnf/nooccur.prg index 8867583863..cf7e874287 100644 --- a/harbour/contrib/hbnf/nooccur.prg +++ b/harbour/contrib/hbnf/nooccur.prg @@ -27,14 +27,14 @@ FUNCTION FT_NOOCCUR( cCheckFor, cCheckIn, lIgnoreCase ) -// Is Case Important?? + // Is Case Important?? IF ! HB_ISLOGICAL( lIgnoreCase ) .OR. lIgnoreCase MAKE_UPPER( cCheckFor ) // No, Force Everything to Uppercase MAKE_UPPER( cCheckIn ) ENDIF -// lIgnoreCase + // lIgnoreCase RETURN iif( Len( cCheckFor ) == 0 .OR. Len( cCheckIn ) == 0, ; 0, ; diff --git a/harbour/contrib/hbnf/nwlstat.prg b/harbour/contrib/hbnf/nwlstat.prg index 414eb44e9e..0e31b4409a 100644 --- a/harbour/contrib/hbnf/nwlstat.prg +++ b/harbour/contrib/hbnf/nwlstat.prg @@ -41,12 +41,12 @@ PROCEDURE Main() FUNCTION FT_NWLSTAT() - /* LOCAL aRegs[ INT86_MAX_REGS ] */ +// LOCAL aRegs[ INT86_MAX_REGS ] LOCAL nStation /* aRegs[ AX ] := MAKEHI( STATNUM ) FT_INT86( DOS, aRegs ) - */ + */ nStation := _ft_nwkstat() /* LOWBYTE( aRegs[ AX ] ) */ IF nStation < 0 nStation += 256 diff --git a/harbour/contrib/hbnf/pegs.prg b/harbour/contrib/hbnf/pegs.prg index a69f7aca8e..56216bb591 100644 --- a/harbour/contrib/hbnf/pegs.prg +++ b/harbour/contrib/hbnf/pegs.prg @@ -31,11 +31,11 @@ #include "inkey.ch" #include "setcurs.ch" -#translate SINGLEBOX(, , , ) => ; - @ < top > , < left > , < bottom > , < right > BOX hb_UTF8ToStr( "┌─┐│┘─└│ " ) -#translate DOUBLEBOX(, , , ) => ; - @ < top > , < left > , < bottom > , < right > BOX hb_UTF8ToStr( "╔═╗║╝═╚║ " ) -MEMVAR getlist +#translate SINGLEBOX( , , , ) => ; + @ , , , BOX hb_UTF8ToStr( "┌─┐│┘─└│ " ) +#translate DOUBLEBOX( , , , ) => ; + @ , , , BOX hb_UTF8ToStr( "╔═╗║╝═╚║ " ) +MEMVAR GetList /* here's the board array -- structure of which is: @@ -91,7 +91,7 @@ FUNCTION FT_PEGS() */ scanblock := {| a | a[ 2 ] == move2 } - cls + CLS SetColor( "w/r" ) SINGLEBOX( 22, 31, 24, 48 ) @ 23, 33 SAY "Your move:" @@ -183,7 +183,7 @@ STATIC FUNCTION err_msg( msg ) SetCursor( SC_NORMAL ) RestScreen( 23, 33, 23, 47, buffer ) - RETURN nil + RETURN NIL //--------------------------------------------------------------------* diff --git a/harbour/contrib/hbnf/pending.prg b/harbour/contrib/hbnf/pending.prg index 057034535e..9971eb8b64 100644 --- a/harbour/contrib/hbnf/pending.prg +++ b/harbour/contrib/hbnf/pending.prg @@ -26,9 +26,9 @@ 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. + // 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. diff --git a/harbour/contrib/hbnf/pickday.prg b/harbour/contrib/hbnf/pickday.prg index 1b8f329da8..aa1f532f64 100644 --- a/harbour/contrib/hbnf/pickday.prg +++ b/harbour/contrib/hbnf/pickday.prg @@ -36,10 +36,10 @@ PROCEDURE Main() FUNCTION FT_PICKDAY() - LOCAL DAYS := { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", ; + LOCAL days := { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", ; "FRIDAY", "SATURDAY" } - LOCAL SEL := 0 - LOCAL OLDSCRN := SaveScreen( 8, 35, 16, 45 ), oldcolor := SetColor( "+w/r" ) + LOCAL sel := 0 + LOCAL oldscrn := SaveScreen( 8, 35, 16, 45 ), oldcolor := SetColor( "+w/r" ) @ 8, 35, 16, 45 BOX hb_UTF8ToStr( "┌─┐│┘─└│ " ) /* do not allow user to Esc out, which would cause array access error */ diff --git a/harbour/contrib/hbnf/popadder.prg b/harbour/contrib/hbnf/popadder.prg index a6faae789c..696f207ac1 100644 --- a/harbour/contrib/hbnf/popadder.prg +++ b/harbour/contrib/hbnf/popadder.prg @@ -261,8 +261,10 @@ FUNCTION FT_Adder() IF lTape RestScreen( 4 + nTopOS, 6 + nTapeSpace, 22 + nTopOS, 35 + nTapeSpace, cTapeScr ) ENDIF - IF Left( SaveScreen( 6 + nTopOS, 26 + nAddSpace, 6 + nTopOS, 27 + nAddSpace ), 1 ) ; + // TOFIX: manipulating savescreen buffers + IF Left( SaveScreen( 6 + nTopOS, 26 + nAddSpace, 6 + nTopOS, 27 + nAddSpace ), 1 ) ; != " " + // TOFIX: manipulating savescreen buffers IF Left( SaveScreen( 6 + nTopOS, 19 + nAddSpace, 6 + nTopOS, 20 + nAddSpace ), 1 ) ; == "S" cMoveTotSubTot := "S" @@ -272,10 +274,11 @@ FUNCTION FT_Adder() ELSE cMoveTotSubTot := " " ENDIF + // TOFIX: manipulating savescreen buffers cTotal := _ftCharOdd( SaveScreen( 4 + nTopOS, 8 + nAddSpace, 4 + ; nTopOS, 25 + nAddSpace ) ) _ftPopWin() // Remove Adder - lShowRight := !lShowRight + lShowRight := ! lShowRight nAddSpace := iif( lShowRight, 40, 0 ) + nLeftOS nTapeSpace := iif( lShowRight, 0, 40 ) + nLeftOS _ftAddScreen( aAdder ) @@ -287,7 +290,7 @@ FUNCTION FT_Adder() @ 4 + nTopOS, 8 + nAddSpace SAY cTotal IF !Empty( cMoveTotSubTot ) _ftSetWinColor( W_CURR, W_SCREEN ) - @ 6 + nTopOS, 18 + nAddSpace SAY iif( cMoveTotSubTot == "T", " ", ; + @ 6 + nTopOS, 18 + nAddSpace SAY iif( cMoveTotSubTot == "T", " ", ; "" ) _ftSetWinColor( W_CURR, W_PROMPT ) ENDIF @@ -296,7 +299,7 @@ FUNCTION FT_Adder() SetColor( "GR+/W" ) @ 21 + nTopOS, 8 + nTapeSpace SAY hb_UTF8ToStr( " ↑↓-SCROLL -QUIT " ) SetColor( "N/W,W+/N" ) - AChoice( 5 + nTopOS, 7 + nTapeSpace, 20 + nTopOS, 32 + nTapeSpace, aTrans, .T. , ; + AChoice( 5 + nTopOS, 7 + nTapeSpace, 20 + nTopOS, 32 + nTapeSpace, aTrans, .T. , ; "_ftAdderTapeUDF", nTotTran, 20 ) SetColor( "R+/W" ) @ 21 + nTopOS, 8 + nTapeSpace TO 21 + nTopOS, 30 + nTapeSpace @@ -792,7 +795,7 @@ STATIC FUNCTION _ftAddHelp " - Quit" + hb_eol() + ; " - return a to the active get" - _ftPushMessage( cMess, .T. , "ADDER HELP", "press any key to continue...", ; + _ftPushMessage( cMess, .T. , "ADDER HELP", "press any key to continue...", ; "QUIET" ) RETURN NIL @@ -1010,7 +1013,7 @@ STATIC FUNCTION _ftDisplayTape( aAdder, nKey ) IF nTotTran > 15 nTopTape := nTotTran - 15 ENDIF - FOR nDispTape := nTotTran TO nTopTape STEP - 1 + FOR nDispTape := nTotTran TO nTopTape STEP -1 @ 20 + nDispTape - nTotTran + nTopOS, 7 + nTapeSpace SAY aTrans[ nDispTape ] NEXT ENDIF @@ -1223,7 +1226,7 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n nLeft := Int( ( MaxCol() - nWide ) / 2 ) - 4 nRight := nLeft + nWide + 4 - _ftPushWin( nTop, nLeft, nBottom, nRight, "QUESTION ?", iif( HB_ISSTRING( xVarVal ) ; + _ftPushWin( nTop, nLeft, nBottom, nRight, "QUESTION ?", iif( HB_ISSTRING( xVarVal ) ; .AND. nVarLen > nWide, hb_UTF8ToStr( "← scroll →" ), NIL ), nWinColor ) DISPMESSAGE cMessage, nTop + 1, nLeft + 2, nBottom - 1, nRight - 2 @@ -1361,7 +1364,7 @@ STATIC FUNCTION _ftError( cMessage, xDontReset ) cErrorScr := SaveScreen( nTop, nLeft, nBot + 1, nRight + 2 ) _ftShadow( nBot + 1, nLeft + 2, nBot + 1, nRight + 2, 8 ) - _ftShadow( nTop + 1, nRight + 1, nBot , nRight + 2, 8 ) + _ftShadow( nTop + 1, nRight + 1, nBot, nRight + 2, 8 ) @ nTop, nLeft, nBot, nRight BOX B_SINGLE @ nTop, nLeft + Int( nWide / 2 ) - 1 SAY " ERROR " @ nBot - 1, nLeft + Int( nWide - 28 ) / 2 + 3 SAY "Press any key to continue..." @@ -1621,6 +1624,7 @@ STATIC FUNCTION _ftSetWinColor( nWin, nStd, nEnh, nBord, nBack, nUnsel ) STATIC FUNCTION _ftShadow( nTop, nLeft, nBottom, nRight ) + // TOFIX: manipulating savescreen buffers LOCAL theShadow := SaveScreen( nTop, nLeft, nBottom, nRight ) RestScreen( nTop, nLeft, nBottom, nRight, ; diff --git a/harbour/contrib/hbnf/settime.prg b/harbour/contrib/hbnf/settime.prg index 3573cc6e9e..b99896bfd5 100644 --- a/harbour/contrib/hbnf/settime.prg +++ b/harbour/contrib/hbnf/settime.prg @@ -55,10 +55,10 @@ FUNCTION FT_SETTIME( cTime ) cTime := iif( cTime == NIL, Time(), cTime ) -// -------- High Byte ------ ----- Low Byte ------- + // -------- High Byte ------ ----- Low Byte ------- aRegs[ AX ] := SETTIME * ( 2 ^ 8 ) - aRegs[ CX ] := HRS( cTime ) * ( 2 ^ 8 ) + MINS( cTime ) + aRegs[ CX ] := HRS( cTime ) * ( 2 ^ 8 ) + MINS( cTime ) aRegs[ DX ] := Secs( cTime ) * ( 2 ^ 8 ) RETURN FT_INT86( DOS, aRegs ) diff --git a/harbour/contrib/hbnf/sleep.prg b/harbour/contrib/hbnf/sleep.prg index 010d263431..26adbb6709 100644 --- a/harbour/contrib/hbnf/sleep.prg +++ b/harbour/contrib/hbnf/sleep.prg @@ -24,7 +24,6 @@ // Test routine // Invoke by running SLEEP 1.0 to sleep 1.0 seconds -// PROCEDURE Main( nSleep ) diff --git a/harbour/contrib/hbnf/tbwhile.prg b/harbour/contrib/hbnf/tbwhile.prg index 6c1bda98d7..f121e75d78 100644 --- a/harbour/contrib/hbnf/tbwhile.prg +++ b/harbour/contrib/hbnf/tbwhile.prg @@ -70,7 +70,7 @@ * tbnames.dbf/.ntx ARE AUTOMATICALLY CREATED BY THIS TEST PROGRAM */ -PROCEDURE TBWHILE() +PROCEDURE Main() LOCAL aFields := {}, cKey := "O", cOldColor LOCAL nFreeze := 1, lSaveScrn := .T. , nRecSel @@ -91,8 +91,8 @@ PROCEDURE TBWHILE() 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() + // 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 } } ) @@ -103,17 +103,17 @@ PROCEDURE TBWHILE() @ 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. + // 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 + // 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 diff --git a/harbour/contrib/hbnf/tests/ftgete.prg b/harbour/contrib/hbnf/tests/ftgete.prg index 0ca0105bab..d98a72b49b 100644 --- a/harbour/contrib/hbnf/tests/ftgete.prg +++ b/harbour/contrib/hbnf/tests/ftgete.prg @@ -4,7 +4,7 @@ #include "simpleio.ch" -PROCEDURE main() +PROCEDURE Main() LOCAL a LOCAL c diff --git a/harbour/contrib/hbnf/tests/nftest.prg b/harbour/contrib/hbnf/tests/nftest.prg index 13cf085588..67c33c45fb 100644 --- a/harbour/contrib/hbnf/tests/nftest.prg +++ b/harbour/contrib/hbnf/tests/nftest.prg @@ -9,1081 +9,1088 @@ #include "directry.ch" #include "inkey.ch" -* Default heading, column, footer separators +// Default heading, column, footer separators #define DEF_HSEP "=+=" #define DEF_CSEP " | " #define DEF_FSEP "=+=" -* Default info for tb_methods section +// Default info for tb_methods section #define KEY_ELEM 1 #define BLK_ELEM 2 -STATIC nWait := 0.2 - -function Main() - LOCAL var0, nstart, nstop, nelapsed, nCtr - local aRet[8], i - LOCAL ar[3, 26], aBlocks[3], aHeadings[3], nElem := 1, bGetFunc, cRet - - nKey := 0 - - // - // Cover - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "Next screens will be a functions list contained in the library libnf," - ? "a port in xHarbour of the Nanforum Library for Clipper. The list is" - ? "organized as the original Norton Guide for the library. After the list" - ? "for each group of functions will be a demo of them." - ? - ? "A few new functions are added to the library libnf in order to expand" - ? "is power in this new xBase chapter. The demo of this function will be" - ? "in the group where they must included." - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - SET KEY K_F1 TO - - // - // Array group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF ARRAY FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_AADDITION() Add elements unique of source array to target array" - ? "FT_AAVG() Average numeric values in an array" - ? "FT_ADESSORT() Sort an array in descending order" - ? "FT_AEMAXLEN() Find longest element within an array" - ? "FT_AEMINLEN() Find shortest element within an array" - ? "FT_AMEDIAN() Find middle value in array, or average of two middle values" - ? "FT_ANOMATCHES() Find the number of array elements meeting a condition" - ? "FT_AREDIT() 2 dimensional array editing function using TBrowse" - ? "FT_ASUM() Sum the elements of an array" - ? "FT_RESTARR() Restore a Clipper array from a disc file" - ? "FT_SAVEARR() Save Clipper array to a disc file." - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_ADDITION example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AADDITION" - ? REPLICATE( "-", 78 ) - ? - 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 1000 - var0 := FT_AADDITION( aList1, aList2 ) - NEXT - nstop := SECONDS() - nelapsed := nstop - nstart - ? "time for 1000 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 + ",") } ) - ? - release aList, aList2 - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_AAVG example - // - aSubTotals := { 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2 } - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AAVG" - ? REPLICATE( "-", 78 ) - ? - ? "aSubTotals : " - AEVAL( aSubTotals, { |x| QQOUT( transform( x, "9.99" ) + ",") } ) - ? - var0 := FT_AAVG( aSubTotals ) - ? PADR("FT_AAVG( aSubTotals ) ->", 44) + transform( var0, "9.99" ) - ? - var0 := FT_AAVG( aSubTotals, 2, 4 ) - ? PADR("FT_AAVG( aSubTotals, 2, 4 ) ->", 44) + transform( var0, "9.99" ) - ? - var0 := FT_AAVG( aSubTotals, 5 ) - ? PADR("FT_AAVG( aSubTotals, 5 ) ->", 44) + transform( var0, "9.99" ) - ? - var0 := FT_AAVG( aSubTotals, , 10 ) - ? PADR("FT_AAVG( aSubTotals, , 10 ) ->", 44) + transform( var0, "9.99" ) - ? - release aSubTotals - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_ADESSORT example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ADESSORT" - ? REPLICATE( "-", 78 ) - ? - ? "aNames : " - aNames := { 'Mary', 'Albert' , 'John', 'Frank', 'Daniel', 'Giuliano'} - AEVAL( aNames, { |x| QQOUT( x + ",") } ) - ? - aNames := { 'Mary', 'Albert' , 'John', 'Frank', 'Daniel', 'Giuliano'} - var0 := FT_ADESSORT( aNames ) - ? PADR("FT_ADESSORT( aNames ) ->", 30) - AEVAL( var0, { |x| QQOUT(x + ",") } ) - ? - aNames := { 'Mary', 'Albert' , 'John', 'Frank', 'Daniel', 'Giuliano'} - var0 := FT_ADESSORT( aNames, 3 ) - ? PADR("FT_ADESSORT( aNames, 3 ) ->", 30) - AEVAL( var0, { |x| QQOUT(x + ",") } ) - ? - aNames := { 'Mary', 'Albert' , 'John', 'Frank', 'Daniel', 'Giuliano'} - var0 := FT_ADESSORT( aNames, , 3 ) - ? PADR("FT_ADESSORT( aNames, , 3 ) ->", 30) - AEVAL( var0, { |x| QQOUT(x + ",") } ) - ? - aNames := { 'Mary', 'Albert' , 'John', 'Frank', 'Daniel', 'Giuliano'} - var0 := FT_ADESSORT( aNames, 2, 5 ) - ? PADR("FT_ADESSORT( aNames, 2, 5 ) ->", 30) - AEVAL( var0, { |x| QQOUT(x + ",") } ) - ? - release aNames - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_AEMAXLEN example - // - setcolor ('w+/b') - myarray1 := DIRECTORY() - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMAXLEN" - ? REPLICATE( "-", 78 ) - ? - ? "myarray1 := DIRECTORY()" - ? - //aEval( myarray1, {|v| qout( padr(v[1],12), v[2], v[3], v[4], v[5] ) } ) - //? - 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 - ? - release myarray1 - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_AEMINLEN example - // - setcolor ('w+/b') - myarray1 := DIRECTORY() - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMINLEN" - ? REPLICATE( "-", 78 ) - ? - ? "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 - ? - release myarray1 - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_AEMEDIAN example - // - setcolor ('w+/b') - myarray0 := DIRECTORY() - myarray1 := {} - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AMEDIAN" - ? REPLICATE( "-", 78 ) - ? - ? "myarray0 := DIRECTORY()" - ? - //aEval( myarray0, {|v| qout( padr(v[1],12), v[2], v[3], v[4], v[5] ) } ) - //? - 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 - ? - release myarray0, myarray1 - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_ANOMATCHES example - // - setcolor ('w+/b') - aNames := { 'Mary', 'Albert' , 'John', 'Frank', 'Daniel', 'Giuliano'} - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ANOMATCHES" - ? REPLICATE( "-", 78 ) - ? - ? "myarray0 := DIRECTORY()" - ? - ? "aNames : " - AEVAL( aNames, { |x| QQOUT( x + ",") } ) - ? - var0 := FT_ANOMATCHES( aNames, { |x| at( 'a', x ) > 0 } ) - ? PADR('FT_ANOMATCHES( aNames, { |x| at( "a", x ) > 0 } ) ->',60) - ?? var0 - ? - var0 := FT_ANOMATCHES( aNames, { |x| at( 'an', x ) > 0 } ) - ? PADR('FT_ANOMATCHES( aNames, { |x| at( "an", x ) > 0 } ) ->',60) - ?? var0 - ? - var0 := FT_ANOMATCHES( aNames, { |x| at( 'an', x ) > 0 }, 1, 3 ) - ? PADR('FT_ANOMATCHES( aNames, { |x| at( "an", x ) > 0 }, 1, 3 ) ->',60) - ?? var0 - ? - release aNames - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_AREDIT example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AREDIT" - ? REPLICATE( "-", 78 ) - * set up 2 dimensional array ar[] - FOR i := 1 TO 26 - ar[1, i] := i // 1 -> 26 Numeric - ar[2, i] := CHR(i+64) // "A" -> "Z" Character - ar[3, i] := CHR(91-i) // "Z" -> "A" Character - NEXT i - * Set Up aHeadings[] 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 - @ 21,4 SAY "Use Cursor Keys To Move Between Fields, = Delete Row, = Add Row" - @ 22,7 SAY " = Quit Array Edit, or Edits Element" - SetColor( "N/W, W/N, , , W/N" ) - cRet := FT_ArEdit(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc) - setcolor ('w+/b') - @ 24, 0 - @ 23, 0 - @ 22, 0 - @ 21, 0 - ? "Return Value :", cRet - ? "Lastkey() = ESC:", LASTKEY() == K_ESC - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_ASUM example - // - aSubTotals := { 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2 } - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ASUM" - ? REPLICATE( "-", 78 ) - ? - ? "aSubTotals : " - AEVAL( aSubTotals, { |x| QQOUT( transform( x, "999.99" ) + ",") } ) - ? - var0 := FT_ASUM( aSubTotals ) - ? PADR("FT_ASUM( aSubTotals ) ->", 44) + transform( var0, "999.99" ) - ? - var0 := FT_ASUM( aSubTotals, 2, 4 ) - ? PADR("FT_ASUM( aSubTotals, 2, 4 ) ->", 44) + transform( var0, "999.99" ) - ? - var0 := FT_ASUM( aSubTotals, 5 ) - ? PADR("FT_ASUM( aSubTotals, 5 ) ->", 44) + transform( var0, "999.99" ) - ? - var0 := FT_ASUM( aSubTotals, , 10 ) - ? PADR("FT_ASUM( aSubTotals, , 10 ) ->", 44) + transform( var0, "999.99" ) - ? - release aSubTotals - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_RESTARR AND FT_SAVEARR example - // - aArray := { {'Invoice 1', CTOD('04/15/91'), 1234.32, .T.},; - {'Invoice 2', DATE(), 234.98, .F.},; - {'Invoice 3', DATE() + 1, 0, .T.} } - nErrorCode := 0 - setcolor ('w+/b') - cls - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_RESTARR AND FT_SAVEARR" - ? REPLICATE( "-", 78 ) - ? - ? "Saving array ..." - ? - FT_SAVEARR(aArray,'invoice.dat',@nErrorCode) - IF nErrorCode == 0 - DispArray(aArray) - aSave := FT_RESTARR('invoice.dat',@nErrorCode) - IF nErrorCode == 0 - ? - ? "Restoring array from disk ..." - ? - DispArray(aSave) - ELSE - ? 'Error restoring array' - ENDIF - ELSE - ? 'Error writing array' - ENDIF - release aArray, aSave, nErrorCode - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // Conversion group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF CONVERSION FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_BYT2BIT() Convert byte to string of 1's and 0's" - ? "FT_BYT2HEX() Convert byte to hexadecimal version of its binary value" - ? "FT_D2E() Convert decimal to scientific notation" - ? "FT_DEC2BIN() Convert decimal to binary" - ? "FT_E2D() Convert scientific notation string to a decimal" - ? "FT_ESCCODE() Convert Lotus style escape codes" - ? "FT_HEX2DEC() Convert a hex number to decimal" - ? "FT_INVCLR() Get the inverse of a color" - ? "FT_NTOW() Translate numeric value to words" - ? "FT_SQZN() Compress a numeric value into a character string" - ? "FT_STOD() Convert a date string to a Clipper date data type" - ? "FT_UNSQZN() Uncompress a numeric compressed by FT_SQZN()" - ? "FT_XTOY() Convert from any data type to any other data type" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_BYT2BIT() example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_BYT2BIT()" - ? REPLICATE( "-", 78 ) - ? - var0 := FT_BYT2BIT( 'a' ) - ? PADR("FT_BYT2BIT( 'a' ) ->", 44) + var0 - ? - var0 := FT_BYT2BIT( 'm' ) - ? PADR("FT_BYT2BIT( 'm' ) ->", 44) + var0 - ? - var0 := FT_BYT2BIT( 'A' ) - ? PADR("FT_BYT2BIT( 'A' ) ->", 44) + var0 - ? - var0 := FT_BYT2BIT( 'C' ) - ? PADR("FT_BYT2BIT( 'C' ) ->", 44) + var0 - ? - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_BYT2HEX() example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_BYT2HEX()" - ? REPLICATE( "-", 78 ) - ? - var0 := FT_BYT2HEX( 'a' ) - ? PADR("FT_BYT2HEX( 'a' ) ->", 44) + var0 - ? - var0 := FT_BYT2HEX( 'm' ) - ? PADR("FT_BYT2HEX( 'm' ) ->", 44) + var0 - ? - var0 := FT_BYT2HEX( 'A' ) - ? PADR("FT_BYT2HEX( 'A' ) ->", 44) + var0 - ? - var0 := FT_BYT2HEX( 'C' ) - ? PADR("FT_BYT2HEX( 'C' ) ->", 44) + var0 - ? - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_D2E() example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_D2E()" - ? REPLICATE( "-", 78 ) - ? - var0 := FT_D2E( 12.345, 2 ) - ? PADR("FT_D2E( 12.345, 2 ) ->", 44) + var0 - ? - var0 := FT_D2E( -12.345, 3 ) - ? PADR("FT_D2E( -12.345, 3 ) ->", 44) + var0 - ? - var0 := FT_D2E( 0.00000543, 2 ) - ? PADR("FT_D2E( 0.00000543, 2 ) ->", 44) + var0 - ? - var0 := FT_D2E( 1010000000, 5 ) - ? PADR("FT_D2E( 1010000000, 5 ) ->", 44) + var0 - ? - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_DEC2BIN() example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_DEC2BIN()" - ? REPLICATE( "-", 78 ) - ? - var0 := FT_DEC2BIN(255) - ? PADR("FT_DEC2BIN(255) ->", 44) + var0 - ? - var0 := FT_DEC2BIN(105) - ? PADR("FT_DEC2BIN(105) ->", 44) + var0 - ? - var0 := FT_DEC2BIN(1) - ? PADR("FT_DEC2BIN(1) ->", 44) + var0 - ? - var0 := FT_DEC2BIN(15) - ? PADR("FT_DEC2BIN(15) ->", 44) + var0 - ? - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_E2D() example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_E2D()" - ? REPLICATE( "-", 78 ) - ? - var0 := FT_E2D( "1.23E1" ) - ? PADR("FT_E2D( '1.23E1' ) ->", 34) + transform( var0, "9999999999.999999" ) - ? - var0 := FT_E2D( "-1.235E1" ) - ? PADR("FT_E2D( '-1.235E1' ) ->", 34) + transform( var0, "9999999999.999999" ) - ? - var0 := FT_E2D( "5.43E-6" ) - ? PADR("FT_E2D( '5.43E-6' ) ->", 34) + transform( var0, "9999999999.99999999" ) - ? - var0 := FT_E2D( "1.101E6" ) - ? PADR("FT_E2D( '1.101E6' ) ->", 34) + transform( var0, "9999999999.999999" ) - ? - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_STOD() example - // - setcolor ('w+/b') - set century on - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_STOD()" - ? REPLICATE( "-", 78 ) - ? - var0 := FT_STOD( "19901127" ) - ? PADR("FT_STOD( '19901127' ) ->", 44) + Transform( var0, '@d' ) - ? - var0 := FT_STOD( '20060117' ) - ? PADR("FT_STOD( '20060117' ) ->", 44) + Transform( var0, '@d' ) - ? - var0 := FT_STOD( '20060406' ) - ? PADR("FT_STOD( '20060406' ) ->", 44) + Transform( var0, '@d' ) - ? - var0 := FT_STOD( '20041231' ) - ? PADR("FT_STOD( '20041231' ) ->", 44) + Transform( var0, '@d' ) - ? - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // DOS / BIOS group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF DOS/BIOS FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_CHDIR() Change the current directory" - ? "FT_DEFAULT() Retrieve and optionally change the current default drive" - ? "FT_DOSVER Return the current DOS major and minor version as a string" - ? "FT_DSKFREE() Return the amount of available disk space" - ? "FT_DSKSIZE() Return the maximum capacity of a fixed disk" - ? "FT_IAMIDLE() Inform the operating system that the application is idle." - ? "FT_INP() Retrieve a byte from a specified I/O port" - ? "FT_INT86() Execute a software interrupt" - ? "FT_ISPRINT() Check printer status" - ? "FT_ISSHARE() Determine if DOS Share is installed" - ? "FT_MKDIR() Create a subdirectory" - ? "FT_OUTP() Write a byte to a specified I/O port" - ? "FT_PEEK() Retrieve a byte from a specified memory location." - ? "FT_POKE() Write a byte to a specified memory location" - ? "FT_REBOOT() Force a warm or cold boot" - ? "FT_RMDIR() Delete a subdirectory" - ? "FT_SETDATE() Set the DOS system date" - ? "FT_SETTIME() Set the DOS system time" - ? "FT_SYSMEM() Determine the amount of conventional memory installed" - ? "FT_TEMPFIL() Create a file with a unique name" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // DATE / TIME group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF DATE / TIME FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_ACCTADJ() Adjust beginning or ending fiscal pd. dates to acctg. dates" - ? "FT_ACCTMONTH() Return accounting month data" - ? "FT_ACCTQTR() Return accounting quarter data" - ? "FT_ACCTWEEK() Return accounting week data" - ? "FT_ACCTYEAR() Return accounting year data" - ? "FT_ADDWKDY() Return true number of days to add given number of workdays" - ? "FT_CALENDAR() Display date/time calendar, find a date, return calendar data." - ? "FT_CIV2MIL() Convert usual civilian format time to military time." - ? "FT_DATECNFG() Set beginning of year/week for FT_ date functions" - ? "FT_DAYOFYR() Return calendar, fiscal or accounting day data" - ? "FT_DAYTOBOW() Calculate no. of days between date and beginning of week" - ? "FT_DOY() Find number of day within year" - ? "FT_EASTER() Return the date of Easter" - ? "FT_ELAPMIN() Return difference, in minutes, between two mil format times." - ? "FT_ELAPSED() Return elapsed time between two days and/or times" - ? "FT_ELTIME() Compute difference between times in hours, minutes, seconds." - ? "FT_FDAY() Return first day of the month" - ? "FT_LDAY() Return last day of the month" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // DATE / TIME group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF DATE / TIME FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_MADD() Add or subtract months to/from a date" - ? "FT_MIL2CIV() Convert time in military format to civilian format." - ? "FT_MIL2MIN() Convert time in military format to number of minute of day." - ? "FT_MIN2DHM() Convert numeric minutes to days, hours and minutes." - ? "FT_MIN2MIL() Convert minute of day to military format time." - ? "FT_MONTH() Return Calendar or Fiscal Month Data" - ? "FT_QTR() Return Calendar or Fiscal Quarter Data." - ? "FT_SYS2MIL() Convert system time to military time format." - ? "FT_WEEK() Return calendar or fiscal week data" - ? "FT_WORKDAYS() Return number of work days between two dates" - ? "FT_WOY() Find number of week within year" - ? "FT_YEAR() Return calendar or fiscal year data" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_CALENDAR example - // - setcolor ('w+/b') - cls - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_CALENDAR" - ? REPLICATE( "-", 78 ) - ? - keyboard chr (28) - aRet := ft_calendar (10,40,'w+/rb',.t.,.t.) //display calendar, return all. - cls - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_CALENDAR" - ? REPLICATE( "-", 78 ) - ? - @ 9, 10 SAY 'FT_CALENDAR return values' - @ 11, 10 SAY 'Date :'+dtoc(aRet[1]) - @ 12, 10 SAY 'Month Number:'+str(aRet[2],2,0) - @ 13, 10 SAY 'Day Number :'+str(aRet[3],2,0) - @ 14, 10 SAY 'Year Number :'+str(aRet[4],4,0) - @ 15, 10 SAY 'Month :'+aRet[5] - @ 16, 10 SAY 'Day :'+aRet[6] - @ 17, 10 SAY 'Julian Day :'+str(aRet[7],3,0) - @ 18, 10 SAY 'Current Time:'+aRet[8] - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // ENVIRONMENT group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF ENVIRONMENT FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_GETE() Return the entire current environment" - ? "FT_LINKED() Determine if a function was linked in" - ? "FT_ORIGIN() Report the drive, path and filename of the current program" - ? "FT_RESTSETS() Restore status of all SET command settings" - ? "FT_SAVESETS() Save the status of all the SET command settings" - ? "FT_SETCENTURY() Check/Set the CENTURY Setting" - ? "FT_TREE() Locate all directories and subdirectories on a drive" - ? "FT_WHEREIS() Locate all occurrences of a filespec on a drive" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // EVENT group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF EVENT FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_IDLE() Generate an idle event to allow incremental garbage collection." - ? "FT_ONIDLE() Evaluate a designated code block during idle states." - ? "FT_ONTICK() Evaluate a designated code block at a designated interval." - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FILE I/O group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF FILE I/O FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_DFCLOSE() Close file displayed by FT_DISPFILE()" - ? "FT_DFSETUP() Set up parameters for FT_DISPFILE()" - ? "FT_DISPFILE() Browse a text file" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_DISPFILE example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_DISPFILE" - ? REPLICATE( "-", 78 ) - ? "Press aAbB to terminate." - @ 4,9 TO 21,71 - FT_DFSETUP("libnf.prg", 5, 10, 20, 70, 1, 48, 124, "AaBb" , .f., 5, 132, 4096) - cKey := FT_DISPFILE() - FT_DFCLOSE() - @ 23, 10 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']' - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // GAME group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF GAME FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? " FT_PEGS() FT_PEGS GAME (all work and no play...)" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // KEYBOARD / MOUSE group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF KEYBOARD / MOUSE FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_ALT() Determine status of the Alt key" - ? "FT_CAPLOCK() Determine and optionally change the status of CapLock key" - ? "FT_CTRL() Determine status of the Ctrl key" - ? "FT_LASTKEY() Force LastKey() to return a programmer-defined value." - ? "FT_MBUTPRS() Retrieve button press status" - ? "FT_MBUTREL() Get mouse button release information" - ? "FT_MCONOFF() Turn mouse cursur off if in specified region" - ? "FT_MCURSOR() Set the mouse cursor" - ? "FT_MDBLCLK() Return true if a double click was detected" - ? "FT_MDEFCRS() Define the mouse cursor" - ? "FT_MGETCOORD() Get mouse cursor position (text coord.) and button status" - ? "FT_MGETPAGE() Get the display page for the mouse pointer" - ? "FT_MGETPOS() Get mouse cursor position and button status" - ? "FT_MGETSENS() Get the mouse sensitivity parameters" - ? "FT_MGETX() Get mouse cursor row position" - ? "FT_MGETY() Get mouse cursor column position" - ? "FT_MHIDECRS() Decrement internal mouse cursor flag and hide mouse cursor" - ? "FT_MINIT() Initialize the mouse driver, vars and return status of mouse" - ? "FT_MINREGION() Test if the mouse cursor is in the passed region" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // KEYBOARD / MOUSE group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF KEYBOARD / MOUSE FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_MMICKEYS() Get mickeys" - ? "FT_MRESET() Reset mouse driver and return status of mouse" - ? "FT_MSETCOORD() Position the mouse cursor using text screen coordinates" - ? "FT_MSETPAGE() Set the display page for the mouse pointer" - ? "FT_MSETPOS() Position the mouse cursor using virtual screen coordinates" - ? "FT_MSETSENS() Set the mouse sensitivity parameters" - ? "FT_MSHOWCRS() Increment internal cursor flag and display mouse cursor" - ? "FT_MVERSION() Get the mouse driver version" - ? "FT_MXLIMIT() Set vertical bounds of mouse using virtual screen coord." - ? "FT_MYLIMIT() Set horiz. bounds of mouse using virtual screen coordinates" - ? "FT_NUMLOCK() Return status of NumLock key" - ? "FT_PRTSCR() Enable or disable the Print Screen key" - ? "FT_PUTKEY() Stuff a keystroke into the keyboard buffer" - ? "FT_SCANCODE() Wait for keypress and return keyboard scan code" - ? "FT_SETKEYS() Get array of keys redirected via the SetKey() or SET KEY" - ? "FT_SETRATE() Set the keyboard delay and repeat rate on PC/AT & PS/2" - ? "FT_SHIFT() Determine status of shift key" - ? "FT_SINKEY() Replacement for INKEY() that tests for SET KEY procedures" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // MATH group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF MATH FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_GCD() Calculate greatest common divisor of two numbers" - ? "FT_NETPV() Calculate net present value" - ? "FT_RAND1() Generate a random number" - ? "FT_ROUND() Rounds a number to a specific place" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // MENU / PROMPTS group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF MENU / PROMPTS FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_ADDER() Pop up a simple calculator" - ? "FT_BLINK() Display a blinking message on the screen" - ? "FT_BRWSWHL() Browse an indexed database limited to a while condition" - ? "FT_CLRSEL() User Selectable Colour Routine" - ? "FT_DISPMSG() Display a message and optionally waits for a keypress" - ? "FT_FILL() Declare menu options for FT_MENU1()" - ? "FT_MENU1() Pulldown menu system" - ? "FT_MENU2() Vertical lightbar menu" - ? "FT_MENUTO() Execute light bar menu using prompts created with @...PROMPT" - ? "FT_PENDING() Display same-line pending messages after a wait." - ? "FT_PICKDAY() Picklist of days of week" - ? "FT_PROMPT() Define a menu item for use with FT_MenuTo()" - ? "FT_SLEEP Wait for a specified amount of time" - ? "FT_XBOX() Display a self-sizing message box and message" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_ADDER example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ADDER" - ? REPLICATE( "-", 78 ) - ? - nSickHrs := 0 - nPersHrs := 0 - nVacaHrs := 0 - GetList := {} - SET SCOREBOARD OFF - //_ftSetScrColor( STD_SCREEN, STD_VARIABLE) - //setcolor ('w+/b') - //CLS - - SET KEY K_ALT_A TO FT_Adder // Make 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 to Pop - Up the Adder.' - @ 24,20 SAY 'Press 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 . - READ - SET CURSOR OFF - IF LASTKEY() == K_ESC // - ABORT - CLEAR TYPEAHEAD - EXIT - ENDIF - ENDDO - SET CURSOR ON - SET KEY K_ALT_A // Reset - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // FT_BLINKW32 example - // - setcolor ('w+/b') - CLS - ? "TEST TO DEMONSTRATE EXAMPLES OF FT_BLINK AND FT_BLINKW32 / BLINKW32CANCEL" - ? REPLICATE( "-", 78 ) - ? - ? 'FT_BLINKW32( "[ Hit a key to continue ]", 24, 0, nwait )' - ? 'inkey(0)' - ? 'FT_BLINKW32CANCEL()' - ? - ? "Will produce a blink message as in each of this pages in OS where" - ? "normal hardware blink not operate." - ? "NOTE: this functions are an xHarbour expansion to Nanforum library." - ? - ? 'FT_BLINK( "[ Hit a key to continue ]", 24, 0 )' - ? 'inkey(0)' - ? - ? "Will produce a blink message as in each of this pages in OS where" - ? "normal hardware blink operate." - - FT_BLINK( "[ Hit a key to continue ]", 21, 0 ) - FT_BLINK( "[ Hit a key to continue ]", 22, 10 ) - FT_BLINK( "[ Hit a key to continue ]", 23, 20 ) - FT_BLINK( "[ Hit a key to continue ]", 24, 30 ) - inkey(0) - - // - // NETWARE group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF NETWARE FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_NWLSTAT() Return the current Novell NetWare logical station number" - ? "FT_NWSEMCLOSE() Close a NetWare semaphore" - ? "FT_NWSEMEX() Examine a NetWare semaphore's value and open count" - ? "FT_NWSEMLOCK() Perform a semaphore lock" - ? "FT_NWSEMOPEN() Open or create a NetWare semaphore" - ? "FT_NWSEMSIG() Signal a NetWare semaphore (increment)" - ? "FT_NWSEMUNLOCK() Unlock a semaphore locked by FT_NWSEMLOCK()" - ? "FT_NWSEMWAIT() Wait on a NetWare semaphore (decrement)" - ? "FT_NWUID() Return the current Novell NetWare User ID" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // STRING group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF STRING FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_AT2() Find position of the nth occurrence of a substring" - ? "FT_BITCLR() Clear (reset) selected bit in a byte" - ? "FT_BITSET() Set selected bit in a byte" - ? "FT_BYTEAND() Perform bit-wise AND on two ASCII characters (bytes)" - ? "FT_BYTENEG() Perform bit-wise negation on an ASCII character" - ? "FT_BYTENOT() Perform bit-wise NOT on an ASCII character (byte)" - ? "FT_BYTEOR() Perform bit-wise OR on two ASCII characters (bytes)" - ? "FT_BYTEXOR() Perform bit-wise XOR on two ASCII characters (bytes)" - ? "FT_FINDITH() Find the ith occurrence of a substring within a string" - ? "FT_ISBIT() Test the status of an individual bit" - ? "FT_ISBITON() Determine the state of individual bits in a number" - ? "FT_METAPH() Convert a character string to MetaPhone format" - ? "FT_NOOCCUR() Find the number of times one string occurs in another" - ? "FT_PCHR() Convert printer control codes" - ? "FT_PROPER() Convert a string to proper-name case" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // VIDEO group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF VIDEO FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_ADAPTER() Report the type of video adapter installed" - ? "FT_CLS() Clear screen" - ? "FT_GETMODE() Get the video mode" - ? "FT_GETVCUR() Return info about the cursor on a specified video page" - ? "FT_GETVPG() Get the currently selected video page" - ? "FT_POPVID() Restore previously saved video states." - ? "FT_PUSHVID() Save current video states on internal stack." - ? "FT_RESTATT() Restore the attribute bytes of a specified screen region." - ? "FT_REVATTR() Reverse colors of specified screen coordinates" - ? "FT_REVCHR() Reverse the color of a single character on the screen" - ? "FT_RGNSTACK() Push or pop a saved screen region on or off the stack" - ? "FT_RSTRGN() Restore region of the screen saved with FT_SAVRGN()" - ? "FT_SAVEATT() Save the attribute bytes of a specified screen region." - ? "FT_SAVRGN() Save a screen region for later display" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - - // - // VIDEO group of routines - // - setcolor ('w+/b') - CLS - ? "DEMO AND TEST OF VIDEO FUNCTIONS FROM LIBNF" - ? REPLICATE( "-", 78 ) - ? - ? "FT_SETATTR() Change color attributes of screen region" - ? "FT_SETMODE() Set the video mode" - ? "FT_SETVCUR() Set the cursor position on a specified video page" - ? "FT_SETVPG() Set the current video page" - ? "FT_SHADOW() Draw a non-destructive shadow on the screen" - ? "FT_VIDSTR() Display string on screen in specified attribute" - ? "FT_WRTCHR() Display character on screen" - - FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) - inkey(0) - -RETURN( NIL ) - -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 + STATIC nWait := 0.2 + +FUNCTION Main() + + LOCAL var0, nstart, nstop, nelapsed, nCtr + LOCAL aRet[ 8 ], i + LOCAL ar[ 3, 26 ], aBlocks[ 3 ], aHeadings[ 3 ], nElem := 1, bGetFunc, cRet + + nKey := 0 + + // + // Cover + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "Next screens will be a functions list contained in the library libnf," + ? "a port in xHarbour of the Nanforum Library for Clipper. The list is" + ? "organized as the original Norton Guide for the library. After the list" + ? "for each group of functions will be a demo of them." + ? + ? "A few new functions are added to the library libnf in order to expand" + ? "is power in this new xBase chapter. The demo of this function will be" + ? "in the group where they must included." + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + SET KEY K_F1 TO + + // + // Array group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF ARRAY FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_AADDITION() Add elements unique of source array to target array" + ? "FT_AAVG() Average numeric values in an array" + ? "FT_ADESSORT() Sort an array in descending order" + ? "FT_AEMAXLEN() Find longest element within an array" + ? "FT_AEMINLEN() Find shortest element within an array" + ? "FT_AMEDIAN() Find middle value in array, or average of two middle values" + ? "FT_ANOMATCHES() Find the number of array elements meeting a condition" + ? "FT_AREDIT() 2 dimensional array editing function using TBrowse" + ? "FT_ASUM() Sum the elements of an array" + ? "FT_RESTARR() Restore a Clipper array from a disc file" + ? "FT_SAVEARR() Save Clipper array to a disc file." + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_ADDITION example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AADDITION" + ? Replicate( "-", 78 ) + ? + 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 1000 + var0 := FT_AADDITION( aList1, aList2 ) + NEXT + nstop := Seconds() + nelapsed := nstop - nstart + ? "time for 1000 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 + "," ) } ) + ? + RELEASE aList, aList2 + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_AAVG example + // + aSubTotals := { 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2 } + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AAVG" + ? Replicate( "-", 78 ) + ? + ? "aSubTotals : " + AEval( aSubTotals, { |x| QQOut( Transform( x, "9.99" ) + "," ) } ) + ? + var0 := FT_AAVG( aSubTotals ) + ? PadR( "FT_AAVG( aSubTotals ) ->", 44 ) + Transform( var0, "9.99" ) + ? + var0 := FT_AAVG( aSubTotals, 2, 4 ) + ? PadR( "FT_AAVG( aSubTotals, 2, 4 ) ->", 44 ) + Transform( var0, "9.99" ) + ? + var0 := FT_AAVG( aSubTotals, 5 ) + ? PadR( "FT_AAVG( aSubTotals, 5 ) ->", 44 ) + Transform( var0, "9.99" ) + ? + var0 := FT_AAVG( aSubTotals, , 10 ) + ? PadR( "FT_AAVG( aSubTotals, , 10 ) ->", 44 ) + Transform( var0, "9.99" ) + ? + RELEASE aSubTotals + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_ADESSORT example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ADESSORT" + ? Replicate( "-", 78 ) + ? + ? "aNames : " + aNames := { "Mary", "Albert" , "John", "Frank", "Daniel", "Giuliano" } + AEval( aNames, { |x| QQOut( x + "," ) } ) + ? + aNames := { "Mary", "Albert" , "John", "Frank", "Daniel", "Giuliano" } + var0 := FT_ADESSORT( aNames ) + ? PadR( "FT_ADESSORT( aNames ) ->", 30 ) + AEval( var0, { |x| QQOut( x + "," ) } ) + ? + aNames := { "Mary", "Albert" , "John", "Frank", "Daniel", "Giuliano" } + var0 := FT_ADESSORT( aNames, 3 ) + ? PadR( "FT_ADESSORT( aNames, 3 ) ->", 30 ) + AEval( var0, { |x| QQOut( x + "," ) } ) + ? + aNames := { "Mary", "Albert" , "John", "Frank", "Daniel", "Giuliano" } + var0 := FT_ADESSORT( aNames, , 3 ) + ? PadR( "FT_ADESSORT( aNames, , 3 ) ->", 30 ) + AEval( var0, { |x| QQOut( x + "," ) } ) + ? + aNames := { "Mary", "Albert" , "John", "Frank", "Daniel", "Giuliano" } + var0 := FT_ADESSORT( aNames, 2, 5 ) + ? PadR( "FT_ADESSORT( aNames, 2, 5 ) ->", 30 ) + AEval( var0, { |x| QQOut( x + "," ) } ) + ? + RELEASE aNames + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_AEMAXLEN example + // + SetColor( "w+/b" ) + myarray1 := Directory() + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMAXLEN" + ? Replicate( "-", 78 ) + ? + ? "myarray1 := DIRECTORY()" + ? +// aEval( myarray1, {|v| qout( padr(v[1],12), v[2], v[3], v[4], v[5] ) } ) +// ? + 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 + ? + RELEASE myarray1 + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_AEMINLEN example + // + SetColor( "w+/b" ) + myarray1 := Directory() + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AEMINLEN" + ? Replicate( "-", 78 ) + ? + ? "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 + ? + RELEASE myarray1 + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_AEMEDIAN example + // + SetColor( "w+/b" ) + myarray0 := Directory() + myarray1 := {} + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AMEDIAN" + ? Replicate( "-", 78 ) + ? + ? "myarray0 := DIRECTORY()" + ? +// aEval( myarray0, {|v| qout( padr(v[1],12), v[2], v[3], v[4], v[5] ) } ) +// ? + 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 + ? + RELEASE myarray0, myarray1 + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_ANOMATCHES example + // + SetColor( "w+/b" ) + aNames := { "Mary", "Albert" , "John", "Frank", "Daniel", "Giuliano" } + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ANOMATCHES" + ? Replicate( "-", 78 ) + ? + ? "myarray0 := DIRECTORY()" + ? + ? "aNames : " + AEval( aNames, { |x| QQOut( x + "," ) } ) + ? + var0 := FT_ANOMATCHES( aNames, { |x| At( "a", x ) > 0 } ) + ? PadR( 'FT_ANOMATCHES( aNames, { |x| at( "a", x ) > 0 } ) ->', 60 ) + ?? var0 + ? + var0 := FT_ANOMATCHES( aNames, { |x| At( "an", x ) > 0 } ) + ? PadR( 'FT_ANOMATCHES( aNames, { |x| at( "an", x ) > 0 } ) ->', 60 ) + ?? var0 + ? + var0 := FT_ANOMATCHES( aNames, { |x| At( "an", x ) > 0 }, 1, 3 ) + ? PadR( 'FT_ANOMATCHES( aNames, { |x| at( "an", x ) > 0 }, 1, 3 ) ->', 60 ) + ?? var0 + ? + RELEASE aNames + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_AREDIT example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_AREDIT" + ? Replicate( "-", 78 ) + // set up 2 dimensional array ar[] + FOR i := 1 TO 26 + ar[1, i] := i // 1 -> 26 Numeric + ar[2, i] := Chr( i + 64 ) // "A" -> "Z" Character + ar[3, i] := Chr( 91 - i ) // "Z" -> "A" Character + NEXT i + // Set Up aHeadings[] 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 + @ 21, 4 SAY "Use Cursor Keys To Move Between Fields, = Delete Row, = Add Row" + @ 22, 7 SAY " = Quit Array Edit, or Edits Element" + SetColor( "N/W, W/N, , , W/N" ) + cRet := FT_ArEdit( 3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc ) + SetColor( "w+/b" ) + @ 24, 0 + @ 23, 0 + @ 22, 0 + @ 21, 0 + ? "Return Value :", cRet + ? "Lastkey() = ESC:", LastKey() == K_ESC + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_ASUM example + // + aSubTotals := { 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2 } + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ASUM" + ? Replicate( "-", 78 ) + ? + ? "aSubTotals : " + AEval( aSubTotals, { |x| QQOut( Transform( x, "999.99" ) + "," ) } ) + ? + var0 := FT_ASUM( aSubTotals ) + ? PadR( "FT_ASUM( aSubTotals ) ->", 44 ) + Transform( var0, "999.99" ) + ? + var0 := FT_ASUM( aSubTotals, 2, 4 ) + ? PadR( "FT_ASUM( aSubTotals, 2, 4 ) ->", 44 ) + Transform( var0, "999.99" ) + ? + var0 := FT_ASUM( aSubTotals, 5 ) + ? PadR( "FT_ASUM( aSubTotals, 5 ) ->", 44 ) + Transform( var0, "999.99" ) + ? + var0 := FT_ASUM( aSubTotals, , 10 ) + ? PadR( "FT_ASUM( aSubTotals, , 10 ) ->", 44 ) + Transform( var0, "999.99" ) + ? + RELEASE aSubTotals + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_RESTARR AND FT_SAVEARR example + // + aArray := { { "Invoice 1", SToD( "19910415" ), 1234.32, .T. }, ; + { "Invoice 2", Date(), 234.98, .F. }, ; + { "Invoice 3", Date() + 1, 0, .T. } } + nErrorCode := 0 + SetColor( "w+/b" ) + cls + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_RESTARR AND FT_SAVEARR" + ? Replicate( "-", 78 ) + ? + ? "Saving array ..." + ? + FT_SAVEARR( aArray, "invoice.dat", @nErrorCode ) + IF nErrorCode == 0 + DispArray( aArray ) + aSave := FT_RESTARR( "invoice.dat", @nErrorCode ) + IF nErrorCode == 0 + ? + ? "Restoring array from disk ..." + ? + DispArray( aSave ) + ELSE + ? "Error restoring array" + ENDIF + ELSE + ? "Error writing array" + ENDIF + RELEASE aArray, aSave, nErrorCode + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // Conversion group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF CONVERSION FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_BYT2BIT() Convert byte to string of 1's and 0's" + ? "FT_BYT2HEX() Convert byte to hexadecimal version of its binary value" + ? "FT_D2E() Convert decimal to scientific notation" + ? "FT_DEC2BIN() Convert decimal to binary" + ? "FT_E2D() Convert scientific notation string to a decimal" + ? "FT_ESCCODE() Convert Lotus style escape codes" + ? "FT_HEX2DEC() Convert a hex number to decimal" + ? "FT_INVCLR() Get the inverse of a color" + ? "FT_NTOW() Translate numeric value to words" + ? "FT_SQZN() Compress a numeric value into a character string" + ? "FT_STOD() Convert a date string to a Clipper date data type" + ? "FT_UNSQZN() Uncompress a numeric compressed by FT_SQZN()" + ? "FT_XTOY() Convert from any data type to any other data type" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_BYT2BIT() example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_BYT2BIT()" + ? Replicate( "-", 78 ) + ? + var0 := FT_BYT2BIT( "a" ) + ? PadR( "FT_BYT2BIT( 'a' ) ->", 44 ) + var0 + ? + var0 := FT_BYT2BIT( 'm' ) + ? PadR( "FT_BYT2BIT( 'm' ) ->", 44 ) + var0 + ? + var0 := FT_BYT2BIT( 'A' ) + ? PadR( "FT_BYT2BIT( 'A' ) ->", 44 ) + var0 + ? + var0 := FT_BYT2BIT( 'C' ) + ? PadR( "FT_BYT2BIT( 'C' ) ->", 44 ) + var0 + ? + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_BYT2HEX() example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_BYT2HEX()" + ? Replicate( "-", 78 ) + ? + var0 := FT_BYT2HEX( 'a' ) + ? PadR( "FT_BYT2HEX( 'a' ) ->", 44 ) + var0 + ? + var0 := FT_BYT2HEX( 'm' ) + ? PadR( "FT_BYT2HEX( 'm' ) ->", 44 ) + var0 + ? + var0 := FT_BYT2HEX( 'A' ) + ? PadR( "FT_BYT2HEX( 'A' ) ->", 44 ) + var0 + ? + var0 := FT_BYT2HEX( 'C' ) + ? PadR( "FT_BYT2HEX( 'C' ) ->", 44 ) + var0 + ? + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_D2E() example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_D2E()" + ? Replicate( "-", 78 ) + ? + var0 := FT_D2E( 12.345, 2 ) + ? PadR( "FT_D2E( 12.345, 2 ) ->", 44 ) + var0 + ? + var0 := FT_D2E( - 12.345, 3 ) + ? PadR( "FT_D2E( -12.345, 3 ) ->", 44 ) + var0 + ? + var0 := FT_D2E( 0.00000543, 2 ) + ? PadR( "FT_D2E( 0.00000543, 2 ) ->", 44 ) + var0 + ? + var0 := FT_D2E( 1010000000, 5 ) + ? PadR( "FT_D2E( 1010000000, 5 ) ->", 44 ) + var0 + ? + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_DEC2BIN() example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_DEC2BIN()" + ? Replicate( "-", 78 ) + ? + var0 := FT_DEC2BIN( 255 ) + ? PadR( "FT_DEC2BIN(255) ->", 44 ) + var0 + ? + var0 := FT_DEC2BIN( 105 ) + ? PadR( "FT_DEC2BIN(105) ->", 44 ) + var0 + ? + var0 := FT_DEC2BIN( 1 ) + ? PadR( "FT_DEC2BIN(1) ->", 44 ) + var0 + ? + var0 := FT_DEC2BIN( 15 ) + ? PadR( "FT_DEC2BIN(15) ->", 44 ) + var0 + ? + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_E2D() example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_E2D()" + ? Replicate( "-", 78 ) + ? + var0 := FT_E2D( "1.23E1" ) + ? PadR( "FT_E2D( '1.23E1' ) ->", 34 ) + Transform( var0, "9999999999.999999" ) + ? + var0 := FT_E2D( "-1.235E1" ) + ? PadR( "FT_E2D( '-1.235E1' ) ->", 34 ) + Transform( var0, "9999999999.999999" ) + ? + var0 := FT_E2D( "5.43E-6" ) + ? PadR( "FT_E2D( '5.43E-6' ) ->", 34 ) + Transform( var0, "9999999999.99999999" ) + ? + var0 := FT_E2D( "1.101E6" ) + ? PadR( "FT_E2D( '1.101E6' ) ->", 34 ) + Transform( var0, "9999999999.999999" ) + ? + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_STOD() example + // + SetColor( "w+/b" ) + SET CENTURY ON + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_STOD()" + ? Replicate( "-", 78 ) + ? + var0 := FT_STOD( "19901127" ) + ? PadR( "FT_STOD( '19901127' ) ->", 44 ) + Transform( var0, '@d' ) + ? + var0 := FT_STOD( '20060117' ) + ? PadR( "FT_STOD( '20060117' ) ->", 44 ) + Transform( var0, '@d' ) + ? + var0 := FT_STOD( '20060406' ) + ? PadR( "FT_STOD( '20060406' ) ->", 44 ) + Transform( var0, '@d' ) + ? + var0 := FT_STOD( '20041231' ) + ? PadR( "FT_STOD( '20041231' ) ->", 44 ) + Transform( var0, '@d' ) + ? + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // DOS / BIOS group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF DOS/BIOS FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_CHDIR() Change the current directory" + ? "FT_DEFAULT() Retrieve and optionally change the current default drive" + ? "FT_DOSVER Return the current DOS major and minor version as a string" + ? "FT_DSKFREE() Return the amount of available disk space" + ? "FT_DSKSIZE() Return the maximum capacity of a fixed disk" + ? "FT_IAMIDLE() Inform the operating system that the application is idle." + ? "FT_INP() Retrieve a byte from a specified I/O port" + ? "FT_INT86() Execute a software interrupt" + ? "FT_ISPRINT() Check printer status" + ? "FT_ISSHARE() Determine if DOS Share is installed" + ? "FT_MKDIR() Create a subdirectory" + ? "FT_OUTP() Write a byte to a specified I/O port" + ? "FT_PEEK() Retrieve a byte from a specified memory location." + ? "FT_POKE() Write a byte to a specified memory location" + ? "FT_REBOOT() Force a warm or cold boot" + ? "FT_RMDIR() Delete a subdirectory" + ? "FT_SETDATE() Set the DOS system date" + ? "FT_SETTIME() Set the DOS system time" + ? "FT_SYSMEM() Determine the amount of conventional memory installed" + ? "FT_TEMPFIL() Create a file with a unique name" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // DATE / TIME group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF DATE / TIME FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_ACCTADJ() Adjust beginning or ending fiscal pd. dates to acctg. dates" + ? "FT_ACCTMONTH() Return accounting month data" + ? "FT_ACCTQTR() Return accounting quarter data" + ? "FT_ACCTWEEK() Return accounting week data" + ? "FT_ACCTYEAR() Return accounting year data" + ? "FT_ADDWKDY() Return true number of days to add given number of workdays" + ? "FT_CALENDAR() Display date/time calendar, find a date, return calendar data." + ? "FT_CIV2MIL() Convert usual civilian format time to military time." + ? "FT_DATECNFG() Set beginning of year/week for FT_ date functions" + ? "FT_DAYOFYR() Return calendar, fiscal or accounting day data" + ? "FT_DAYTOBOW() Calculate no. of days between date and beginning of week" + ? "FT_DOY() Find number of day within year" + ? "FT_EASTER() Return the date of Easter" + ? "FT_ELAPMIN() Return difference, in minutes, between two mil format times." + ? "FT_ELAPSED() Return elapsed time between two days and/or times" + ? "FT_ELTIME() Compute difference between times in hours, minutes, seconds." + ? "FT_FDAY() Return first day of the month" + ? "FT_LDAY() Return last day of the month" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // DATE / TIME group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF DATE / TIME FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_MADD() Add or subtract months to/from a date" + ? "FT_MIL2CIV() Convert time in military format to civilian format." + ? "FT_MIL2MIN() Convert time in military format to number of minute of day." + ? "FT_MIN2DHM() Convert numeric minutes to days, hours and minutes." + ? "FT_MIN2MIL() Convert minute of day to military format time." + ? "FT_MONTH() Return Calendar or Fiscal Month Data" + ? "FT_QTR() Return Calendar or Fiscal Quarter Data." + ? "FT_SYS2MIL() Convert system time to military time format." + ? "FT_WEEK() Return calendar or fiscal week data" + ? "FT_WORKDAYS() Return number of work days between two dates" + ? "FT_WOY() Find number of week within year" + ? "FT_YEAR() Return calendar or fiscal year data" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_CALENDAR example + // + SetColor( "w+/b" ) + cls + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_CALENDAR" + ? Replicate( "-", 78 ) + ? + KEYBOARD Chr ( 28 ) + aRet := ft_calendar ( 10, 40, 'w+/rb', .T. , .T. ) //display calendar, return all. + cls + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_CALENDAR" + ? Replicate( "-", 78 ) + ? + @ 9, 10 SAY 'FT_CALENDAR return values' + @ 11, 10 SAY 'Date :' + DToC( aRet[1] ) + @ 12, 10 SAY 'Month Number:' + Str( aRet[2], 2, 0 ) + @ 13, 10 SAY 'Day Number :' + Str( aRet[3], 2, 0 ) + @ 14, 10 SAY 'Year Number :' + Str( aRet[4], 4, 0 ) + @ 15, 10 SAY 'Month :' + aRet[5] + @ 16, 10 SAY 'Day :' + aRet[6] + @ 17, 10 SAY 'Julian Day :' + Str( aRet[7], 3, 0 ) + @ 18, 10 SAY 'Current Time:' + aRet[8] + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // ENVIRONMENT group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF ENVIRONMENT FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_GETE() Return the entire current environment" + ? "FT_LINKED() Determine if a function was linked in" + ? "FT_ORIGIN() Report the drive, path and filename of the current program" + ? "FT_RESTSETS() Restore status of all SET command settings" + ? "FT_SAVESETS() Save the status of all the SET command settings" + ? "FT_SETCENTURY() Check/Set the CENTURY Setting" + ? "FT_TREE() Locate all directories and subdirectories on a drive" + ? "FT_WHEREIS() Locate all occurrences of a filespec on a drive" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // EVENT group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF EVENT FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_IDLE() Generate an idle event to allow incremental garbage collection." + ? "FT_ONIDLE() Evaluate a designated code block during idle states." + ? "FT_ONTICK() Evaluate a designated code block at a designated interval." + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FILE I/O group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF FILE I/O FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_DFCLOSE() Close file displayed by FT_DISPFILE()" + ? "FT_DFSETUP() Set up parameters for FT_DISPFILE()" + ? "FT_DISPFILE() Browse a text file" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_DISPFILE example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_DISPFILE" + ? Replicate( "-", 78 ) + ? "Press aAbB to terminate." + @ 4, 9 TO 21, 71 + FT_DFSETUP( "libnf.prg", 5, 10, 20, 70, 1, 48, 124, "AaBb" , .F. , 5, 132, 4096 ) + cKey := FT_DISPFILE() + FT_DFCLOSE() + @ 23, 10 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']' + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // GAME group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF GAME FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? " FT_PEGS() FT_PEGS GAME (all work and no play...)" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // KEYBOARD / MOUSE group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF KEYBOARD / MOUSE FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_ALT() Determine status of the Alt key" + ? "FT_CAPLOCK() Determine and optionally change the status of CapLock key" + ? "FT_CTRL() Determine status of the Ctrl key" + ? "FT_LASTKEY() Force LastKey() to return a programmer-defined value." + ? "FT_MBUTPRS() Retrieve button press status" + ? "FT_MBUTREL() Get mouse button release information" + ? "FT_MCONOFF() Turn mouse cursur off if in specified region" + ? "FT_MCURSOR() Set the mouse cursor" + ? "FT_MDBLCLK() Return true if a double click was detected" + ? "FT_MDEFCRS() Define the mouse cursor" + ? "FT_MGETCOORD() Get mouse cursor position (text coord.) and button status" + ? "FT_MGETPAGE() Get the display page for the mouse pointer" + ? "FT_MGETPOS() Get mouse cursor position and button status" + ? "FT_MGETSENS() Get the mouse sensitivity parameters" + ? "FT_MGETX() Get mouse cursor row position" + ? "FT_MGETY() Get mouse cursor column position" + ? "FT_MHIDECRS() Decrement internal mouse cursor flag and hide mouse cursor" + ? "FT_MINIT() Initialize the mouse driver, vars and return status of mouse" + ? "FT_MINREGION() Test if the mouse cursor is in the passed region" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // KEYBOARD / MOUSE group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF KEYBOARD / MOUSE FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_MMICKEYS() Get mickeys" + ? "FT_MRESET() Reset mouse driver and return status of mouse" + ? "FT_MSETCOORD() Position the mouse cursor using text screen coordinates" + ? "FT_MSETPAGE() Set the display page for the mouse pointer" + ? "FT_MSETPOS() Position the mouse cursor using virtual screen coordinates" + ? "FT_MSETSENS() Set the mouse sensitivity parameters" + ? "FT_MSHOWCRS() Increment internal cursor flag and display mouse cursor" + ? "FT_MVERSION() Get the mouse driver version" + ? "FT_MXLIMIT() Set vertical bounds of mouse using virtual screen coord." + ? "FT_MYLIMIT() Set horiz. bounds of mouse using virtual screen coordinates" + ? "FT_NUMLOCK() Return status of NumLock key" + ? "FT_PRTSCR() Enable or disable the Print Screen key" + ? "FT_PUTKEY() Stuff a keystroke into the keyboard buffer" + ? "FT_SCANCODE() Wait for keypress and return keyboard scan code" + ? "FT_SETKEYS() Get array of keys redirected via the SetKey() or SET KEY" + ? "FT_SETRATE() Set the keyboard delay and repeat rate on PC/AT & PS/2" + ? "FT_SHIFT() Determine status of shift key" + ? "FT_SINKEY() Replacement for INKEY() that tests for SET KEY procedures" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // MATH group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF MATH FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_GCD() Calculate greatest common divisor of two numbers" + ? "FT_NETPV() Calculate net present value" + ? "FT_RAND1() Generate a random number" + ? "FT_ROUND() Rounds a number to a specific place" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // MENU / PROMPTS group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF MENU / PROMPTS FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_ADDER() Pop up a simple calculator" + ? "FT_BLINK() Display a blinking message on the screen" + ? "FT_BRWSWHL() Browse an indexed database limited to a while condition" + ? "FT_CLRSEL() User Selectable Colour Routine" + ? "FT_DISPMSG() Display a message and optionally waits for a keypress" + ? "FT_FILL() Declare menu options for FT_MENU1()" + ? "FT_MENU1() Pulldown menu system" + ? "FT_MENU2() Vertical lightbar menu" + ? "FT_MENUTO() Execute light bar menu using prompts created with @...PROMPT" + ? "FT_PENDING() Display same-line pending messages after a wait." + ? "FT_PICKDAY() Picklist of days of week" + ? "FT_PROMPT() Define a menu item for use with FT_MenuTo()" + ? "FT_SLEEP Wait for a specified amount of time" + ? "FT_XBOX() Display a self-sizing message box and message" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_ADDER example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_ADDER" + ? Replicate( "-", 78 ) + ? + nSickHrs := 0 + nPersHrs := 0 + nVacaHrs := 0 + GetList := {} + SET SCOREBOARD OFF +// _ftSetScrColor( STD_SCREEN, STD_VARIABLE) +// SetColor( "w+/b" ) +// CLS + + SET KEY K_ALT_A TO FT_Adder // Make 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 to Pop - Up the Adder.' + @ 24, 20 SAY 'Press 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 . + READ + SET CURSOR OFF + IF LastKey() == K_ESC // - ABORT + CLEAR TYPEAHEAD + EXIT + ENDIF + ENDDO + SET CURSOR ON + SET KEY K_ALT_A // Reset + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // FT_BLINKW32 example + // + SetColor( "w+/b" ) + CLS + ? "TEST TO DEMONSTRATE EXAMPLES OF FT_BLINK AND FT_BLINKW32 / BLINKW32CANCEL" + ? Replicate( "-", 78 ) + ? + ? 'FT_BLINKW32( "[ Hit a key to continue ]", 24, 0, nwait )' + ? 'inkey(0)' + ? 'FT_BLINKW32CANCEL()' + ? + ? "Will produce a blink message as in each of this pages in OS where" + ? "normal hardware blink not operate." + ? "NOTE: this functions are an xHarbour expansion to Nanforum library." + ? + ? 'FT_BLINK( "[ Hit a key to continue ]", 24, 0 )' + ? 'inkey(0)' + ? + ? "Will produce a blink message as in each of this pages in OS where" + ? "normal hardware blink operate." + + FT_BLINK( "[ Hit a key to continue ]", 21, 0 ) + FT_BLINK( "[ Hit a key to continue ]", 22, 10 ) + FT_BLINK( "[ Hit a key to continue ]", 23, 20 ) + FT_BLINK( "[ Hit a key to continue ]", 24, 30 ) + Inkey( 0 ) + + // + // NETWARE group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF NETWARE FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_NWLSTAT() Return the current Novell NetWare logical station number" + ? "FT_NWSEMCLOSE() Close a NetWare semaphore" + ? "FT_NWSEMEX() Examine a NetWare semaphore's value and open count" + ? "FT_NWSEMLOCK() Perform a semaphore lock" + ? "FT_NWSEMOPEN() Open or create a NetWare semaphore" + ? "FT_NWSEMSIG() Signal a NetWare semaphore (increment)" + ? "FT_NWSEMUNLOCK() Unlock a semaphore locked by FT_NWSEMLOCK()" + ? "FT_NWSEMWAIT() Wait on a NetWare semaphore (decrement)" + ? "FT_NWUID() Return the current Novell NetWare User ID" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // STRING group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF STRING FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_AT2() Find position of the nth occurrence of a substring" + ? "FT_BITCLR() Clear (reset) selected bit in a byte" + ? "FT_BITSET() Set selected bit in a byte" + ? "FT_BYTEAND() Perform bit-wise AND on two ASCII characters (bytes)" + ? "FT_BYTENEG() Perform bit-wise negation on an ASCII character" + ? "FT_BYTENOT() Perform bit-wise NOT on an ASCII character (byte)" + ? "FT_BYTEOR() Perform bit-wise OR on two ASCII characters (bytes)" + ? "FT_BYTEXOR() Perform bit-wise XOR on two ASCII characters (bytes)" + ? "FT_FINDITH() Find the ith occurrence of a substring within a string" + ? "FT_ISBIT() Test the status of an individual bit" + ? "FT_ISBITON() Determine the state of individual bits in a number" + ? "FT_METAPH() Convert a character string to MetaPhone format" + ? "FT_NOOCCUR() Find the number of times one string occurs in another" + ? "FT_PCHR() Convert printer control codes" + ? "FT_PROPER() Convert a string to proper-name case" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // VIDEO group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF VIDEO FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_ADAPTER() Report the type of video adapter installed" + ? "FT_CLS() Clear screen" + ? "FT_GETMODE() Get the video mode" + ? "FT_GETVCUR() Return info about the cursor on a specified video page" + ? "FT_GETVPG() Get the currently selected video page" + ? "FT_POPVID() Restore previously saved video states." + ? "FT_PUSHVID() Save current video states on internal stack." + ? "FT_RESTATT() Restore the attribute bytes of a specified screen region." + ? "FT_REVATTR() Reverse colors of specified screen coordinates" + ? "FT_REVCHR() Reverse the color of a single character on the screen" + ? "FT_RGNSTACK() Push or pop a saved screen region on or off the stack" + ? "FT_RSTRGN() Restore region of the screen saved with FT_SAVRGN()" + ? "FT_SAVEATT() Save the attribute bytes of a specified screen region." + ? "FT_SAVRGN() Save a screen region for later display" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + // + // VIDEO group of routines + // + SetColor( "w+/b" ) + CLS + ? "DEMO AND TEST OF VIDEO FUNCTIONS FROM LIBNF" + ? Replicate( "-", 78 ) + ? + ? "FT_SETATTR() Change color attributes of screen region" + ? "FT_SETMODE() Set the video mode" + ? "FT_SETVCUR() Set the cursor position on a specified video page" + ? "FT_SETVPG() Set the current video page" + ? "FT_SHADOW() Draw a non-destructive shadow on the screen" + ? "FT_VIDSTR() Display string on screen in specified attribute" + ? "FT_WRTCHR() Display character on screen" + + FT_BLINK( "[ Hit a key to continue ]", 24, 0 ) + Inkey( 0 ) + + RETURN( NIL ) + +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 + CASE nDim == 2 @ nRow, nCol GET ar[2, nElem] PICTURE "!" READ b:refreshAll() - CASE nDim == 3 + 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.) + ENDCASE + RestScreen( 21, 0, 22, MaxCol(), cSaveScrn ) + @ nRow, nCol SAY "" + + RETURN( .T. ) + +FUNCTION DispArray( aTest ) - 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') + + 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 + + RETURN Nil diff --git a/harbour/contrib/hbnf/tests/test.prg b/harbour/contrib/hbnf/tests/test.prg index 8136e33787..693a35c96d 100644 --- a/harbour/contrib/hbnf/tests/test.prg +++ b/harbour/contrib/hbnf/tests/test.prg @@ -2,30 +2,31 @@ * $Id$ */ -function main() -local nver,nmar,ntype,nir,ppp +PROCEDURE Main() -nmar:=FT_MVERSION(@nver,@ntype,@nir) -ppp:=nmar+nver -? str(nmar,2,0),'.',str(nver,2,0) -? ppp/100 -inkey(0) -? 'is mouse on', ft_mreset() -inkey(0) -? FT_MSHOWCRS() -inkey(0) -? ft_mxlimit(0,8*maxcol()) -inkey(0) -? ft_mylimit(0,8*maxrow()) -inkey(0) + LOCAL nver, nmar, ntype, nir, ppp -do while lastkey()!=27 -? 'mouse row is',ft_mgetx() -? 'mouse col is',ft_mgety() -if lastkey()==27 - exit -endif -enddo -FT_MHIDECRS() -return nil + nmar := FT_MVERSION( @nver, @ntype, @nir ) + ppp := nmar + nver + ? Str( nmar, 2, 0 ), '.', Str( nver, 2, 0 ) + ? ppp/100 + Inkey( 0 ) + ? 'is mouse on', ft_mreset() + Inkey( 0 ) + ? FT_MSHOWCRS() + Inkey( 0 ) + ? ft_mxlimit( 0, 8 * MaxCol() ) + Inkey( 0 ) + ? ft_mylimit( 0, 8 * MaxRow() ) + Inkey( 0 ) + DO WHILE LastKey() != 27 + ? 'mouse row is', ft_mgetx() + ? 'mouse col is', ft_mgety() + IF LastKey() == 27 + EXIT + ENDIF + ENDDO + FT_MHIDECRS() + + RETURN diff --git a/harbour/contrib/hbnf/week.prg b/harbour/contrib/hbnf/week.prg index 7705bd1474..12025b9785 100644 --- a/harbour/contrib/hbnf/week.prg +++ b/harbour/contrib/hbnf/week.prg @@ -30,7 +30,7 @@ FUNCTION FT_WEEK( dGivenDate, nWeekNum ) LOCAL lIsWeek, nTemp, aRetVal, dTemp - IF ! ( ValType( dGivenDate ) $ "ND" ) + IF !( ValType( dGivenDate ) $ "ND" ) dGivenDate := Date() ELSEIF HB_ISNUMERIC( dGivenDate ) nWeekNum := dGivenDate diff --git a/harbour/contrib/hbpre.hbm b/harbour/contrib/hbpre.hbm index bd62125f85..3965cfbf2c 100644 --- a/harbour/contrib/hbpre.hbm +++ b/harbour/contrib/hbpre.hbm @@ -5,7 +5,6 @@ # These may be overridden by local project options. -q0 --autohbm- {HB_BUILD_VERBOSE}-quiet- {HB_BUILD_VERBOSE}-info diff --git a/harbour/contrib/make.hb b/harbour/contrib/make.hb index 0f6ec3ad8c..a2cc401f44 100755 --- a/harbour/contrib/make.hb +++ b/harbour/contrib/make.hb @@ -493,7 +493,7 @@ STATIC FUNCTION call_hbmk2_hbinfo( cProjectPath, hProject ) hProject[ "aDept" ] := {} hProject[ "lChecked" ] := NIL - IF ( nErrorLevel := call_hbmk2( cProjectPath, " --hbinfo -autohbm-", NIL,, @cStdOut ) ) == 0 + IF ( nErrorLevel := call_hbmk2( cProjectPath, " --hbinfo", NIL,, @cStdOut ) ) == 0 hb_jsonDecode( cStdOut, @hInfo ) @@ -549,7 +549,7 @@ STATIC FUNCTION call_hbmk2( cProjectPath, cOptionsPre, cDynSuffix, cStdErr, cStd hb_setenv( "_HB_CONTRIB_SUBDIR", hb_FNameDir( PathSepToSelf( cProjectPath ) ) ) cCommand := s_cBinDir + "hbmk2" +; - " -quiet -width=0" +; + " -quiet -width=0 -autohbm-" +; " @" + StrTran( s_cHome + "hbpre", "\", "/" ) +; cOptionsPre +; " " + StrTran( cProjectPath, "\", "/" ) +;