diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b0da0788e8..fe194da754 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,53 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-14 01:58 UTC+0100 Viktor Szakats (harbour syenar.net) + * ChangeLog + * added a missed incompatibity note to previous entry. + + * contrib/hbcomm/comm.prg + * contrib/hbct/ctmisc.prg + * contrib/hbct/fcopy.prg + * contrib/hbct/getinput.prg + * contrib/hbct/getsecrt.prg + * contrib/hbct/keysec.prg + * contrib/hbct/scrmark.prg + * contrib/hbct/tempfile.prg + * contrib/hbfbird/tfirebrd.prg + * contrib/hbfoxpro/misc.prg + * contrib/hbmagic/hbmagis.prg + * contrib/hbmisc/hbedit.prg + * contrib/hbmysql/tmysql.prg + * contrib/hbmysql/tsqlbrw.prg + * contrib/hbodbc/todbc.prg + * contrib/hbpgsql/tpostgre.prg + * contrib/hbsms/sms.prg + * contrib/hbtip/client.prg + * contrib/hbtip/encb64.prg + * contrib/hbtip/log.prg + * contrib/hbtip/mail.prg + * contrib/hbtip/popcli.prg + * contrib/hbtip/sendmail.prg + * contrib/hbtip/smtpcli.prg + * contrib/hbtip/thtml.prg + * contrib/hbwin/wce_sim.prg + * contrib/hbwin/win_os.prg + * contrib/hbwin/win_reg.prg + * contrib/hbwin/win_tprn.prg + * contrib/hbxpp/dbfuncsx.prg + * contrib/xhb/dirrec.prg + * contrib/xhb/dumpvar.prg + * contrib/xhb/hbcomprs.prg + * contrib/xhb/hjwindow.prg + * contrib/xhb/htmutil.prg + * contrib/xhb/sprintf.prg + * contrib/xhb/tedit.prg + * extras/gtwvw/tests/drawimg.prg + * extras/gtwvw/tests/ebtest7.prg + * extras/rddado/adordd.prg + * use HB_DEFAULT() instead of 'IF ! HB_IS*()' + constructs, where possible and optimal. + 2012-11-14 00:46 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbodbc/hbodbc.hbp * contrib/hbodbc/odbc.c @@ -32,6 +79,9 @@ Memory management code is guarded with _HBODBC_AUTO_MM_ both on .prg and .c level. Also in test code. + ; Since pointers are now checked for type, + some old wrong code now may generate RTEs. + INCOMPATIBLE. % cleanups to TODBC() class to not use a temp variable to pass object vars by reference * other minor .prg level cleanups diff --git a/harbour/contrib/hbcomm/comm.prg b/harbour/contrib/hbcomm/comm.prg index 2689dfab7e..171c959702 100644 --- a/harbour/contrib/hbcomm/comm.prg +++ b/harbour/contrib/hbcomm/comm.prg @@ -77,9 +77,7 @@ FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize ) IF hb_comOpen( nPort ) - IF ! HB_ISNUMERIC( nBaud ) - nBaud := 9600 - ENDIF + hb_default( @nBaud, 9600 ) cParity := "N" IF HB_ISNUMERIC( nParity ) @@ -91,9 +89,7 @@ FUNCTION INIT_PORT( cPort, nBaud, nData, nParity, nStop, nBufferSize ) ENDSWITCH ENDIF - IF ! HB_ISNUMERIC( nStop ) - nStop := 1 - ENDIF + hb_default( @nStop, 1 ) HB_SYMBOL_UNUSED( nBufferSize ) diff --git a/harbour/contrib/hbct/ctmisc.prg b/harbour/contrib/hbct/ctmisc.prg index feaa0329e1..584f6b2eff 100644 --- a/harbour/contrib/hbct/ctmisc.prg +++ b/harbour/contrib/hbct/ctmisc.prg @@ -57,9 +57,7 @@ FUNCTION AlloFree( lMode ) - IF ! HB_ISLOGICAL( lMode ) - lMode := .F. - ENDIF + hb_default( @lMode, .F. ) RETURN Memory( iif( lMode, HB_MEM_CHAR, HB_MEM_BLOCK ) ) diff --git a/harbour/contrib/hbct/fcopy.prg b/harbour/contrib/hbct/fcopy.prg index f749a8be60..42b079703c 100644 --- a/harbour/contrib/hbct/fcopy.prg +++ b/harbour/contrib/hbct/fcopy.prg @@ -87,9 +87,8 @@ FUNCTION FileCopy( cSource, cDest, lMode ) LOCAL lDone := .F. LOCAL nSrcBytes, nDstBytes, nTotBytes := 0 - IF ! HB_ISLOGICAL( lMode ) - lMode := .F. - ENDIF + hb_default( @lMode, .F. ) + IF t_hSrcFile != F_ERROR FClose( t_hSrcFile ) ENDIF diff --git a/harbour/contrib/hbct/getinput.prg b/harbour/contrib/hbct/getinput.prg index 48db5fe211..a16f2cf8df 100644 --- a/harbour/contrib/hbct/getinput.prg +++ b/harbour/contrib/hbct/getinput.prg @@ -59,15 +59,9 @@ FUNCTION GetInput( xVar, nRow, nCol, lSay, xPrompt ) LOCAL nCursorCol := Col() LOCAL GetList := {} - IF ! HB_ISNUMERIC( nRow ) - nRow := nCursorRow - ENDIF - IF ! HB_ISNUMERIC( nCol ) - nCol := nCursorCol - ENDIF - IF ! HB_ISLOGICAL( lSay ) - lSay := .F. - ENDIF + hb_default( @nRow, nCursorRow ) + hb_default( @nCol, nCursorCol ) + hb_default( @lSay, .F. ) SetPos( nRow, nCol ) IF xPrompt != Nil diff --git a/harbour/contrib/hbct/getsecrt.prg b/harbour/contrib/hbct/getsecrt.prg index 6f93434350..e35abdc27d 100644 --- a/harbour/contrib/hbct/getsecrt.prg +++ b/harbour/contrib/hbct/getsecrt.prg @@ -63,15 +63,9 @@ FUNCTION GetSecret( cVar, nRow, nCol, lSay, xPrompt ) LOCAL _cGetSecret := cVar LOCAL lHide := .T. - IF ! HB_ISNUMERIC( nRow ) - nRow := Row() - ENDIF - IF ! HB_ISNUMERIC( nCol ) - nCol := Col() - ENDIF - IF ! HB_ISLOGICAL( lSay ) - lSay := .F. - ENDIF + hb_default( @nRow, nCursorRow ) + hb_default( @nCol, nCursorCol ) + hb_default( @lSay, .F. ) SetPos( nRow, nCol ) IF xPrompt != Nil diff --git a/harbour/contrib/hbct/keysec.prg b/harbour/contrib/hbct/keysec.prg index 7aca1f912c..4c8c279dbd 100644 --- a/harbour/contrib/hbct/keysec.prg +++ b/harbour/contrib/hbct/keysec.prg @@ -62,18 +62,16 @@ FUNCTION KeySec( nKey, nTime, nCounter, lMode ) ENDIF IF HB_ISNUMERIC( nKey ) + IF ! HB_ISNUMERIC( nTime ) nTime := 0 ELSEIF nTime < 0 nTime := -nTime / 18.2 ENDIF nTime *= 1000 - IF ! HB_ISNUMERIC( nCounter ) - nCounter := 1 - ENDIF - IF ! HB_ISLOGICAL( lMode ) - lMode := .F. - ENDIF + + hb_default( @nCounter, 1 ) + hb_default( @lMode, .F. ) nSeconds := hb_MilliSeconds() t_hIdle := hb_idleAdd( {|| doKeySec( nKey, nTime, lMode, ; diff --git a/harbour/contrib/hbct/scrmark.prg b/harbour/contrib/hbct/scrmark.prg index 988abbb615..d2a45e3fe6 100644 --- a/harbour/contrib/hbct/scrmark.prg +++ b/harbour/contrib/hbct/scrmark.prg @@ -62,12 +62,9 @@ FUNCTION ScreenMark( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing ) LOCAL nAt, nLen, nLast, nRow, nCol, nEnd, nCols LOCAL cScreen - IF ! HB_ISLOGICAL( lUpperLower ) - lUpperLower := .F. - ENDIF - IF ! HB_ISLOGICAL( lAll ) - lAll := .F. - ENDIF + hb_default( @lUpperLower, .F. ) + hb_default( @lAll, .F. ) + IF ! HB_ISSTRING( cForward ) .OR. cForward == "" cForward := NIL ENDIF diff --git a/harbour/contrib/hbct/tempfile.prg b/harbour/contrib/hbct/tempfile.prg index 8e69ef5621..0bd3d40d4d 100644 --- a/harbour/contrib/hbct/tempfile.prg +++ b/harbour/contrib/hbct/tempfile.prg @@ -60,9 +60,8 @@ FUNCTION TempFile( cDir, cExt, nAttr ) IF HB_ISSTRING( cExt ) .AND. !( Left( cExt, 1 ) == "." ) cExt := "." + cExt ENDIF - IF ! HB_ISNUMERIC( nAttr ) - nAttr := SetFCreate() - ENDIF + + hb_default( @nAttr, SetFCreate() ) fhnd := hb_FTempCreateEx( @cName, cDir,, cExt, nAttr ) diff --git a/harbour/contrib/hbfbird/tfirebrd.prg b/harbour/contrib/hbfbird/tfirebrd.prg index 4468c001d0..9da2e0f7c4 100644 --- a/harbour/contrib/hbfbird/tfirebrd.prg +++ b/harbour/contrib/hbfbird/tfirebrd.prg @@ -106,9 +106,7 @@ ENDCLASS METHOD New( cServer, cUser, cPassword, nDialect ) CLASS TFbServer - IF ! HB_ISNUMERIC( nDialect ) - nDialect := 1 - ENDIF + hb_default( @nDialect, 1 ) ::lError := .F. ::nError := 0 diff --git a/harbour/contrib/hbfoxpro/misc.prg b/harbour/contrib/hbfoxpro/misc.prg index 0c8941eff2..0c84dec870 100644 --- a/harbour/contrib/hbfoxpro/misc.prg +++ b/harbour/contrib/hbfoxpro/misc.prg @@ -60,9 +60,7 @@ FUNCTION Sys( nValue, xPar1 ) CASE 2 RETURN hb_ntos( Seconds() ) CASE 2002 - IF ! HB_ISNUMERIC( xPar1 ) - xPar1 := SC_NONE - ENDIF + hb_default( @xPar1, SC_NONE ) RETURN SetCursor( xPar1 ) OTHERWISE /* Throw RTE? */ diff --git a/harbour/contrib/hbmagic/hbmagis.prg b/harbour/contrib/hbmagic/hbmagis.prg index 83bd2bc876..b1ec879054 100644 --- a/harbour/contrib/hbmagic/hbmagis.prg +++ b/harbour/contrib/hbmagic/hbmagis.prg @@ -56,9 +56,7 @@ FUNCTION hb_magic_simple( cFileName, nFlags ) LOCAL hMagic - IF ! HB_ISNUMERIC( nFlags ) - nFlags := MAGIC_MIME_TYPE - ENDIF + hb_default( @nFlags, MAGIC_MIME_TYPE ) hMagic := magic_open( nFlags ) IF Empty( hMagic ) .OR.; diff --git a/harbour/contrib/hbmisc/hbedit.prg b/harbour/contrib/hbmisc/hbedit.prg index 2ff29e0a5b..e53f066336 100644 --- a/harbour/contrib/hbmisc/hbedit.prg +++ b/harbour/contrib/hbmisc/hbedit.prg @@ -59,9 +59,7 @@ FUNCTION EditorNew( nTop, nLeft, nBottom, nRight, nLength, ; LOCAL pEdit, oEdit - IF ! HB_ISNUMERIC( nLength ) - nLength := 80 - ENDIF + hb_default( @nLength, 80 ) pEdit := ed_New( nLength, 4, IIFNIL( s_nESize, nSize ), nEscape ) IF ! Empty( pEdit ) @@ -200,9 +198,7 @@ PROCEDURE EditorInsText( oEdit, cText, nLine ) FUNCTION EditorGetText( oEdit, nCarret ) - IF ! HB_ISNUMERIC( nCarret ) - nCarret := EDIT_HARD - ENDIF + hb_default( @nCarret, EDIT_HARD ) RETURN ed_GetText( oEdit[ E_EDIT ], nCarret ) @@ -264,9 +260,7 @@ FUNCTION EditorFile( xInput, cOutput, nLineLen, ; LOCAL nHandle, nLen, oEdit, lSaved, lClose := .F. LOCAL nSize - IF ! HB_ISLOGICAL( lSave ) - lSave := .T. - ENDIF + hb_default( @lSave, .T. ) IF HB_ISSTRING( xInput ) nHandle := FOpen( xInput ) diff --git a/harbour/contrib/hbmysql/tmysql.prg b/harbour/contrib/hbmysql/tmysql.prg index 4651a39299..52b6892dd8 100644 --- a/harbour/contrib/hbmysql/tmysql.prg +++ b/harbour/contrib/hbmysql/tmysql.prg @@ -89,12 +89,8 @@ ENDCLASS METHOD New( aRow, aFStruct, cTableName ) CLASS TMySQLRow - IF ! HB_ISSTRING( cTableName ) - cTableName := "" - ENDIF - IF ! HB_ISARRAY( aFStruct ) - aFStruct := {} - ENDIF + hb_default( @cTableName, "" ) + hb_default( @aFStruct, {} ) ::aRow := aRow // DAVID: @@ -180,9 +176,7 @@ METHOD FieldLen( nNum ) CLASS TMySQLRow */ METHOD FieldDec( nNum, lFormat ) CLASS TMySQLRow - IF ! HB_ISLOGICAL( lFormat ) - lFormat := .F. - ENDIF + hb_default( @lFormat, .F. ) IF nNum >= 1 .AND. nNum <= Len( ::aFieldStruct ) @@ -416,9 +410,7 @@ METHOD Skip( nRows ) CLASS TMySQLQuery LOCAL lbof // NOTE: MySQL row count starts from 0 - IF ! HB_ISNUMERIC( nRows ) - nRows := 1 - ENDIF + hb_default( @nRows, 1 ) // DAVID: ::lBof := Empty( ::LastRec() ) @@ -674,9 +666,7 @@ METHOD FieldLen( nNum ) CLASS TMySQLQuery */ METHOD FieldDec( nNum, lFormat ) CLASS TMySQLQuery - IF ! HB_ISLOGICAL( lFormat ) - lFormat := .F. - ENDIF + hb_default( @lFormat, .F. ) IF nNum >= 1 .AND. nNum <= Len( ::aFieldStruct ) IF ! lFormat .AND. ( ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_FLOAT .OR. ; @@ -814,13 +804,9 @@ METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable // DAVID: LOCAL ni, cWhere := " WHERE " - IF ! HB_ISLOGICAL( lOldRecord ) - lOldRecord := .F. - ENDIF - // DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter - IF ! HB_ISLOGICAL( lRefresh ) - lRefresh := .T. - ENDIF + hb_default( @lOldRecord, .F. ) + // DAVID: too many ::refresh() can slow some processes, so we can deactivate it by parameter + hb_default( @lRefresh, .T. ) ::lError := .F. @@ -937,13 +923,9 @@ METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable // DAVID: LOCAL ni, cWhere := " WHERE " - IF ! HB_ISLOGICAL( lOldRecord ) - lOldRecord := .F. - ENDIF - // DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter - IF ! HB_ISLOGICAL( lRefresh ) - lRefresh := .T. - ENDIF + hb_default( @lOldRecord, .F. ) + // DAVID: too many ::refresh() can slow some processes, so we can deactivate it by parameter + hb_default( @lRefresh, .T. ) // is this a row of this table ? IF oRow == NIL @@ -1034,10 +1016,8 @@ METHOD Append( oRow, lRefresh ) CLASS TMySQLTable LOCAL cInsertQuery := "INSERT INTO " + ::cTable + " (" LOCAL i - // DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter - IF ! HB_ISLOGICAL( lRefresh ) - lRefresh := .T. - ENDIF + // DAVID: too many ::refresh() can slow some processes, so we can deactivate it by parameter + hb_default( @lRefresh, .T. ) IF oRow == NIL // default Current row @@ -1143,9 +1123,7 @@ METHOD GetBlankRow( lSetValues ) CLASS TMySQLTable LOCAL aRow := Array( ::nNumFields ) // DAVID: It is not current row, so do not change it - IF ! HB_ISLOGICAL( lSetValues ) - lSetValues := .F. - ENDIF + hb_default( @lSetValues, .F. ) // crate an array of empty fields FOR i := 1 TO ::nNumFields @@ -1495,9 +1473,7 @@ METHOD CreateIndex( cName, cTable, aFNames, lUnique ) CLASS TMySQLServer LOCAL cCreateQuery := "CREATE " LOCAL i - IF ! HB_ISLOGICAL( lUnique ) - lUnique := .F. - ENDIF + hb_default( @lUnique, .F. ) IF lUnique cCreateQuery += "UNIQUE INDEX " @@ -1558,9 +1534,7 @@ METHOD Query( cQuery ) CLASS TMySQLServer LOCAL oQuery, cTableName, i, cUpperQuery, nNumTables, cToken - IF ! HB_ISSTRING( cQuery ) - cQuery := "" - ENDIF + hb_default( @cQuery, "" ) cUpperQuery := Upper( AllTrim( cQuery ) ) i := 1 diff --git a/harbour/contrib/hbmysql/tsqlbrw.prg b/harbour/contrib/hbmysql/tsqlbrw.prg index cf6af163e9..2df9c43299 100644 --- a/harbour/contrib/hbmysql/tsqlbrw.prg +++ b/harbour/contrib/hbmysql/tsqlbrw.prg @@ -328,12 +328,8 @@ METHOD BrowseTable( lCanEdit, aExitKeys ) CLASS TBrowseSQL IF ! HB_ISNUMERIC( nKey ) nKey := NIL ENDIF - IF ! HB_ISLOGICAL( lCanEdit ) - lCanEdit := .F. - ENDIF - IF ! HB_ISARRAY( aExitKeys ) - aExitKeys := { K_ESC } - ENDIF + hb_default( @lCanEdit, .F. ) + hb_default( @aExitKeys, { K_ESC } ) DO WHILE lKeepGoing diff --git a/harbour/contrib/hbodbc/todbc.prg b/harbour/contrib/hbodbc/todbc.prg index d06c46726d..95ef354ab4 100644 --- a/harbour/contrib/hbodbc/todbc.prg +++ b/harbour/contrib/hbodbc/todbc.prg @@ -167,15 +167,7 @@ METHOD New( cODBCStr, cUserName, cPassword, lCache ) CLASS TODBC LOCAL nRet - IF HB_ISSTRING( cUserName ) - IF ! HB_ISSTRING( cPassword ) - cPassword := "" - ENDIF - ENDIF - - IF ! HB_ISLOGICAL( lCache ) - lCache := .T. - ENDIF + hb_default( @lCache, .T. ) ::cODBCStr := cODBCStr ::lCacheRS := lCache @@ -189,6 +181,9 @@ METHOD New( cODBCStr, cUserName, cPassword, lCache ) CLASS TODBC SQLAllocConnect( ::hEnv, @::hDbc ) // Allocates SQL Connection IF HB_ISSTRING( cUserName ) + + hb_default( @cPassword, "" ) + IF ! ( ( nRet := SQLConnect( ::hDbc, cODBCStr, cUserName, cPassword ) ) == SQL_SUCCESS .OR. nRet == SQL_SUCCESS_WITH_INFO ) // TODO: Some error here ENDIF @@ -202,9 +197,7 @@ METHOD SetAutoCommit( lEnable ) CLASS TODBC LOCAL lOld := ::lAutoCommit - IF ! HB_ISLOGICAL( lEnable ) - lEnable := .T. - ENDIF + hb_default( @lEnable, .T. ) IF lEnable != lOld ::SetCnnOptions( SQL_AUTOCOMMIT, iif( lEnable, SQL_AUTOCOMMIT_ON, SQL_AUTOCOMMIT_OFF ) ) diff --git a/harbour/contrib/hbpgsql/tpostgre.prg b/harbour/contrib/hbpgsql/tpostgre.prg index 57c05953c6..0fc2648d9c 100644 --- a/harbour/contrib/hbpgsql/tpostgre.prg +++ b/harbour/contrib/hbpgsql/tpostgre.prg @@ -105,9 +105,7 @@ METHOD New( cHost, cDatabase, cUser, cPass, nPort, Schema ) CLASS TPQserver LOCAL res - IF ! HB_ISNUMERIC( nPort ) - nPort := 5432 - ENDIF + hb_default( @nPort, 5432 ) ::pDB := PQconnectdb( "dbname = " + cDatabase + " host = " + cHost + " user = " + cUser + " password = " + cPass + " port = " + hb_ntos( nPort ) ) @@ -572,12 +570,8 @@ METHOD Refresh( lQuery, lMeta ) CLASS TPQquery LOCAL i LOCAL cType, nDec, nSize - IF ! HB_ISLOGICAL( lQuery ) - lQuery := .T. - ENDIF - IF ! HB_ISLOGICAL( lMeta ) - lMeta := .T. - ENDIF + hb_default( @lQuery, .T. ) + hb_default( @lMeta, .T. ) ::Destroy() @@ -748,9 +742,7 @@ METHOD Read() CLASS TPQquery METHOD Skip( nrecno ) CLASS TPQquery - IF ! HB_ISNUMERIC( nRecno ) - nRecno := 1 - ENDIF + hb_default( @nRecno, 1 ) IF ::nRecno + nRecno > 0 .AND. ::nRecno + nRecno <= ::nLastrec ::nRecno := ::nRecno + nRecno diff --git a/harbour/contrib/hbsms/sms.prg b/harbour/contrib/hbsms/sms.prg index 2870792120..2cbc2637ed 100644 --- a/harbour/contrib/hbsms/sms.prg +++ b/harbour/contrib/hbsms/sms.prg @@ -68,13 +68,8 @@ STATIC FUNCTION port_rece( h, n, t ) LOCAL cString - IF ! HB_ISNUMERIC( n ) - n := 64 - ENDIF - - IF ! HB_ISNUMERIC( t ) - t := 5 - ENDIF + hb_default( @n, 64 ) + hb_default( @t, 5 ) cString := Space( n ) diff --git a/harbour/contrib/hbtip/client.prg b/harbour/contrib/hbtip/client.prg index 45e19c498c..c131d20661 100644 --- a/harbour/contrib/hbtip/client.prg +++ b/harbour/contrib/hbtip/client.prg @@ -460,9 +460,7 @@ METHOD ReadToFile( cFile, nMode, nSize ) CLASS TIPClient LOCAL cData LOCAL nSent - IF ! HB_ISNUMERIC( nMode ) - nMode := FC_NORMAL - ENDIF + hb_default( @nMode, FC_NORMAL ) nSent := 0 diff --git a/harbour/contrib/hbtip/encb64.prg b/harbour/contrib/hbtip/encb64.prg index f878a599cc..688b8b64a3 100644 --- a/harbour/contrib/hbtip/encb64.prg +++ b/harbour/contrib/hbtip/encb64.prg @@ -88,9 +88,8 @@ FUNCTION tip_Base64Encode( cBinary, nLineLength, cCRLF ) IF ! HB_ISNUMERIC( nLineLength ) RETURN cTextIn ENDIF - IF ! HB_ISSTRING( cCRLF ) - cCRLF := hb_eol() - ENDIF + + hb_default( @cCRLF, hb_eol() ) cText := "" FOR tmp := 1 TO Len( cTextIn ) STEP nLineLength diff --git a/harbour/contrib/hbtip/log.prg b/harbour/contrib/hbtip/log.prg index eb7d0c182b..a02983b2a3 100644 --- a/harbour/contrib/hbtip/log.prg +++ b/harbour/contrib/hbtip/log.prg @@ -70,9 +70,7 @@ ENDCLASS METHOD New( cFileName ) CLASS TIPLog - IF ! HB_ISSTRING( cFileName ) - cFileName := "hbtip" - ENDIF + hb_default( @cFileName, "hbtip" ) IF Set( _SET_DEFEXTENSIONS ) cFileName := hb_FNameExtSetDef( cFileName, ".log" ) diff --git a/harbour/contrib/hbtip/mail.prg b/harbour/contrib/hbtip/mail.prg index 1087ab3555..5ad1dc196c 100644 --- a/harbour/contrib/hbtip/mail.prg +++ b/harbour/contrib/hbtip/mail.prg @@ -398,9 +398,7 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TIPMail ENDIF // Part 1: parsing header - IF ! HB_ISNUMERIC( nPos ) - nPos := 1 - ENDIF + hb_default( @nPos, 1 ) nLinePos := hb_At( e"\r\n", cMail, nPos ) DO WHILE nLinePos > nPos @@ -533,9 +531,7 @@ METHOD setHeader( cSubject, cFrom, xTo, xCC, xBCC ) CLASS TIPMail LOCAL aTo, aCC, aBCC, i, imax LOCAL cTo, cCC, cBCC - IF ! HB_ISSTRING( cSubject ) - cSubject := "" - ENDIF + hb_default( @cSubject, "" ) IF ! HB_ISSTRING( cFrom ) RETURN .F. @@ -680,9 +676,7 @@ METHOD getMultiParts( aParts ) CLASS TIPMail ::resetAttachment() - IF ! HB_ISARRAY( aParts ) - aParts := {} - ENDIF + hb_default( @aParts, {} ) DO WHILE ( oSubPart := ::nextAttachment() ) != NIL lReset := .T. diff --git a/harbour/contrib/hbtip/popcli.prg b/harbour/contrib/hbtip/popcli.prg index edf36f106c..f024fdb4ca 100644 --- a/harbour/contrib/hbtip/popcli.prg +++ b/harbour/contrib/hbtip/popcli.prg @@ -149,9 +149,7 @@ METHOD OpenDigest( cUrl ) CLASS TIPClientPOP METHOD Close( lAutoQuit ) CLASS TIPClientPOP - IF ! HB_ISLOGICAL( lAutoQuit ) - lAutoQuit := .T. - ENDIF + hb_default( @lAutoQuit, .T. ) ::InetTimeOut( ::SocketCon ) @@ -386,9 +384,7 @@ METHOD retrieveAll( lDelete ) LOCAL aMails, i, imax, cMail - IF ! HB_ISLOGICAL( lDelete ) - lDelete := .F. - ENDIF + hb_default( @lDelete, .F. ) IF ! ::isOpen RETURN NIL diff --git a/harbour/contrib/hbtip/sendmail.prg b/harbour/contrib/hbtip/sendmail.prg index e58744d1c7..796ce0976e 100644 --- a/harbour/contrib/hbtip/sendmail.prg +++ b/harbour/contrib/hbtip/sendmail.prg @@ -100,34 +100,24 @@ FUNCTION hb_SendMail( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ; LOCAL lConnect := .T. LOCAL oPop - IF ! HB_ISSTRING( cServer ) .OR. Empty( cServer ) - cServer := "localhost" + /* consider any empty values invalid */ + IF Empty( cServer ) + cServer := NIL ENDIF - IF ! HB_ISSTRING( cUser ) - cUser := "" - ENDIF - IF ! HB_ISSTRING( cPass ) - cPass := "" - ENDIF - IF ! HB_ISNUMERIC( nPort ) .OR. Empty( nPort ) - nPort := 25 - ENDIF - IF ! HB_ISLOGICAL( lPopAuth ) - lPopAuth := .T. - ENDIF - IF ! HB_ISLOGICAL( lNoAuth ) - lNoAuth := .F. - ENDIF - IF ! HB_ISNUMERIC( nTimeOut ) - nTimeOut := 10000 - ENDIF - IF ! HB_ISLOGICAL( lTLS ) - lTLS := .F. - ENDIF - IF ! HB_ISSTRING( cSMTPPass ) - cSMTPPass := cPass + IF Empty( nPort ) + nPort := NIL ENDIF + hb_default( @cServer, "localhost" ) + hb_default( @cUser, "" ) + hb_default( @cPass, "" ) + hb_default( @nPort, 25 ) + hb_default( @lPopAuth, .T. ) + hb_default( @lNoAuth, .F. ) + hb_default( @nTimeOut, 10000 ) + hb_default( @lTLS, .F. ) + hb_default( @cSMTPPass, cPass ) + // cTo IF HB_ISARRAY( xTo ) FOR tmp := Len( xTo ) TO 1 STEP -1 @@ -351,24 +341,12 @@ FUNCTION hb_MailAssemble( cFrom, xTo, xCC, cBody, cSubject, ; LOCAL cFext LOCAL cData - IF ! HB_ISARRAY( aFiles ) - aFiles := {} - ENDIF - IF ! HB_ISNUMERIC( nPriority ) - nPriority := 3 - ENDIF - IF ! HB_ISLOGICAL( lRead ) - lRead := .F. - ENDIF - IF ! HB_ISSTRING( cReplyTo ) - cReplyTo := "" - ENDIF - IF ! HB_ISSTRING( cCharset ) - cCharset := "ISO-8859-1" - ENDIF - IF ! HB_ISSTRING( cEncoding ) - cEncoding := "quoted-printable" - ENDIF + hb_default( @aFiles, {} ) + hb_default( @nPriority, 3 ) + hb_default( @lRead, .F. ) + hb_default( @cReplyTo, "" ) + hb_default( @cCharset, "ISO-8859-1" ) + hb_default( @cEncoding, "quoted-printable" ) IF !( ( ".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. hb_FileExists( cBody ) ) IF !( Right( cBody, 2 ) == Chr( 13 ) + Chr( 10 ) ) @@ -421,9 +399,7 @@ FUNCTION hb_MailAssemble( cFrom, xTo, xCC, cBody, cSubject, ; cFile := aThisFile[ 1 ] IF HB_ISSTRING( aThisFile[ 2 ] ) cData := aThisFile[ 2 ] - IF ! HB_ISSTRING( cFile ) - cFile := "unnamed" - ENDIF + hb_default( @cFile, "unnamed" ) ELSE IF ! HB_ISSTRING( cFile ) LOOP /* No filename and no content. */ diff --git a/harbour/contrib/hbtip/smtpcli.prg b/harbour/contrib/hbtip/smtpcli.prg index 62c20af8a9..6dabc7611f 100644 --- a/harbour/contrib/hbtip/smtpcli.prg +++ b/harbour/contrib/hbtip/smtpcli.prg @@ -107,9 +107,7 @@ METHOD Open( cUrl, lTLS ) CLASS TIPClientSMTP RETURN .F. ENDIF - IF ! HB_ISLOGICAL( lTLS ) - lTLS := .F. - ENDIF + hb_default( @lTLS, .F. ) IF lTLS ::inetSendAll( ::SocketCon, "STARTTLS" + ::cCRLF ) @@ -132,9 +130,7 @@ METHOD OpenSecure( cUrl, lTLS ) CLASS TIPClientSMTP RETURN .F. ENDIF - IF ! HB_ISLOGICAL( lTLS ) - lTLS := .F. - ENDIF + hb_default( @lTLS, .F. ) IF lTLS ::inetSendAll( ::SocketCon, "STARTTLS" + ::cCRLF ) diff --git a/harbour/contrib/hbtip/thtml.prg b/harbour/contrib/hbtip/thtml.prg index 6d004cce16..f5d06ff3b2 100644 --- a/harbour/contrib/hbtip/thtml.prg +++ b/harbour/contrib/hbtip/thtml.prg @@ -1017,9 +1017,7 @@ METHOD Delete() CLASS THtmlNode METHOD firstNode( lRoot ) CLASS THtmlNode - IF ! HB_ISLOGICAL( lRoot ) - lRoot := .F. - ENDIF + hb_default( @lRoot, .F. ) IF lRoot RETURN ::root:htmlContent[ 1 ] @@ -1035,9 +1033,7 @@ METHOD lastNode( lRoot ) CLASS THtmlNode LOCAL aNodes - IF ! HB_ISLOGICAL( lRoot ) - lRoot := .F. - ENDIF + hb_default( @lRoot, .F. ) IF ::htmlTagName == "_text_" RETURN ::parent:lastNode( lRoot ) @@ -1228,9 +1224,7 @@ METHOD getText( cEOL ) CLASS THtmlNode LOCAL cText := "" LOCAL oNode - IF ! HB_ISSTRING( cEOL ) - cEOL := hb_eol() - ENDIF + hb_default( @cEOL, hb_eol() ) IF ::htmlTagName == "_text_" RETURN RTrim( ::htmlContent ) + cEOL diff --git a/harbour/contrib/hbwin/wce_sim.prg b/harbour/contrib/hbwin/wce_sim.prg index c2b411970c..a64b0e3a2c 100644 --- a/harbour/contrib/hbwin/wce_sim.prg +++ b/harbour/contrib/hbwin/wce_sim.prg @@ -111,9 +111,7 @@ METHOD lNumberOfPhoneBookEntries( nType, /* @ */ nTotal, /* @ */ nUsed ) CLASS w RETURN .F. ENDIF - IF ! HB_ISNUMERIC( nType ) - nType := SIM_PBSTORAGE_SIM - ENDIF + hb_default( @nType, SIM_PBSTORAGE_SIM ) nResult := wce_SimPhonebookStatus( ::hSim, nType, @nTotal, @nUsed ) ::nLastError := nResult @@ -134,12 +132,8 @@ METHOD aGetAllPhoneBookEntries( nType ) CLASS wce_Sim RETURN .F. ENDIF - IF ! HB_ISNUMERIC( nType ) - nType := SIM_PBSTORAGE_SIM - ENDIF - IF ! HB_ISARRAY( aEntries ) - aEntries := {} - ENDIF + hb_default( @nType, SIM_PBSTORAGE_SIM ) + hb_default( @aEntries, {} ) IF ! ::lNumberOfPhoneBookEntries( nType, @nTotal, @nUsed ) RETURN {} @@ -170,9 +164,7 @@ METHOD lGetSimPhoneEntry( nPos, nType, /* @ */ aEntry ) CLASS wce_Sim RETURN .F. ENDIF - IF ! HB_ISNUMERIC( nType ) - nType := SIM_PBSTORAGE_SIM - ENDIF + hb_default( @nType, SIM_PBSTORAGE_SIM ) nResult := wce_SimReadPhonebookEntry( ::hSim, nType, nPos, @a ) @@ -190,12 +182,8 @@ METHOD lSetSimPhoneEntry( nPos, nType, cNumber, cName, nPlan, nAddrType ) CLASS RETURN .F. ENDIF - IF ! HB_ISNUMERIC( nType ) - nPos := SIM_PBINDEX_FIRSTAVAILABLE - ENDIF - IF ! HB_ISNUMERIC( nType ) - nType := SIM_PBSTORAGE_SIM - ENDIF + hb_default( @nPos, SIM_PBINDEX_FIRSTAVAILABLE ) + hb_default( @nType, SIM_PBSTORAGE_SIM ) nResult := wce_SimWritePhonebookEntry( ::hSim, nType, nPos, cNumber, cName, nPlan, nAddrType ) ::nLastError := nResult @@ -211,9 +199,7 @@ METHOD lDelSimPhoneEntry( nPos, nType ) CLASS wce_Sim RETURN .F. ENDIF - IF ! HB_ISNUMERIC( nType ) - nType := SIM_PBSTORAGE_SIM - ENDIF + hb_default( @nType, SIM_PBSTORAGE_SIM ) nResult := wce_SimDeletePhonebookEntry( ::hSim, nType, nPos ) ::nLastError := nResult diff --git a/harbour/contrib/hbwin/win_os.prg b/harbour/contrib/hbwin/win_os.prg index ba11f1fa63..e112e0059b 100644 --- a/harbour/contrib/hbwin/win_os.prg +++ b/harbour/contrib/hbwin/win_os.prg @@ -72,12 +72,8 @@ FUNCTION win_osNetRegOk( lSetIt, lDoVista ) LOCAL cKeySrv LOCAL cKeyWks - IF ! HB_ISLOGICAL( lSetIt ) - lSetIt := .F. - ENDIF - IF ! HB_ISLOGICAL( lDoVista ) - lDoVista := .T. - ENDIF + hb_default( @lSetIt, .F. ) + hb_default( @lDoVista, .T. ) IF ! lDoVista .AND. hb_osIsWinVista() /* do nothing */ diff --git a/harbour/contrib/hbwin/win_reg.prg b/harbour/contrib/hbwin/win_reg.prg index 951ee6b151..0444b5a0c0 100644 --- a/harbour/contrib/hbwin/win_reg.prg +++ b/harbour/contrib/hbwin/win_reg.prg @@ -131,9 +131,7 @@ FUNCTION win_regDelete( cRegPath, nRegSam ) IF Empty( cEntry ) lRetVal := win_regDeleteKey( nHKEY, cKey ) ELSE - IF ! HB_ISNUMERIC( nRegSam ) - nRegSam := 0 - ENDIF + hb_default( @nRegSam, 0 ) IF win_regOpenKeyEx( nHKEY, cKey, 0, hb_bitOr( KEY_SET_VALUE, nRegSam ), @pKeyHandle ) lRetVal := win_regDeleteValue( pKeyHandle, cEntry ) @@ -152,9 +150,7 @@ FUNCTION win_regQuery( nHKEY, cKeyName, cEntryName, xValue, lSetIt, nRegSam ) LOCAL cValType := ValType( xValue ) LOCAL lRetVal - IF ! HB_ISLOGICAL( lSetIt ) - lSetIt := .F. - ENDIF + hb_default( @lSetIt, .F. ) IF cValType == "L" xValue := iif( xValue, 1, 0 ) @@ -183,9 +179,7 @@ FUNCTION win_regGet( nHKEY, cKeyName, cEntryName, xDefault, nRegSam ) LOCAL pKeyHandle LOCAL nValueType - IF ! HB_ISNUMERIC( nRegSam ) - nRegSam := 0 - ENDIF + hb_default( @nRegSam, 0 ) IF win_regOpenKeyEx( nHKEY, cKeyName, 0, hb_bitOr( KEY_QUERY_VALUE, nRegSam ), @pKeyHandle ) @@ -227,9 +221,7 @@ FUNCTION win_regSet( nHKEY, cKeyName, cEntryName, xValue, nValueType, nRegSam ) LOCAL lRetVal := .F. LOCAL pKeyHandle - IF ! HB_ISNUMERIC( nRegSam ) - nRegSam := 0 - ENDIF + hb_default( @nRegSam, 0 ) IF win_regCreateKeyEx( nHKEY, cKeyName, 0, 0, 0, hb_bitOr( KEY_SET_VALUE, nRegSam ), 0, @pKeyHandle ) diff --git a/harbour/contrib/hbwin/win_tprn.prg b/harbour/contrib/hbwin/win_tprn.prg index f171f62013..cf628e2425 100644 --- a/harbour/contrib/hbwin/win_tprn.prg +++ b/harbour/contrib/hbwin/win_tprn.prg @@ -329,9 +329,7 @@ METHOD StartDoc( cDocName ) CLASS win_Prn METHOD EndDoc( lAbortDoc ) CLASS win_Prn IF ::HavePrinted - IF ! HB_ISLOGICAL( lAbortDoc ) - lAbortDoc := .F. - ENDIF + hb_default( @lAbortDoc, .F. ) ELSE lAbortDoc := .T. ENDIF @@ -416,9 +414,7 @@ METHOD CheckPage() CLASS win_Prn METHOD EndPage( lStartNewPage ) CLASS win_Prn - IF ! HB_ISLOGICAL( lStartNewPage ) - lStartNewPage := .T. - ENDIF + hb_default( @lStartNewPage, .T. ) win_EndPage( ::hPrinterDC ) IF lStartNewPage @@ -444,9 +440,7 @@ METHOD NewLine() CLASS win_Prn METHOD NewPage( lDelay ) CLASS win_Prn - IF ! HB_ISLOGICAL( lDelay ) - lDelay := .F. - ENDIF + hb_default( @lDelay, .F. ) IF ::Printing IF lDelay @@ -650,15 +644,9 @@ METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlign ) CLASS win_Prn IF cString != NIL .AND. ::CheckPage() - IF ! HB_ISLOGICAL( lNewLine ) - lNewLine := .F. - ENDIF - IF ! HB_ISLOGICAL( lUpdatePosX ) - lUpdatePosX := .T. - ENDIF - IF ! HB_ISNUMERIC( nAlign ) - nAlign := hb_bitOr( WIN_TA_BOTTOM, WIN_TA_LEFT ) - ENDIF + hb_default( @lNewLine, .F. ) + hb_default( @lUpdatePosX, .T. ) + hb_default( @nAlign, hb_bitOr( WIN_TA_BOTTOM, WIN_TA_LEFT ) ) nPosX := win_TextOut( ::hPrinterDC, ::PosX, ::PosY, cString, Len( cString ), ::fCharWidth, nAlign ) diff --git a/harbour/contrib/hbxpp/dbfuncsx.prg b/harbour/contrib/hbxpp/dbfuncsx.prg index 90674f7522..3806139c7e 100644 --- a/harbour/contrib/hbxpp/dbfuncsx.prg +++ b/harbour/contrib/hbxpp/dbfuncsx.prg @@ -71,9 +71,8 @@ FUNCTION xpp_dbUseArea( lNewArea, cDriver, cName, xcAlias, lShared, lReadonly ) LOCAL nArea IF HB_ISLOGICAL( lNewArea ) .AND. lNewArea - IF ! HB_ISSTRING( xcAlias ) - xcAlias := "" - ENDIF + + hb_default( @xcAlias, "" ) IF Empty( xcAlias ) xcAlias := cName diff --git a/harbour/contrib/xhb/dirrec.prg b/harbour/contrib/xhb/dirrec.prg index e01b959b04..adcf8f26a8 100644 --- a/harbour/contrib/xhb/dirrec.prg +++ b/harbour/contrib/xhb/dirrec.prg @@ -79,9 +79,7 @@ FUNCTION DirectoryRecurse( cPath, cAttr ) hb_FNameSplit( cPath, @cFilePath, @cMask, @cExt ) cMask += cExt - IF ! HB_ISSTRING( cAttr ) - cAttr := "" - ENDIF + hb_default( @cAttr, "" ) /* The trick with StrTran() below if for strict xHarbour * compatibility though it should be reverted when it will * be fixed in xHarbour diff --git a/harbour/contrib/xhb/dumpvar.prg b/harbour/contrib/xhb/dumpvar.prg index 68124b9642..ee687516d3 100644 --- a/harbour/contrib/xhb/dumpvar.prg +++ b/harbour/contrib/xhb/dumpvar.prg @@ -381,13 +381,8 @@ STATIC FUNCTION __objGetMsgFullList( oObject, lData, nRange, nScope, nNoScope ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName() ) ENDIF - IF ! HB_ISLOGICAL( lData ) - lData := .T. - ENDIF - - IF ! HB_ISNUMERIC( nNoScope ) - nNoScope := 0 - ENDIF + hb_default( @lData, .T. ) + hb_default( @nNoScope, 0 ) // nRange is already defaulted in ClassFullSel in classes.c @@ -427,9 +422,7 @@ STATIC FUNCTION __objGetValueFullList( oObject, aExcept, nScope, nNoScope ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) ENDIF - IF ! HB_ISARRAY( aExcept ) - aExcept := {} - ENDIF + hb_default( @aExcept, {} ) aVars := __objGetMsgFullList( oObject, .T., HB_MSGLISTALL, nScope, nNoScope ) aReturn := {} diff --git a/harbour/contrib/xhb/hbcomprs.prg b/harbour/contrib/xhb/hbcomprs.prg index 0d5a00a762..13b0c3a5c4 100644 --- a/harbour/contrib/xhb/hbcomprs.prg +++ b/harbour/contrib/xhb/hbcomprs.prg @@ -111,15 +111,11 @@ FUNCTION hb_Compress( xPar1, xPar2, xPar3, xPar4, xPar5 ) IF lReturnByRef IF HB_ISNUMERIC( xPar1 ) xPar4 := hb_ZCompress( cSource, nDestLen, @t_nLastError, nComprFactor ) - IF ! HB_ISSTRING( xPar4 ) - xPar4 := "" - ENDIF + hb_default( @xPar4, "" ) xPar5 := Len( xPar4 ) ELSE xPar3 := hb_ZCompress( cSource, nDestLen, @t_nLastError, nComprFactor ) - IF ! HB_ISSTRING( xPar3 ) - xPar3 := "" - ENDIF + hb_default( @xPar3, "" ) xPar4 := Len( xPar3 ) ENDIF RETURN t_nLastError @@ -180,9 +176,7 @@ FUNCTION hb_CompressBufLen( nSrcLen ) LOCAL nRet - IF ! HB_ISNUMERIC( nSrcLen ) - nSrcLen := 0 - ENDIF + hb_default( @nSrcLen, 0 ) nRet := nSrcLen diff --git a/harbour/contrib/xhb/hjwindow.prg b/harbour/contrib/xhb/hjwindow.prg index 27cd0d34c5..1bc7127c1a 100644 --- a/harbour/contrib/xhb/hjwindow.prg +++ b/harbour/contrib/xhb/hjwindow.prg @@ -300,9 +300,7 @@ METHOD Put() CLASS TJSWindow ::setFeatures() ENDIF - IF ! HB_ISSTRING( ::name ) - ::name := "newWin" - ENDIF + hb_default( @::name, "newWin" ) cStr += ::varName + " = window.open('" + ; ::URL + "', '" + ; diff --git a/harbour/contrib/xhb/htmutil.prg b/harbour/contrib/xhb/htmutil.prg index d0ba443282..26f5add80d 100644 --- a/harbour/contrib/xhb/htmutil.prg +++ b/harbour/contrib/xhb/htmutil.prg @@ -563,9 +563,7 @@ METHOD Put() CLASS JWindow ::setFeatures() ENDIF - IF ! HB_ISSTRING( ::name ) - ::name := "newWin" - ENDIF + hb_default( @::name, "newWin" ) cStr += ::varName + " = window.open('" + ; ::URL + "', '" + ; diff --git a/harbour/contrib/xhb/sprintf.prg b/harbour/contrib/xhb/sprintf.prg index a4d545182e..214119635c 100644 --- a/harbour/contrib/xhb/sprintf.prg +++ b/harbour/contrib/xhb/sprintf.prg @@ -149,9 +149,7 @@ FUNCTION sprintf( ... ) CASE "f" CASE "i" xVal := aPar[ nPar++ ] - IF ! HB_ISNUMERIC( xVal ) - xVal := 0 - ENDIF + hb_default( @xVal, 0 ) IF nLen != 0 IF nLen - Int( nLen ) > 0.0 nDec := Str( nLen ) diff --git a/harbour/contrib/xhb/tedit.prg b/harbour/contrib/xhb/tedit.prg index f9907e36a7..0f60a22bc5 100644 --- a/harbour/contrib/xhb/tedit.prg +++ b/harbour/contrib/xhb/tedit.prg @@ -543,23 +543,12 @@ METHOD New( cName, cAction, cMethod, lFrame, cCaption, nWidth ) CLASS THtmlForm METHOD Put( lPutControls ) CLASS THtmlForm - __defaultNIL( @lPutControls, .F. ) + hb_default( @lPutControls, .F. ) - IF ! HB_ISNUMERIC( ::width ) - ::width := 90 - ENDIF - - IF ! HB_ISSTRING( ::color ) - ::Color := "#9196A0" - ENDIF - - IF ! HB_ISSTRING( ::fontColor ) - ::fontColor := "black" - ENDIF - - IF ! HB_ISSTRING( ::CaptionColor ) - ::CaptionColor := "black" - ENDIF + hb_default( @::width, 90 ) + hb_default( @::Color, "#9196A0" ) + hb_default( @::fontColor, "black" ) + hb_default( @::CaptionColor, "black" ) IF ::Frame ::cOutPut := CRLF() + CRLF() + CRLF() + "" + CRLF() + CRLF() diff --git a/harbour/extras/gtwvw/tests/drawimg.prg b/harbour/extras/gtwvw/tests/drawimg.prg index 055bd43621..529a48063e 100644 --- a/harbour/extras/gtwvw/tests/drawimg.prg +++ b/harbour/extras/gtwvw/tests/drawimg.prg @@ -210,10 +210,6 @@ METHOD New( nWinNum, nType, cId, nRow1, nCol1, nRow2, nCol2, aOffTLBR, lTransp ) ::nRow2 := nRow2 ::nCol2 := nCol2 - IF ! HB_ISARRAY( aOffTLBR ) - aOffTLBR := { 0, 0, 0, 0 } - ENDIF - ::aOffTLBR := AClone( aOffTLBR ) ::lTransp := lTransp diff --git a/harbour/extras/gtwvw/tests/ebtest7.prg b/harbour/extras/gtwvw/tests/ebtest7.prg index 0ee1a1aa93..1af9085a08 100644 --- a/harbour/extras/gtwvw/tests/ebtest7.prg +++ b/harbour/extras/gtwvw/tests/ebtest7.prg @@ -244,17 +244,13 @@ FUNCTION AddEBGet( aEBGets, mnrow, mncol, mxValue, mcVarName, mbAssign, mcLabel, RETURN .F. ENDCASE - IF ! HB_ISARRAY( aEBGets ) - aEBGEts := {} - ENDIF + hb_default( @aEBGEts, {} ) IF ! HB_ISLOGICAL( mlMultiline ) .OR. ; ! HB_ISSTRING( mxValue ) mlMultiline := .F. ENDIF - IF ! HB_ISSTRING( mcLabel ) - mcLabel := mcVarName + ":" - ENDIF + hb_default( @mcLabel, mcVarName + ":" ) AAdd( aEBGets, { ; mlMultiline, ; // __GET_LMULTILINE diff --git a/harbour/extras/rddado/adordd.prg b/harbour/extras/rddado/adordd.prg index c2e0b28ca3..47d21ff42e 100644 --- a/harbour/extras/rddado/adordd.prg +++ b/harbour/extras/rddado/adordd.prg @@ -1542,9 +1542,7 @@ PROCEDURE HB_AdoSetPassword( cPassword ) PROCEDURE HB_AdoSetQuery( cQuery ) - IF ! HB_ISSTRING( cQuery ) - cQuery := "SELECT * FROM " - ENDIF + hb_default( @cQuery, "SELECT * FROM " ) t_cQuery := cQuery