diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f1c4c8d435..412e5eab1c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,36 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-14 04:49 UTC+0100 Viktor Szakats (harbour syenar.net) + * src/rtl/achoice.prg + * src/rtl/alert.prg + * src/rtl/hbfilehi.prg + * src/rtl/hbi18n2.prg + * src/rtl/hbini.prg + * src/rtl/listbox.prg + * src/rtl/memoedit.prg + * src/rtl/memvarhb.prg + * src/rtl/menuto.prg + * src/rtl/objfunc.prg + * src/rtl/profiler.prg + * src/rtl/radiobtn.prg + * src/rtl/tbrowse.prg + * src/rtl/teditor.prg + * src/rtl/tgetlist.prg + * src/rtl/tmenuitm.prg + * src/rtl/tobject.prg + * src/rtl/typefile.prg + * use HB_DEFAULT() instead of 'IF ! HB_IS*()' + + * include/harbour.hbx + ! fixed one casing being wrong + + * contrib/hbmisc/stringp.prg + * contrib/xhb/ttable.prg + * contrib/xhb/xcstr.prg + * tests/debugtst.prg + ! fixed above casing where it got wrongly formatted + 2012-11-14 03:11 UTC+0100 Viktor Szakats (harbour syenar.net) * src/rtl/hbdef.c ! HB_DEFAULT(): consider date and timestamp types diff --git a/harbour/contrib/hbmisc/stringp.prg b/harbour/contrib/hbmisc/stringp.prg index 9ed7a13b60..1cfd1b5672 100644 --- a/harbour/contrib/hbmisc/stringp.prg +++ b/harbour/contrib/hbmisc/stringp.prg @@ -143,7 +143,7 @@ FUNCTION ToChar( xTxt, cSeparator, lDebug ) CASE cValTxt == "O" // Object IF lDebug cOut := xTxt:ClassName() + "(#" + ToChar( xTxt:ClassH() ) + "):{" - aData := __objGetValueLIST( xTxt ) + aData := __objGetValueList( xTxt ) nLen := Len( aData ) FOR n := 1 TO nLen // For each item : Recurse ! cOut += aData[ n ][ HB_OO_DATA_SYMBOL ] + ":" + ; diff --git a/harbour/contrib/xhb/ttable.prg b/harbour/contrib/xhb/ttable.prg index 85b8934c5c..d53447bba9 100644 --- a/harbour/contrib/xhb/ttable.prg +++ b/harbour/contrib/xhb/ttable.prg @@ -996,7 +996,7 @@ METHOD Write( lKeepBuffer ) CLASS HBTable LOCAL aOldBuffer := Array( ( ::Alias )->( FCount() ) ) LOCAL nSel := Select( ::Alias ) LOCAL nOrd := ( ::Alias )->( ordSetFocus() ) - LOCAL aData := __objGetValueLIST( Self ) + LOCAL aData := __objGetValueList( Self ) LOCAL xBuffer LOCAL n diff --git a/harbour/contrib/xhb/xcstr.prg b/harbour/contrib/xhb/xcstr.prg index a79a798461..9909f334e7 100644 --- a/harbour/contrib/xhb/xcstr.prg +++ b/harbour/contrib/xhb/xcstr.prg @@ -236,7 +236,7 @@ FUNCTION ValToPrg( xVal, cName, nPad, aObjs ) nPad += 3 cPad := Space( nPad ) - FOR EACH aVar IN __objGetValueLIST( xVal ) + FOR EACH aVar IN __objGetValueList( xVal ) cRet += cPad + cName + ":" + aVar[ 1 ] + " := " + ValToPrg( aVar[ 2 ], cName + ":" + aVar[ 1 ], nPad, aObjs ) + CRLF NEXT diff --git a/harbour/include/harbour.hbx b/harbour/include/harbour.hbx index 2c0acb3baf..2bbbc46ffd 100644 --- a/harbour/include/harbour.hbx +++ b/harbour/include/harbour.hbx @@ -1447,7 +1447,7 @@ DYNAMIC __objGetClsName DYNAMIC __objGetMethodList DYNAMIC __objGetMsgList DYNAMIC __objGetProperties -DYNAMIC __objGetValueLIST +DYNAMIC __objGetValueList DYNAMIC __objHasData DYNAMIC __objHasMethod DYNAMIC __objHasMsg diff --git a/harbour/src/rtl/achoice.prg b/harbour/src/rtl/achoice.prg index 0d0ccfb4ba..a824655aff 100644 --- a/harbour/src/rtl/achoice.prg +++ b/harbour/src/rtl/achoice.prg @@ -53,18 +53,10 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo LOCAL cKey LOCAL nAux - IF ! HB_ISNUMERIC( nTop ) - nTop := 0 - ENDIF - IF ! HB_ISNUMERIC( nLeft ) - nLeft := 0 - ENDIF - IF ! HB_ISNUMERIC( nBottom ) - nBottom := 0 - ENDIF - IF ! HB_ISNUMERIC( nRight ) - nRight := 0 - ENDIF + hb_default( @nTop, 0 ) + hb_default( @nLeft, 0 ) + hb_default( @nBottom, 0 ) + hb_default( @nRight, 0 ) IF nRight > MaxCol() nRight := MaxCol() @@ -98,12 +90,9 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo IF ! HB_ISARRAY( xSelect ) .AND. ! HB_ISLOGICAL( xSelect ) xSelect := .T. // Array or logical, what is selectable ENDIF - IF ! HB_ISNUMERIC( nPos ) - nPos := 1 // The number of the selected item - ENDIF - IF ! HB_ISNUMERIC( nHiLiteRow ) - nHiLiteRow := 0 // The row to be highlighted - ENDIF + + hb_default( @nPos, 1 ) // The number of the selected item + hb_default( @nHiLiteRow, 0 ) // The row to be highlighted nNumCols := nRight - nLeft + 1 nNumRows := nBottom - nTop + 1 diff --git a/harbour/src/rtl/alert.prg b/harbour/src/rtl/alert.prg index b396b104c7..f236aeb69b 100644 --- a/harbour/src/rtl/alert.prg +++ b/harbour/src/rtl/alert.prg @@ -64,9 +64,7 @@ FUNCTION Alert( cMessage, aOptions, cColorNorm ) cMessage := StrTran( cMessage, ";", Chr( 10 ) ) - IF ! HB_ISARRAY( aOptions ) - aOptions := {} - ENDIF + hb_default( @aOptions, {} ) IF ! HB_ISSTRING( cColorNorm ) .OR. Empty( cColorNorm ) cColorNorm := "W+/R" // first pair color (Box line and Text) @@ -131,9 +129,7 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay ) cMessage := hb_CStr( xMessage ) ENDIF - IF ! HB_ISARRAY( aOptions ) - aOptions := {} - ENDIF + hb_default( @aOptions, {} ) IF ! HB_ISSTRING( cColorNorm ) .OR. Empty( cColorNorm ) cColorNorm := "W+/R" // first pair color (Box line and Text) diff --git a/harbour/src/rtl/hbfilehi.prg b/harbour/src/rtl/hbfilehi.prg index 057a52e356..48b9513b72 100644 --- a/harbour/src/rtl/hbfilehi.prg +++ b/harbour/src/rtl/hbfilehi.prg @@ -146,9 +146,7 @@ FUNCTION hb_PathRelativize( cPathBase, cPathTarget, lForceRelative ) RETURN "" ENDIF - IF ! HB_ISLOGICAL( lForceRelative ) - lForceRelative := .T. - ENDIF + hb_default( @lForceRelative, .T. ) cPathBase := hb_PathJoin( hb_DirBase(), hb_DirSepAdd( cPathBase ) ) cPathTarget := hb_PathJoin( hb_DirBase(), cPathTarget ) diff --git a/harbour/src/rtl/hbi18n2.prg b/harbour/src/rtl/hbi18n2.prg index fc42464428..205f2e7415 100644 --- a/harbour/src/rtl/hbi18n2.prg +++ b/harbour/src/rtl/hbi18n2.prg @@ -323,12 +323,8 @@ FUNCTION __i18n_potArraySave( cFile, aTrans, cErrorMsg, lVersionNo, lSourceRef ) LOCAL cEol, cPOT, cFlg LOCAL msg - IF ! HB_ISLOGICAL( lVersionNo ) - lVersionNo := .T. - ENDIF - IF ! HB_ISLOGICAL( lSourceRef ) - lSourceRef := .T. - ENDIF + hb_default( @lVersionNo, .T. ) + hb_default( @lSourceRef, .T. ) lRet := .F. cEol := hb_eol() @@ -392,9 +388,7 @@ FUNCTION __i18n_potArrayToHash( aTrans, lEmpty, hI18N ) LOCAL cContext LOCAL hTrans, hContext - IF ! HB_ISLOGICAL( lEmpty ) - lEmpty := .F. - ENDIF + hb_default( @lEmpty, .F. ) IF ! HB_ISHASH( hI18N ) hI18N := { "CONTEXT" => { "" => { => } } } ENDIF diff --git a/harbour/src/rtl/hbini.prg b/harbour/src/rtl/hbini.prg index 6004af7682..a2f46cf25a 100644 --- a/harbour/src/rtl/hbini.prg +++ b/harbour/src/rtl/hbini.prg @@ -97,9 +97,7 @@ FUNCTION hb_iniNew( lAutoMain ) hb_HKeepOrder( hIni, .T. ) - IF ! HB_ISLOGICAL( lAutoMain ) - lAutoMain := .T. - ENDIF + hb_default( @lAutoMain, .T. ) IF lAutoMain hIni[ "MAIN" ] := { => } @@ -119,18 +117,10 @@ FUNCTION hb_iniReadStr( cData, lKeyCaseSens, cSplitters, lAutoMain ) hb_HKeepOrder( hIni, .T. ) /* Default case sensitiveness for keys */ - IF ! HB_ISLOGICAL( lKeyCaseSens ) - lKeyCaseSens := .T. - ENDIF - IF ! HB_ISSTRING( cSplitters ) - cSplitters := "=" - ENDIF - IF ! HB_ISLOGICAL( lAutoMain ) - lAutoMain := .T. - ENDIF - IF ! HB_ISSTRING( cData ) - cData := "" - ENDIF + hb_default( @lKeyCaseSens, .T. ) + hb_default( @cSplitters, "=" ) + hb_default( @lAutoMain, .T. ) + hb_default( @cData, "" ) hb_HCaseMatch( hIni, lKeyCaseSens ) @@ -346,9 +336,7 @@ FUNCTION hb_iniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain ) cBuffer += cCommentBegin + cNewLine ENDIF - IF ! HB_ISLOGICAL( lAutoMain ) - lAutoMain := .T. - ENDIF + hb_default( @lAutoMain, .T. ) // Fix if lAutoMain is .T. but I haven't a MAIN section IF lAutoMain .AND. ! hb_HHasKey( hIni, "MAIN" ) diff --git a/harbour/src/rtl/listbox.prg b/harbour/src/rtl/listbox.prg index 379a15dc04..0194e821bd 100644 --- a/harbour/src/rtl/listbox.prg +++ b/harbour/src/rtl/listbox.prg @@ -323,12 +323,9 @@ METHOD findText( cText, nPos, lCaseSensitive, lExact ) CLASS LISTBOX IF ! HB_ISSTRING( cText ) .OR. Len( cText ) == 0 RETURN 0 ENDIF - IF ! HB_ISNUMERIC( nPos ) - nPos := 1 - ENDIF - IF ! HB_ISLOGICAL( lCaseSensitive ) - lCaseSensitive := .T. - ENDIF + + hb_default( @nPos, 1 ) + hb_default( @lCaseSensitive, .T. ) IF ! HB_ISLOGICAL( lExact ) lExact := Set( _SET_EXACT ) ENDIF @@ -367,12 +364,9 @@ METHOD findData( cData, nPos, lCaseSensitive, lExact ) CLASS LISTBOX IF ! HB_ISSTRING( cData ) RETURN 0 ENDIF - IF ! HB_ISNUMERIC( nPos ) - nPos := 1 - ENDIF - IF ! HB_ISLOGICAL( lCaseSensitive ) - lCaseSensitive := .T. - ENDIF + + hb_default( @nPos, 1 ) + hb_default( @lCaseSensitive, .T. ) IF ! HB_ISLOGICAL( lExact ) lExact := Set( _SET_EXACT ) ENDIF @@ -1065,9 +1059,7 @@ METHOD New( nTop, nLeft, nBottom, nRight, lDropDown ) RETURN NIL ENDIF - IF ! HB_ISLOGICAL( lDropDown ) - lDropDown := .F. - ENDIF + hb_default( @lDropDown, .F. ) ::nBottom := nBottom ::nRight := nRight diff --git a/harbour/src/rtl/memoedit.prg b/harbour/src/rtl/memoedit.prg index 1aaf32cd3e..8671488f18 100644 --- a/harbour/src/rtl/memoedit.prg +++ b/harbour/src/rtl/memoedit.prg @@ -249,9 +249,7 @@ METHOD xDo( nStatus ) CLASS HBMemoEditor LOCAL xResult := Do( ::xUserFunction, nStatus, ::nRow, ::nCol - 1 ) - IF ! HB_ISNUMERIC( xResult ) - xResult := ME_DEFAULT - ENDIF + hb_default( @xResult, ME_DEFAULT ) ::SetPos( nOldRow, nOldCol ) SetCursor( nOldCur ) @@ -292,18 +290,18 @@ FUNCTION MemoEdit( ; LOCAL nOldCursor - IF ! HB_ISNUMERIC( nTop ) ; nTop := 0 ; ENDIF - IF ! HB_ISNUMERIC( nLeft ) ; nLeft := 0 ; ENDIF - IF ! HB_ISNUMERIC( nBottom ) ; nBottom := MaxRow() ; ENDIF - IF ! HB_ISNUMERIC( nRight ) ; nRight := MaxCol() ; ENDIF - IF ! HB_ISLOGICAL( lEditMode ) ; lEditMode := .T. ; ENDIF - IF ! HB_ISNUMERIC( nLineLength ) ; nLineLength := nRight - nLeft + 1 ; ENDIF - IF ! HB_ISNUMERIC( nTabSize ) ; nTabSize := 4 ; ENDIF - IF ! HB_ISNUMERIC( nTextBuffRow ) ; nTextBuffRow := 1 ; ENDIF - IF ! HB_ISNUMERIC( nTextBuffColumn ) ; nTextBuffColumn := 0 ; ENDIF - IF ! HB_ISNUMERIC( nWindowRow ) ; nWindowRow := 0 ; ENDIF - IF ! HB_ISNUMERIC( nWindowColumn ) ; nWindowColumn := nTextBuffColumn ; ENDIF - IF ! HB_ISSTRING( cString ) ; cString := "" ; ENDIF + hb_default( @nTop , 0 ) + hb_default( @nLeft , 0 ) + hb_default( @nBottom , MaxRow() ) + hb_default( @nRight , MaxCol() ) + hb_default( @lEditMode , .T. ) + hb_default( @nLineLength , nRight - nLeft + 1 ) + hb_default( @nTabSize , 4 ) + hb_default( @nTextBuffRow , 1 ) + hb_default( @nTextBuffColumn , 0 ) + hb_default( @nWindowRow , 0 ) + hb_default( @nWindowColumn , nTextBuffColumn ) + hb_default( @cString , "" ) // Original MemoEdit() converts Tabs into spaces; oEd := HBMemoEditor():New( StrTran( cString, Chr( 9 ), Space( 1 ) ), nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize, nTextBuffRow, nTextBuffColumn, nWindowRow, nWindowColumn ) diff --git a/harbour/src/rtl/memvarhb.prg b/harbour/src/rtl/memvarhb.prg index b068534ab0..a79f4e06f8 100644 --- a/harbour/src/rtl/memvarhb.prg +++ b/harbour/src/rtl/memvarhb.prg @@ -104,9 +104,7 @@ FUNCTION hb_mvSave( cFileName, cMask, lIncludeMask ) cMask := "*" ENDIF - IF ! HB_ISLOGICAL( lIncludeMask ) - lIncludeMask := .T. - ENDIF + hb_default( @lIncludeMask, .T. ) aVars := {} @@ -187,9 +185,7 @@ FUNCTION hb_mvRestore( cFileName, lAdditive, cMask, lIncludeMask ) IF HB_ISSTRING( cFileName ) - IF ! HB_ISLOGICAL( lAdditive ) - lAdditive := .T. - ENDIF + hb_default( @lAdditive, .T. ) IF ! lAdditive __mvClear() @@ -204,9 +200,7 @@ FUNCTION hb_mvRestore( cFileName, lAdditive, cMask, lIncludeMask ) cMask := "*" ENDIF - IF ! HB_ISLOGICAL( lIncludeMask ) - lIncludeMask := .T. - ENDIF + hb_default( @lIncludeMask, .T. ) nRetries := 0 DO WHILE .T. diff --git a/harbour/src/rtl/menuto.prg b/harbour/src/rtl/menuto.prg index 47b2c027c8..b970afaef2 100644 --- a/harbour/src/rtl/menuto.prg +++ b/harbour/src/rtl/menuto.prg @@ -130,9 +130,7 @@ FUNCTION __MenuTo( bBlock, cVariable ) xMsg := Eval( xMsg ) ENDIF - IF ! HB_ISSTRING( xMsg ) - xMsg := "" - ENDIF + hb_default( @xMsg, "" ) IF lMsgCenter nMsgCol := Int( ( MaxCol() - Len( xMsg ) ) / 2 ) diff --git a/harbour/src/rtl/objfunc.prg b/harbour/src/rtl/objfunc.prg index bc38df9d34..c3b201a6c7 100644 --- a/harbour/src/rtl/objfunc.prg +++ b/harbour/src/rtl/objfunc.prg @@ -100,13 +100,8 @@ FUNCTION __objGetMsgList( oObject, lDataMethod, nClassType ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) ENDIF - IF ! HB_ISLOGICAL( lDataMethod ) - lDataMethod := .T. - ENDIF - - IF ! HB_ISNUMERIC( nClassType ) - nClasstype := HB_MSGLISTALL - ENDIF + hb_default( @lDataMethod, .T. ) + hb_default( @nClasstype, HB_MSGLISTALL ) aInfo := ASort( oObject:ClassSel( nClassType ) ) aData := {} @@ -141,7 +136,7 @@ FUNCTION __objGetMethodList( oObject ) RETURN __objGetMsgList( oObject, .F. ) -FUNCTION __objGetValueLIST( oObject, aExcept ) +FUNCTION __objGetValueList( oObject, aExcept ) LOCAL aDataSymbol LOCAL nLen @@ -153,9 +148,7 @@ FUNCTION __objGetValueLIST( oObject, aExcept ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) ENDIF - IF ! HB_ISARRAY( aExcept ) - aExcept := {} - ENDIF + hb_default( @aExcept, {} ) aDataSymbol := __objGetMsgList( oObject ) nLen := Len( aDataSymbol ) diff --git a/harbour/src/rtl/profiler.prg b/harbour/src/rtl/profiler.prg index 00bd5e2677..03dc37c397 100644 --- a/harbour/src/rtl/profiler.prg +++ b/harbour/src/rtl/profiler.prg @@ -535,9 +535,7 @@ METHOD generate( bFilter ) CLASS HBProfileReport LOCAL lProfile := __SetProfiler( .F. ) - IF ! HB_ISBLOCK( bFilter ) - bFilter := {|| .T. } - ENDIF + hb_default( @bFilter, {|| .T. } ) ::emitHeader():oProfile:forEach( {| o | iif( Eval( bFilter, o ), ::emitLine( o ), NIL ) } ) @@ -576,9 +574,7 @@ METHOD generate( bFilter, cFile ) CLASS HBProfileReportToFile LOCAL lProfile := __SetProfiler( .F. ) - IF ! HB_ISSTRING( cFile ) - cFile := "hbprof.txt" - ENDIF + hb_default( @cFile, "hbprof.txt" ) IF ( ::hFile := FCreate( cFile ) ) != F_ERROR ::super:generate( bFilter ) diff --git a/harbour/src/rtl/radiobtn.prg b/harbour/src/rtl/radiobtn.prg index 0dec5bf794..446c4ffd84 100644 --- a/harbour/src/rtl/radiobtn.prg +++ b/harbour/src/rtl/radiobtn.prg @@ -329,9 +329,7 @@ METHOD New( nRow, nCol, cCaption, cData ) CLASS RADIOBUTTN RETURN NIL ENDIF - IF ! HB_ISSTRING( cCaption ) - cCaption := "" - ENDIF + hb_default( @cCaption, "" ) ::nCapRow := nRow ::nCapCol := nCol + 3 + 1 diff --git a/harbour/src/rtl/tbrowse.prg b/harbour/src/rtl/tbrowse.prg index 3d1a18c9de..e18e39b05d 100644 --- a/harbour/src/rtl/tbrowse.prg +++ b/harbour/src/rtl/tbrowse.prg @@ -1311,16 +1311,12 @@ METHOD doConfigure() CLASS TBROWSE cHeadSep := oCol:headSep IF ! HB_ISSTRING( cHeadSep ) .OR. cHeadSep == "" cHeadSep := ::cHeadSep - IF ! HB_ISSTRING( cHeadSep ) - cHeadSep := "" - ENDIF + hb_default( @cHeadSep, "" ) ENDIF cFootSep := oCol:footSep IF ! HB_ISSTRING( cFootSep ) .OR. cFootSep == "" cFootSep := ::cFootSep - IF ! HB_ISSTRING( cFootSep ) - cFootSep := "" - ENDIF + hb_default( @cFootSep, "" ) ENDIF aCol := Array( _TBCI_SIZE ) aCol[ _TBCI_COLOBJECT ] := oCol diff --git a/harbour/src/rtl/teditor.prg b/harbour/src/rtl/teditor.prg index c3ece0d9ea..e2d0d12c4e 100644 --- a/harbour/src/rtl/teditor.prg +++ b/harbour/src/rtl/teditor.prg @@ -1006,18 +1006,18 @@ METHOD BrowseText( nPassedKey ) METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize, nTextRow, nTextCol, nWndRow, nWndCol ) CLASS HBEditor - IF ! HB_ISSTRING( cString ) ; cString := "" ; ENDIF - IF ! HB_ISNUMERIC( nTop ) ; nTop := 0 ; ENDIF - IF ! HB_ISNUMERIC( nLeft ) ; nLeft := 0 ; ENDIF - IF ! HB_ISNUMERIC( nBottom ) ; nBottom := MaxRow() ; ENDIF - IF ! HB_ISNUMERIC( nRight ) ; nRight := MaxCol() ; ENDIF - IF ! HB_ISLOGICAL( lEditMode ) ; lEditMode := .T. ; ENDIF - IF ! HB_ISNUMERIC( nLineLength ) ; nLineLength := NIL ; ENDIF - IF ! HB_ISNUMERIC( nTabSize ) ; nTabSize := NIL ; ENDIF - IF ! HB_ISNUMERIC( nTextRow ) ; nTextRow := 1 ; ENDIF - IF ! HB_ISNUMERIC( nTextCol ) ; nTextCol := 0 ; ENDIF - IF ! HB_ISNUMERIC( nWndRow ) ; nWndRow := 0 ; ENDIF - IF ! HB_ISNUMERIC( nWndCol ) ; nWndCol := 0 ; ENDIF + hb_default( @cString , "" ) + hb_default( @nTop , 0 ) + hb_default( @nLeft , 0 ) + hb_default( @nBottom , MaxRow() ) + hb_default( @nRight , MaxCol() ) + hb_default( @lEditMode , .T. ) + hb_default( @nLineLength , NIL ) + hb_default( @nTabSize , NIL ) + hb_default( @nTextRow , 1 ) + hb_default( @nTextCol , 0 ) + hb_default( @nWndRow , 0 ) + hb_default( @nWndCol , 0 ) ::aText := Text2Array( cString, nLineLength ) ::naTextLen := Len( ::aText ) diff --git a/harbour/src/rtl/tgetlist.prg b/harbour/src/rtl/tgetlist.prg index a664c0c752..23dc1c69a4 100644 --- a/harbour/src/rtl/tgetlist.prg +++ b/harbour/src/rtl/tgetlist.prg @@ -656,9 +656,7 @@ METHOD GetDoSetKey( bKeyBlock, oGet ) CLASS HBGetList lSetKey := Eval( bKeyBlock, ::cReadProcName, ::nReadProcLine, ::ReadVar() ) - IF ! HB_ISLOGICAL( lSetKey ) - lSetKey := .T. - ENDIF + hb_default( @lSetKey, .T. ) ::ShowScoreboard() oGet:updateBuffer() diff --git a/harbour/src/rtl/tmenuitm.prg b/harbour/src/rtl/tmenuitm.prg index 41e604a9dc..2fece6f5c7 100644 --- a/harbour/src/rtl/tmenuitm.prg +++ b/harbour/src/rtl/tmenuitm.prg @@ -180,15 +180,9 @@ METHOD isPopUp() CLASS MENUITEM METHOD New( cCaption, boData, nShortcut, cMessage, nID ) CLASS MENUITEM - IF ! HB_ISNUMERIC( nShortcut ) - nShortcut := 0 - ENDIF - IF ! HB_ISSTRING( cMessage ) - cMessage := "" - ENDIF - IF ! HB_ISNUMERIC( nID ) - nID := 0 - ENDIF + hb_default( @nShortcut, 0 ) + hb_default( @cMessage, "" ) + hb_default( @nID, 0 ) ::data := boData ::nID := nID diff --git a/harbour/src/rtl/tobject.prg b/harbour/src/rtl/tobject.prg index 7168f49117..7b62bc4927 100644 --- a/harbour/src/rtl/tobject.prg +++ b/harbour/src/rtl/tobject.prg @@ -149,8 +149,6 @@ STATIC FUNCTION HBObject_Dftonerror( ... ) STATIC FUNCTION HBObject_Error( cDesc, cClass, cMsg, nCode ) - IF ! HB_ISNUMERIC( nCode ) - nCode := 1004 - ENDIF + hb_default( @nCode, 1004 ) RETURN __errRT_SBASE( iif( nCode == 1005, EG_NOVARMETHOD, EG_NOMETHOD ), nCode, cDesc, cClass + ":" + cMsg, 1, QSelf() ) diff --git a/harbour/src/rtl/typefile.prg b/harbour/src/rtl/typefile.prg index 736efc1b0c..9483ed243c 100644 --- a/harbour/src/rtl/typefile.prg +++ b/harbour/src/rtl/typefile.prg @@ -72,9 +72,7 @@ PROCEDURE __TypeFile( cFile, lPrint ) LOCAL cPath LOCAL i - IF ! HB_ISLOGICAL( lPrint ) - lPrint := .F. - ENDIF + hb_default( @lPrint, .F. ) IF ! HB_ISSTRING( cFile ) oErr := ErrorNew() diff --git a/harbour/tests/debugtst.prg b/harbour/tests/debugtst.prg index f1ac5180d9..7fce7063b0 100644 --- a/harbour/tests/debugtst.prg +++ b/harbour/tests/debugtst.prg @@ -233,7 +233,7 @@ STATIC FUNCTION Transfer( x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 ) /* etc */ LOCAL n IF nLen == 0 - xRet := __objGetValueLIST( self, ::aExcept() ) + xRet := __objGetValueList( self, ::aExcept() ) ELSE FOR n := 1 TO nLen