2012-09-26 11:35 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbnf/clrsel.prg
  * contrib/hbnf/datecnfg.prg
  * contrib/hbnf/dayofyr.prg
  * contrib/hbnf/dfile.prg
  * contrib/hbnf/easter.prg
  * contrib/hbnf/elapsed.prg
  * contrib/hbnf/floptst.prg
  * contrib/hbnf/isbit.prg
  * contrib/hbnf/month.prg
  * contrib/hbnf/mouse1.prg
  * contrib/hbnf/mouse2.prg
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/qtr.prg
  * contrib/hbnf/savearr.prg
  * contrib/hbnf/setdate.prg
  * contrib/hbnf/settime.prg
  * contrib/hbnf/sleep.prg
  * contrib/hbnf/tbwhile.prg
  * contrib/hbnf/tempfile.prg
  * contrib/hbnf/week.prg
  * contrib/hbnf/woy.prg
    % using HB_IS*() functions
    % minor cleanups/optimizations
This commit is contained in:
Viktor Szakats
2012-09-26 09:38:25 +00:00
parent 775abee177
commit 714108442f
22 changed files with 110 additions and 86 deletions

View File

@@ -16,6 +16,31 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-09-26 11:35 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/clrsel.prg
* contrib/hbnf/datecnfg.prg
* contrib/hbnf/dayofyr.prg
* contrib/hbnf/dfile.prg
* contrib/hbnf/easter.prg
* contrib/hbnf/elapsed.prg
* contrib/hbnf/floptst.prg
* contrib/hbnf/isbit.prg
* contrib/hbnf/month.prg
* contrib/hbnf/mouse1.prg
* contrib/hbnf/mouse2.prg
* contrib/hbnf/popadder.prg
* contrib/hbnf/qtr.prg
* contrib/hbnf/savearr.prg
* contrib/hbnf/setdate.prg
* contrib/hbnf/settime.prg
* contrib/hbnf/sleep.prg
* contrib/hbnf/tbwhile.prg
* contrib/hbnf/tempfile.prg
* contrib/hbnf/week.prg
* contrib/hbnf/woy.prg
% using HB_IS*() functions
% minor cleanups/optimizations
2012-09-26 10:57 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/acctadj.prg
* contrib/hbnf/acctmnth.prg

View File

@@ -696,10 +696,10 @@ STATIC FUNCTION _ftIdentArr( aArr1, aArr2 )
LOCAL n := 1
DO WHILE lIdentical .AND. n <= Len( aArr1 )
IF ValType( aArr1[n] ) == ValType( aArr2[n] )
lIdentical := iif( ValType( aArr1[n] ) == "A", ;
_ftIdentArr( aArr1[n], aArr2[n] ), ;
aArr1[n] == aArr2[n] )
IF ValType( aArr1[ n ] ) == ValType( aArr2[ n ] )
lIdentical := iif( HB_ISARRAY( aArr1[ n ] ), ;
_ftIdentArr( aArr1[ n ], aArr2[ n ] ), ;
aArr1[ n ] == aArr2[ n ] )
ELSE
lIdentical := .F.
ENDIF

View File

@@ -79,15 +79,15 @@ FUNCTION DEMO()
LOCAL nNum, dDate, aTestData := {}, aTemp, cFY_Start, nDOW_Start
// SET DATE ANSI // User's normal date format
aTemp := FT_DATECNFG() // Get/Set cFY_Start & nDOW_Start.
// aTemp := FT_DATECNFG("1980.01.03", 1) // Date string in user's format.
// SET DATE ANSI // User's normal date format
aTemp := FT_DATECNFG() // Get/Set cFY_Start & nDOW_Start.
// aTemp := FT_DATECNFG("1980.01.03", 1) // Date string in user's format.
cFY_Start := aTemp[ 1 ] // See FT_DATECNFG() in ft_date0.prg
NDOW_START := ATEMP[ 2 ] // FOR PARAMETERS.
DDATE := Date()
// dDate := STOD("19880229") // Test date, in user's normal date format
nDOW_Start := ATEMP[ 2 ] // FOR PARAMETERS.
dDate := Date()
// dDate := SToD( "19880229" ) // Test date, in user's normal date format
cls
CLS
? "Given Date: "
?? dDate
?? " cFY_Start: " + cFY_Start
@@ -100,28 +100,28 @@ FUNCTION DEMO()
aTestData := FT_QTR( dDate )
? "FYQtr ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
nNum := Val( SubStr( aTestData[ 1 ],5,2 ) )
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
aTestData := FT_QTR( dDate, nNum )
? "FYQtr " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
aTestData := FT_MONTH( dDate )
? "FYMonth ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
nNum := Val( SubStr( aTestData[ 1 ],5,2 ) )
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
aTestData := FT_MONTH( dDate, nNum )
? "FYMonth " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
aTestData := FT_WEEK( dDate )
? "FYWeek ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
nNum := Val( SubStr( aTestData[ 1 ],5,2 ) )
nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) )
aTestData := FT_WEEK( dDate, nNum )
? "FYWeek " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
aTestData := FT_DAYOFYR( dDate )
? "FYDay ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
nNum := Val( SubStr( aTestData[ 1 ],5,3 ) )
nNum := Val( SubStr( aTestData[ 1 ], 5, 3 ) )
aTestData := FT_DAYOFYR( dDate, nNum )
? "FYDAY " + Str( nNum, 3 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ]
@@ -130,7 +130,7 @@ FUNCTION DEMO()
aTestData := FT_ACCTYEAR( dDate )
? "ACCTYear ", aTestData[ 1 ] + " ", aTestData[ 2 ], aTestData[ 3 ], ;
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) /7, 3 ) + " Weeks"
Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks"
aTestData := FT_ACCTQTR( dDate )
? "ACCTQtr ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ], ;
@@ -182,7 +182,7 @@ FUNCTION FT_CAL( dGivenDate, nType )
IF dGivenDate == NIL .OR. !( ValType( dGivenDate ) $ 'ND' )
dGivenDate := Date()
ELSEIF ValType( dGivenDate ) == 'N'
ELSEIF HB_ISNUMERIC( dGivenDate )
nType := dGivenDate
dGivenDate := Date()
ENDIF
@@ -234,11 +234,11 @@ FUNCTION FT_CAL( dGivenDate, nType )
FUNCTION FT_DATECNFG( cFYStart , nDow )
THREAD STATIC aDatePar := { "1980.01.01", 1 }
THREAD STATIC t_aDatePar := { "1980.01.01", 1 }
LOCAL dCheck, cDateFormat := Set( _SET_DATEFORMAT )
IF ValType( cFYStart ) == 'C'
IF HB_ISSTRING( cFYStart )
dCheck := CToD( cFYStart )
IF DToC( dCheck ) != " " // TOFIX
@@ -248,13 +248,13 @@ FUNCTION FT_DATECNFG( cFYStart , nDow )
ENDIF
SET( _SET_DATEFORMAT, "yyyy.mm.dd" )
aDatePar[ 1 ] := DToC( dCheck )
t_aDatePar[ 1 ] := DToC( dCheck )
SET( _SET_DATEFORMAT, cDateFormat )
ENDIF
ENDIF
IF ValType( nDow ) == 'N' .AND. nDow > 0 .AND. nDow < 8
aDatePar[ 2 ] := nDow
IF HB_ISNUMERIC( nDow ) .AND. nDow > 0 .AND. nDow < 8
t_aDatePar[ 2 ] := nDow
ENDIF
RETURN AClone( aDatePar )
RETURN AClone( t_aDatePar )

View File

@@ -33,16 +33,16 @@ FUNCTION FT_DAYOFYR( dGivenDate, nDayNum, lIsAcct )
IF !( ValType( dGivenDate ) $ 'NDL' )
dGivenDate := Date()
ELSEIF ValType( dGivenDate ) == 'N'
ELSEIF HB_ISNUMERIC( dGivenDate )
nDayNum := dGivenDate
dGivenDate := Date()
ELSEIF ValType( dGivenDate ) == 'L'
ELSEIF HB_ISLOGICAL( dGivenDate )
lIsAcct := dGivenDate
dGivenDate := Date()
ENDIF
lIsDay := ValType( nDayNum ) == 'N'
lIsAcct := ValType( lIsAcct ) == 'L'
lIsDay := HB_ISNUMERIC( nDayNum )
lIsAcct := HB_ISLOGICAL( lIsAcct )
IF lIsAcct
aRetVal := FT_ACCTYEAR( dGivenDate )

View File

@@ -88,22 +88,22 @@ FUNCTION FT_DFSETUP( cInFile, nTop, nLeft, nBottom, nRight, ;
LOCAL rval
IF File( cInFile )
nTop := iif( ValType( nTop ) == "N", nTop, 0 )
nLeft := iif( ValType( nLeft ) == "N", nLeft, 0 )
nBottom := iif( ValType( nBottom ) == "N", nBottom, MaxRow() )
nRight := iif( ValType( nRight ) == "N", nRight, MaxCol() )
nTop := iif( HB_ISNUMERIC( nTop ) , nTop, 0 )
nLeft := iif( HB_ISNUMERIC( nLeft ) , nLeft, 0 )
nBottom := iif( HB_ISNUMERIC( nBottom ), nBottom, MaxRow() )
nRight := iif( HB_ISNUMERIC( nRight ) , nRight, MaxCol() )
nCNormal := iif( ValType( nCNormal ) == "N", nCNormal, 7 )
nCHighlight := iif( ValType( nCHighlight ) == "N", nCHighlight, 15 )
nCNormal := iif( HB_ISNUMERIC( nCNormal ) , nCNormal, 7 )
nCHighlight := iif( HB_ISNUMERIC( nCHighlight ), nCHighlight, 15 )
nStart := iif( ValType( nStart ) == "N", nStart, 1 )
nColSkip := iif( ValType( nColSkip ) == "N", nColSkip, 1 )
lBrowse := iif( ValType( lBrowse ) == "L", lBrowse, .F. )
nStart := iif( HB_ISNUMERIC( nStart ) , nStart, 1 )
nColSkip := iif( HB_ISNUMERIC( nColSkip ) , nColSkip, 1 )
lBrowse := iif( HB_ISLOGICAL( lBrowse ) , lBrowse, .F. )
nRMargin := iif( ValType( nRMargin ) == "N", nRMargin, 255 )
nBuffSize := iif( ValType( nBuffSize ) == "N", nBuffSize, 4096 )
nRMargin := iif( HB_ISNUMERIC( nRMargin ) , nRMargin, 255 )
nBuffSize := iif( HB_ISNUMERIC( nBuffSize ), nBuffSize, 4096 )
cExitKeys := iif( ValType( cExitKeys ) == "C", cExitKeys, "" )
cExitKeys := iif( HB_ISSTRING( cExitKeys ) , cExitKeys, "" )
cExitKeys := iif( Len( cExitKeys ) > 25, SubStr( cExitKeys, 1, 25 ), cExitKeys )

View File

@@ -31,15 +31,15 @@ FUNCTION FT_EASTER( nYear )
LOCAL nGold, nCent, nCorx, nCorz, nSunday, nEpact, nMoon
LOCAL nMonth := 0, nDay := 0
IF ValType( nYear ) == "C"
IF HB_ISSTRING( nYear )
nYear := Val( nYear )
ENDIF
IF ValType( nYear ) == "D"
IF HB_ISDATE( nYear )
nYear := Year( nYear )
ENDIF
IF ValType( nYear ) == "N"
IF HB_ISNUMERIC( nYear )
IF nYear > 1582
// <<nGold>> is Golden number of the year in the 19 year Metonic cycle

View File

@@ -55,20 +55,20 @@ FUNCTION FT_ELAPSED( dStart, dEnd, cTimeStart, cTimeEnd )
IF ! ( ValType( dStart ) $ 'DC' )
dStart := Date()
ELSEIF ValType( dStart ) == 'C'
ELSEIF HB_ISSTRING( dStart )
cTimeStart := dStart
dStart := Date()
ENDIF
IF ! ( ValType( dEnd ) $ 'DC' )
dEnd := Date()
ELSEIF ValType( dEnd ) == 'C'
ELSEIF HB_ISSTRING( dEnd )
cTimeEnd := dEnd
dEnd := Date()
ENDIF
IF ValType( cTimeStart ) != 'C' ; cTimeStart := '00:00:00' ; ENDIF
IF ValType( cTimeEnd ) != 'C' ; cTimeEnd := '00:00:00' ; ENDIF
IF ! HB_ISSTRING( cTimeStart ); cTimeStart := '00:00:00' ; ENDIF
IF ! HB_ISSTRING( cTimeEnd ) ; cTimeEnd := '00:00:00' ; ENDIF
nTotalSec := ( dEnd - dStart ) * 86400 + ;
Val( cTimeEnd ) * 3600 + ;

View File

@@ -54,7 +54,7 @@ PROCEDURE Main( cArg1 )
LOCAL nErrCode
IF ValType( cArg1 ) == "C"
IF HB_ISSTRING( cArg1 )
nErrCode := FT_FLOPTST( Asc( Upper( cArg1 ) ) - Asc( "A" ) )
OutStd( "Return Code is " + LTrim( Str( nErrCode ) ) + CR_LF )
ELSE
@@ -73,7 +73,7 @@ FUNCTION FT_FLOPTST( ; // error code defined by ERR_*
LOCAL nRetCode
nRetCode := ERR_WRONG_PARAMETERS
IF ValType( nDriveNum_i ) == "N"
IF HB_ISNUMERIC( nDriveNum_i )
IF _GetDisketteNum( nDriveNum_i )
_ResetDisketteSystem()

View File

@@ -28,14 +28,14 @@ FUNCTION FT_ISBIT( cInbyte, nBitPos )
LOCAL lBitStat
IF ValType( cInbyte ) != "C" .OR. ValType( nBitPos ) != "N" // parameter check
lBitStat := NIL
ELSE
IF HB_ISSTRING( cInbyte ) .AND. HB_ISNUMERIC( nBitPos )
IF nBitPos > 7 .OR. nBitPos < 0 .OR. nBitPos != Int( nBitPos )
lBitStat := NIL
ELSE
lBitStat := Int( ( ( Asc( cInByte ) * ( 2 ^ ( 7 - nBitPos ) ) ) % 256 ) / 128 ) == 1
ENDIF
ELSE
lBitStat := NIL
ENDIF
RETURN lBitStat

View File

@@ -33,14 +33,14 @@ FUNCTION FT_MONTH( dGivenDate, nMonthNum )
IF !( ValType( dGivenDate ) $ 'ND' )
dGivenDate := Date()
ELSEIF ValType( dGivenDate ) == 'N'
ELSEIF HB_ISNUMERIC( dGivenDate )
nMonthNum := dGivenDate
dGivenDate := Date()
ENDIF
aRetVal := FT_YEAR( dGivenDate )
lIsMonth := ( ValType( nMonthNum ) == 'N' )
lIsMonth := HB_ISNUMERIC( nMonthNum )
IF lISMonth
IF nMonthNum < 1 .OR. nMonthNum > 12
nMonthNum := 12

View File

@@ -328,15 +328,15 @@ FUNCTION FT_MSETSENS( nHoriz, nVert, nDouble )
// Set defaults if necessary
IF !( ValType( nHoriz ) == "N" )
IF ! HB_ISNUMERIC( nHoriz )
nHoriz := nCurHoriz
ENDIF
IF !( ValType( nVert ) == "N" )
IF ! HB_ISNUMERIC( nVert )
nVert := nCurVert
ENDIF
IF !( ValType( nDouble ) == "N" )
IF ! HB_ISNUMERIC( nDouble )
nDouble := nCurDouble
ENDIF
@@ -452,7 +452,7 @@ FUNCTION FT_MCURSOR( lState )
LOCAL lSavState := t_lCrsState
IF ValType( lState ) == "L"
IF HB_ISLOGICAL( lState )
IF ( t_lCrsState := lState )
FT_MSHOWCRS()
ELSE

View File

@@ -299,7 +299,7 @@ FUNCTION FT_MCURSOR( lState )
LOCAL lSavState := t_lCrsState
IF ValType( lState ) = "L"
IF HB_ISLOGICAL( lState )
IF ( t_lCrsState := lState )
FT_MSHOWCRS()
ELSE

View File

@@ -1208,8 +1208,8 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n
LOCAL nOldRow, nOldCol, cOldColor, nMessLen, nWide, nNumRows, nBottom, nLeft
LOCAL nRight, oNewGet, nNumMessRow, nLenLastRow, lGetOnNextLine, nOldCurs
LOCAL cVarType := ValType( xVarVal )
LOCAL nVarLen := iif( cVarType == "C", Len( xVarVal ), iif( cVarType == "D",8, ;
iif( cVarType == "L", 1, iif( cVarType == "N",iif(cPict == NIL,9, ;
LOCAL nVarLen := iif( cVarType == "C", Len( xVarVal ), iif( cVarType == "D", 8, ;
iif( cVarType == "L", 1, iif( cVarType == "N", iif(cPict == NIL, 9, ;
Len( cPict ) ), 0 ) ) ) )
LOCAL nOldLastKey := LastKey()
LOCAL cOldDevice := Set( _SET_DEVICE, "SCREEN" )
@@ -1235,7 +1235,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( ValType(xVarVal ) == "C" ;
_ftPushWin( nTop, nLeft, nBottom, nRight, "QUESTION ?", iif( HB_ISSTRING( xVarVal ) ;
.AND. nVarLen > nWide, Chr( 27 ) + " scroll " + Chr( 26 ), NIL ), nWinColor )
DISPMESSAGE cMessage, nTop + 1, nLeft + 2, nBottom - 1, nRight - 2
@@ -1245,18 +1245,18 @@ STATIC FUNCTION _ftQuest( cMessage, xVarVal, cPict, bValid, lNoESC, nWinColor, n
"xVarVal" )
// If the input line is character & wider than window SCROLL
IF lGetOnNextLine .AND. ValType( xVarVal ) == "C" .AND. nVarLen > nWide
IF lGetOnNextLine .AND. HB_ISSTRING( xVarVal ) .AND. nVarLen > nWide
oNewGet:Picture := "@S" + LTrim( Str( nWide,4,0 ) ) + iif( cPict == NIL, "", " " + cPict )
ENDIF
IF cPict != NIL // Use the picture they passed
oNewGet:Picture := cPict
ELSE // Else setup default pictures
IF ValType( xVarVal ) == "D"
IF HB_ISDATE( xVarVal )
oNewGet:Picture := "99/99/99"
ELSEIF ValType( xVarVal ) == "L"
ELSEIF HB_ISLOGICAL( xVarVal )
oNewGet:Picture := "Y"
ELSEIF ValType( xVarVal ) == "N"
ELSEIF HB_ISNUMERIC( xVarVal )
oNewGet:Picture := "999999.99" // Guess that they are inputting dollars
ENDIF
ENDIF

View File

@@ -33,14 +33,14 @@ FUNCTION FT_QTR( dGivenDate, nQtrNum )
IF !( ValType( dGivenDate ) $ 'ND' )
dGivenDate := Date()
ELSEIF ValType( dGivenDate ) == 'N'
ELSEIF HB_ISNUMERIC( dGivenDate )
nQtrNum := dGivenDate
dGivenDate := Date()
ENDIF
aRetval := FT_YEAR( dGivenDate )
lIsQtr := ( ValType( nQtrNum ) == 'N' )
lIsQtr := HB_ISNUMERIC( nQtrNum )
IF lIsQtr
IF nQtrNum < 1 .OR. nQtrNum > 4
nQtrNum := 4

View File

@@ -84,7 +84,7 @@ FUNCTION FT_SAVEARR( aArray, cFileName, nErrorCode )
IF nErrorCode == 0
lRet := _ftsavesub( aArray, nHandle, @nErrorCode )
FClose( nHandle )
IF ( lRet ) .AND. ( FError() != 0 )
IF lRet .AND. FError() != 0
nErrorCode := FError()
lRet := .F.
ENDIF

View File

@@ -37,7 +37,7 @@
PROCEDURE Main( cDate )
cDate := iif( cDate == nil, DToC( Date() ), cDate )
cDate := iif( cDate == NIL, DToC( Date() ), cDate )
QOut( "Setting date to: " + cDate + "... " )
FT_SETDATE( CToD( cDate ) )
QOut( "Today is now: " + DToC( Date() ) )
@@ -50,7 +50,7 @@ FUNCTION FT_SETDATE( dDate )
LOCAL aRegs[ INT86_MAX_REGS ]
dDate := iif( ValType( dDate ) != "D", Date(), dDate )
dDate := iif( HB_ISDATE( dDate ), dDate, Date() )
aRegs[ AX ] := SETDATE * ( 2 ^ 8 )
aregs[ CX ] := Year( dDate )

View File

@@ -41,7 +41,7 @@
PROCEDURE Main( cTime )
cTime := iif( cTime == nil, Time(), cTime )
cTime := iif( cTime == NIL, Time(), cTime )
QOut( "Setting time to: " + cTime + "... " )
FT_SETTIME( cTime )
QOut( "Time is now: " + Time() )
@@ -54,7 +54,7 @@ FUNCTION FT_SETTIME( cTime )
LOCAL aRegs[ INT86_MAX_REGS ]
cTime := iif( cTime == nil, Time(), cTime )
cTime := iif( cTime == NIL, Time(), cTime )
// -------- High Byte ------ ----- Low Byte -------

View File

@@ -39,7 +39,7 @@ PROCEDURE Main( nSleep )
FUNCTION FT_SLEEP( nSeconds, nInitial )
IF nInitial == NIL .OR. ValType( nInitial ) != "N"
IF ! HB_ISNUMERIC( nInitial )
nInitial := Seconds()
ENDIF

View File

@@ -28,7 +28,7 @@
* - Added refreshCurrent and another stabilize around line 349
* - TbSkipWhile was redone
* Note: Leo's line was changed to:
* ELSEIF ( n > 0 .AND. RECNO() != LASTREC() + 1)
* ELSEIF n > 0 .AND. RECNO() != LASTREC() + 1
*
* 3. Added DispBegin() and DispEnd() around both Stabilize sections
*
@@ -108,12 +108,12 @@ PROCEDURE TBWHILE()
// 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, ;
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}
// {|| TBNames->Last = cLast .AND. TBNames->First = cFirst }
// and setting cKey := cLast + cFirst
?

View File

@@ -62,12 +62,11 @@ FUNCTION FT_TEMPFIL( cPath, lHide, nHandle )
LOCAL cRet, aRegs[3]
cPath := iif( ValType( cPath ) != "C", ;
Replicate( Chr( 0 ), 13 ) , ;
cPath += Replicate( Chr( 0 ), 13 ) ;
)
cPath := iif( ! HB_ISSTRING( cPath ), ;
Replicate( Chr( 0 ), 13 ) , ;
cPath += Replicate( Chr( 0 ), 13 ) )
lHide := iif( ValType( lHide ) != "L", .F. , lHide )
lHide := iif( HB_ISLOGICAL( lHide ), lHide, .F. )
/*
aRegs[ AX ] := MAKEHI( TEMPNAME )
aRegs[ CX ] := iif( lHide, 2, 0 )

View File

@@ -33,7 +33,7 @@ FUNCTION FT_WEEK( dGivenDate, nWeekNum )
IF ! ( ValType( dGivenDate ) $ 'ND' )
dGivenDate := Date()
ELSEIF ValType( dGivenDate ) == 'N'
ELSEIF HB_ISNUMERIC( dGivenDate )
nWeekNum := dGivenDate
dGivenDate := Date()
ENDIF
@@ -42,7 +42,7 @@ FUNCTION FT_WEEK( dGivenDate, nWeekNum )
dTemp := aRetVal[ 2 ]
aRetVal[ 2 ] -= FT_DAYTOBOW( aRetVal[ 2 ] )
lIsWeek := ( ValType( nWeekNum ) == 'N' )
lIsWeek := HB_ISNUMERIC( nWeekNum )
IF lIsWeek
nTemp := Int( ( aRetVal[ 3 ] - aRetVal[ 2 ] ) / 7 ) + 1
IF nWeekNum < 1 .OR. nWeekNum > nTemp

View File

@@ -34,7 +34,7 @@ PROCEDURE Main( cCent )
LOCAL lCentOn := .F. , cDate
MEMVAR getlist
IF ValType( cCent ) == "C" .AND. "CENT" $ Upper( cCent )
IF HB_ISSTRING( cCent ) .AND. "CENT" $ Upper( cCent )
SET CENTURY ON
lCentOn := .T.
ENDIF
@@ -80,7 +80,7 @@ FUNCTION FT_WOY( dInDate )
LOCAL nFirstDays, nDayOffset, nWkNumber, cCentury
IF !( ValType( dInDate ) == "D" )
IF ! HB_ISDATE( dInDate )
nWkNumber := NIL
ELSE
@@ -117,7 +117,7 @@ FUNCTION FT_DOY( dInDate )
LOCAL nDayNum, cCentury
IF !( ValType( dInDate ) == "D" )
IF ! HB_ISDATE( dInDate )
nDayNum := NIL
ELSE