diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f2093dada7..b3294ba76c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,29 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-05-25 15:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/tobject.prg + * src/rtl/tpersist.prg + * src/rtl/memoedit.prg + * src/rtl/teditor.prg + * contrib/hbmysql/tmysql.prg + * contrib/hbmysql/tsqlbrw.prg + * contrib/hbodbc/todbc.prg + * contrib/hbfbird/tfirebrd.prg + * contrib/hbpgsql/tpostgre.prg + * contrib/hbmisc/hbedit.prg + * contrib/hbtip/smtpcli.prg + * contrib/hbtip/mail.prg + * contrib/hbwin/win_reg.prg + * contrib/hbwin/win_os.prg + * contrib/hbwin/win_tprn.prg + * contrib/hbwin/wce_sim.prg + ! Fixed to check for proper type instead of using + 'DEFAULT ... TO' + + * contrib/hbct/ct.prg + % EXIT/INIT FUNCTION -> EXIT/INIT PROCEDURE + 2010-05-25 13:31 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added experimental feature to aid external dependency diff --git a/harbour/contrib/hbct/ct.prg b/harbour/contrib/hbct/ct.prg index 6131654249..4c3ce4c777 100644 --- a/harbour/contrib/hbct/ct.prg +++ b/harbour/contrib/hbct/ct.prg @@ -96,13 +96,13 @@ FUNCTION CTINIT() RETURN s_bInitialized -INIT FUNCTION _CTINIT() +INIT PROCEDURE _CTINIT() IF ! s_bInitialized s_bInitialized := ctcinit() ENDIF - RETURN s_bInitialized + RETURN /* $DOC$ @@ -147,11 +147,11 @@ FUNCTION CTEXIT() RETURN NIL -EXIT FUNCTION _CTEXIT() +EXIT PROCEDURE _CTEXIT() IF s_bInitialized ctcexit() s_bInitialized := .F. ENDIF - RETURN NIL + RETURN diff --git a/harbour/contrib/hbfbird/tfirebrd.prg b/harbour/contrib/hbfbird/tfirebrd.prg index 906b47fc64..3677a72534 100644 --- a/harbour/contrib/hbfbird/tfirebrd.prg +++ b/harbour/contrib/hbfbird/tfirebrd.prg @@ -106,7 +106,9 @@ ENDCLASS METHOD New( cServer, cUser, cPassword, nDialect ) CLASS TFbServer - Default nDialect TO 1 + IF ! ISNUMBER( nDialect ) + nDialect := 1 + ENDIF ::lError := .F. ::nError := 0 diff --git a/harbour/contrib/hbmisc/hbedit.prg b/harbour/contrib/hbmisc/hbedit.prg index b39abad8bc..54bda7d3e5 100644 --- a/harbour/contrib/hbmisc/hbedit.prg +++ b/harbour/contrib/hbmisc/hbedit.prg @@ -63,7 +63,9 @@ FUNCTION EditorNew( nTop, nLeft, nBottom, nRight, nLength, ; cFrame, cTitle, cColor, nSize, nEscape ) LOCAL pEdit, oEdit - DEFAULT nLength TO 80 + IF ! ISNUMBER( nLength ) + nLength := 80 + ENDIF pEdit := ED_New( nLength, 4, IIFNIL(s_nESize, nSize), nEscape ) IF ! Empty( pEdit ) @@ -188,7 +190,9 @@ PROCEDURE EditorInsText( oEdit, cText, nLine ) // FUNCTION EditorGetText( oEdit, nCarret ) - DEFAULT nCarret TO EDIT_HARD + IF ! ISNUMBER( nCarret ) + nCarret := EDIT_HARD + ENDIF RETURN ED_GetText( oEdit[E_EDIT], nCarret ) @@ -245,7 +249,9 @@ FUNCTION EditorFile( xInput, cOutput, nLineLen, ; LOCAL nHandle, nLen, oEdit, lSaved, lClose := .F. LOCAL nSize - DEFAULT lSave TO .T. + IF ! ISLOGICAL( lSave ) + lSave := .T. + ENDIF IF ISCHARACTER(xInput) nHandle := FOPEN( xInput ) diff --git a/harbour/contrib/hbmysql/tmysql.prg b/harbour/contrib/hbmysql/tmysql.prg index 9d9ca5303a..45e83ceaf6 100644 --- a/harbour/contrib/hbmysql/tmysql.prg +++ b/harbour/contrib/hbmysql/tmysql.prg @@ -90,8 +90,12 @@ ENDCLASS METHOD New( aRow, aFStruct, cTableName ) CLASS TMySQLRow - DEFAULT cTableName TO "" - DEFAULT aFStruct TO {} + IF ! ISCHARACTER( cTableName ) + cTableName := "" + ENDIF + IF ! ISARRAY( aFStruct ) + aFStruct := {} + ENDIF ::aRow := aRow //DAVID: @@ -177,7 +181,9 @@ METHOD FieldLen( nNum ) CLASS TMySQLRow */ METHOD FieldDec( nNum, lFormat ) CLASS TMySQLRow - DEFAULT lFormat TO .F. + IF ! ISLOGICAL( lFormat ) + lFormat := .F. + ENDIF IF nNum >= 1 .AND. nNum <= Len( ::aFieldStruct ) @@ -412,10 +418,12 @@ METHOD Skip( nRows ) CLASS TMySQLQuery LOCAL lbof // NOTE: MySQL row count starts from 0 - DEFAULT nRows TO 1 + IF ! ISNUMBER( nRows ) + nRows := 1 + ENDIF //DAVID: - ::lBof := ( Empty( ::LastRec() ) ) + ::lBof := Empty( ::LastRec() ) IF nRows == 0 // No move @@ -469,8 +477,10 @@ METHOD GetRow( nRow ) CLASS TMySQLQuery LOCAL oRow := NIL LOCAL i - //DAVID: use current row DEFAULT nRow TO 0 - DEFAULT nRow TO ::nCurRow + //DAVID: use current row DEFAULT nRow TO 0 + IF ! ISNUMBER( nRow ) + nRow := ::nCurRow + ENDIF IF ::nResultHandle != NIL @@ -681,7 +691,9 @@ METHOD FieldLen( nNum ) CLASS TMySQLQuery */ METHOD FieldDec( nNum, lFormat ) CLASS TMySQLQuery - DEFAULT lFormat TO .F. + IF ! ISLOGICAL( lFormat ) + lFormat := .F. + ENDIF IF nNum >=1 .AND. nNum <= Len( ::aFieldStruct ) IF !lFormat .AND. ( ::aFieldStruct[ nNum ][ MYSQL_FS_TYPE ] == MYSQL_TYPE_FLOAT .OR. ; @@ -818,9 +830,14 @@ METHOD Update( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable LOCAL i //DAVID: LOCAL ni, cWhere := " WHERE " - DEFAULT lOldRecord TO .F. + + IF ! ISLOGICAL( lOldRecord ) + lOldRecord := .F. + ENDIF //DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter - DEFAULT lRefresh TO .T. + IF ! ISLOGICAL( lRefresh ) + lRefresh := .T. + ENDIF ::lError := .F. @@ -936,9 +953,14 @@ METHOD Delete( oRow, lOldRecord, lRefresh ) CLASS TMySQLTable //DAVID: LOCAL ni, cWhere := " WHERE " - DEFAULT lOldRecord TO .F. + + IF ! ISLOGICAL( lOldRecord ) + lOldRecord := .F. + ENDIF //DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter - DEFAULT lRefresh TO .T. + IF ! ISLOGICAL( lRefresh ) + lRefresh := .T. + ENDIF // is this a row of this table ? IF oRow == NIL @@ -1030,7 +1052,9 @@ METHOD Append( oRow, lRefresh ) CLASS TMySQLTable LOCAL i //DAVID: too many ::refresh() can slow some processes, so we can desactivate it by parameter - DEFAULT lRefresh TO .T. + IF ! ISLOGICAL( lRefresh ) + lRefresh := .T. + ENDIF IF oRow == NIL // default Current row @@ -1136,7 +1160,9 @@ METHOD GetBlankRow( lSetValues ) CLASS TMySQLTable LOCAL aRow := Array( ::nNumFields ) //DAVID: It is not current row, so do not change it - DEFAULT lSetValues TO .F. + IF ! ISLOGICAL( lSetValues ) + lSetValues := .F. + ENDIF // crate an array of empty fields FOR i := 1 TO ::nNumFields @@ -1488,7 +1514,9 @@ METHOD CreateIndex( cName, cTable, aFNames, lUnique ) CLASS TMySQLServer LOCAL cCreateQuery := "CREATE " LOCAL i - DEFAULT lUnique TO .F. + IF ! ISLOGICAL( lUnique ) + lUnique := .F. + ENDIF IF lUnique cCreateQuery += "UNIQUE INDEX " @@ -1538,8 +1566,9 @@ METHOD Query( cQuery ) CLASS TMySQLServer LOCAL oQuery, cTableName, i, cUpperQuery, nNumTables, cToken - DEFAULT cQuery TO "" - + IF ! ISCHARACTER( cQuery ) + cQuery := "" + ENDIF cUpperQuery := Upper( AllTrim( cQuery ) ) i := 1 diff --git a/harbour/contrib/hbmysql/tsqlbrw.prg b/harbour/contrib/hbmysql/tsqlbrw.prg index 8ccd5ed491..5843337ad4 100644 --- a/harbour/contrib/hbmysql/tsqlbrw.prg +++ b/harbour/contrib/hbmysql/tsqlbrw.prg @@ -328,9 +328,15 @@ METHOD BrowseTable( lCanEdit, aExitKeys ) CLASS TBrowseSQL LOCAL nKey LOCAL lKeepGoing := .T. - DEFAULT nKey TO NIL - DEFAULT lCanEdit TO .F. - DEFAULT aExitKeys TO { K_ESC } + IF ! ISNUMBER( nKey ) + nKey := NIL + ENDIF + IF ! ISLOGICAL( lCanEdit ) + lCanEdit := .F. + ENDIF + IF ! ISARRAY( aExitKeys ) + aExitKeys := { K_ESC } + ENDIF DO WHILE lKeepGoing diff --git a/harbour/contrib/hbodbc/todbc.prg b/harbour/contrib/hbodbc/todbc.prg index c62be3eee1..88c399bddc 100644 --- a/harbour/contrib/hbodbc/todbc.prg +++ b/harbour/contrib/hbodbc/todbc.prg @@ -179,11 +179,15 @@ METHOD New( cODBCStr, cUserName, cPassword, lCache ) CLASS TODBC LOCAL xBuf LOCAL nRet - IF cUserName != NIL - DEFAULT cPassword TO "" + IF ISCHARACTER( cUserName ) + IF ! ISCHARACTER( cPassword ) + cPassword := "" + ENDIF ENDIF - DEFAULT lCache TO .T. + IF ! ISLOGICAL( lCache ) + lCache := .T. + ENDIF ::cODBCStr := cODBCStr ::lCacheRS := lCache @@ -199,13 +203,13 @@ METHOD New( cODBCStr, cUserName, cPassword, lCache ) CLASS TODBC SQLAllocConnect( ::hEnv, @xBuf ) // Allocates SQL Connection ::hDbc := xBuf - IF cUserName == NIL - SQLDriverConnect( ::hDbc, ::cODBCStr, @xBuf ) // Connects to Driver - ::cODBCRes := xBuf - ELSE + IF ISCHARACTER( cUserName ) IF ! ( ( nRet := SQLConnect( ::hDbc, cODBCStr, cUserName, cPassword ) ) == SQL_SUCCESS .OR. nRet == SQL_SUCCESS_WITH_INFO ) // TODO: Some error here ENDIF + ELSE + SQLDriverConnect( ::hDbc, ::cODBCStr, @xBuf ) // Connects to Driver + ::cODBCRes := xBuf ENDIF RETURN Self @@ -216,7 +220,9 @@ METHOD SetAutocommit( lEnable ) CLASS TODBC LOCAL lOld := ::lAutoCommit - DEFAULT lEnable TO .T. + IF ! ISLOGICAL( lEnable ) + lEnable := .T. + ENDIF 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 4e27854ff0..c99a512370 100644 --- a/harbour/contrib/hbpgsql/tpostgre.prg +++ b/harbour/contrib/hbpgsql/tpostgre.prg @@ -104,7 +104,9 @@ ENDCLASS METHOD New( cHost, cDatabase, cUser, cPass, nPort, Schema ) CLASS TPQserver LOCAL res - DEFAULT nPort TO 5432 + IF ! ISNUMBER( nPort ) + nPort := 5432 + ENDIF ::pDB := PQconnect( cDatabase, cHost, cUser, cPass, nPort ) @@ -552,8 +554,12 @@ METHOD Refresh( lQuery, lMeta ) CLASS TPQquery LOCAL i LOCAL cType, nDec, nSize - DEFAULT lQuery TO .T. - DEFAULT lMeta TO .T. + IF ! ISLOGICAL( lQuery ) + lQuery := .T. + ENDIF + IF ! ISLOGICAL( lMeta ) + lMeta := .T. + ENDIF ::Destroy() @@ -722,7 +728,9 @@ METHOD Read() CLASS TPQquery METHOD Skip( nrecno ) CLASS TPQquery - DEFAULT nRecno TO 1 + IF ! ISNUMBER( nRecno ) + nRecno := 1 + ENDIF IF ::nRecno + nRecno > 0 .AND. ::nRecno + nRecno <= ::nLastrec ::nRecno := ::nRecno + nRecno @@ -990,7 +998,9 @@ METHOD FieldGet( nField, nRow ) CLASS TPQquery IF nField > 0 .AND. ::nResultStatus == PGRES_TUPLES_OK - DEFAULT nRow TO ::nRecno + IF ! ISNUMBER( nRow ) + nRow := ::nRecno + ENDIF result := PQgetvalue( ::pQuery, nRow, nField ) @@ -1038,7 +1048,9 @@ METHOD Getrow( nRow ) CLASS TPQquery LOCAL aOld LOCAL nCol - DEFAULT nRow TO ::nRecno + IF ! ISNUMBER( nRow ) + nRow := ::nRecno + ENDIF IF ::nResultStatus == PGRES_TUPLES_OK diff --git a/harbour/contrib/hbtip/mail.prg b/harbour/contrib/hbtip/mail.prg index 36199a8d1d..8f6d7a8a7d 100644 --- a/harbour/contrib/hbtip/mail.prg +++ b/harbour/contrib/hbtip/mail.prg @@ -386,7 +386,9 @@ METHOD FromString( cMail, cBoundary, nPos ) CLASS TipMail ENDIF // Part 1: parsing header - DEFAULT nPos TO 1 + IF ! ISNUMBER( nPos ) + nPos := 1 + ENDIF nLinePos := hb_At( e"\r\n", cMail, nPos ) DO WHILE nLinePos > nPos @@ -550,7 +552,7 @@ METHOD setHeader( cSubject, cFrom, xTo, xCC, xBCC ) CLASS TipMail IF ! ::setFieldPart( "Subject", WordEncodeQ( cSubject, ::cCharset ) ) RETURN .F. ENDIF - + IF ! ::setFieldPart( "From", LTrim( WordEncodeQ( tip_GetNameEMail( AllTrim( cFrom ) ), ::cCharset ) + " <" + tip_GetRawEMail( AllTrim( cFrom ) ) + ">" ) ) RETURN .F. ENDIF @@ -661,7 +663,9 @@ METHOD getMultiParts( aParts ) CLASS TipMail ::resetAttachment() - DEFAULT aParts TO {} + IF ! ISARRAY( aParts ) + aParts := {} + ENDIF DO WHILE ( oSubPart := ::nextAttachment() ) != NIL lReset := .T. diff --git a/harbour/contrib/hbtip/smtpcli.prg b/harbour/contrib/hbtip/smtpcli.prg index f1eb48bcee..9b604f0fe5 100644 --- a/harbour/contrib/hbtip/smtpcli.prg +++ b/harbour/contrib/hbtip/smtpcli.prg @@ -114,7 +114,9 @@ METHOD Open( cUrl, lTLS ) CLASS tIPClientSMTP RETURN .F. ENDIF - DEFAULT lTLS TO .F. + IF ! ISLOGICAL( lTLS ) + lTLS := .F. + ENDIF IF lTLS ::InetSendall( ::SocketCon, "STARTTLS" + ::cCRLF ) @@ -137,7 +139,9 @@ METHOD OpenSecure( cUrl, lTLS ) CLASS tIPClientSMTP RETURN .F. ENDIF - DEFAULT lTLS TO .F. + IF ! ISLOGICAL( lTLS ) + lTLS := .F. + ENDIF IF lTLS ::InetSendall( ::SocketCon, "STARTTLS" + ::cCRLF ) diff --git a/harbour/contrib/hbwin/wce_sim.prg b/harbour/contrib/hbwin/wce_sim.prg index 7b0fd19b3e..67563e3b75 100644 --- a/harbour/contrib/hbwin/wce_sim.prg +++ b/harbour/contrib/hbwin/wce_sim.prg @@ -115,7 +115,9 @@ METHOD lNumberOfPhoneBookEntries( nType, /* @ */ nTotal, /* @ */ nUsed ) CLASS w RETURN .F. ENDIF - DEFAULT nType TO SIM_PBSTORAGE_SIM + IF ! ISNUMBER( nType ) + nType := SIM_PBSTORAGE_SIM + ENDIF nResult := wce_SimPhoneBookStatus( ::hSim, nType, @nTotal, @nUsed ) ::nLastError := nResult @@ -136,8 +138,12 @@ METHOD aGetAllPhoneBookEntries( nType ) CLASS wce_sim RETURN .F. ENDIF - DEFAULT nType TO SIM_PBSTORAGE_SIM - DEFAULT aEntries TO {} + IF ! ISNUMBER( nType ) + nType := SIM_PBSTORAGE_SIM + ENDIF + IF ! ISARRAY( aEntries ) + aEntries := {} + ENDIF IF ! ::lNumberOfPhoneBookEntries( nType, @nTotal, @nUsed ) RETURN {} @@ -168,7 +174,9 @@ METHOD lGetSimPhoneEntry( nPos, nType, /* @ */ aEntry ) CLASS wce_sim RETURN .F. ENDIF - DEFAULT nType TO SIM_PBSTORAGE_SIM + IF ! ISNUMBER( nType ) + nType := SIM_PBSTORAGE_SIM + ENDIF nResult := wce_SimReadPhoneBookEntry( ::hSim, nType, nPos, @a ) @@ -186,8 +194,12 @@ METHOD lSetSimPhoneEntry( nPos, nType, cNumber, cName, nPlan, nAddrType ) CLASS RETURN .F. ENDIF - DEFAULT nPos TO SIM_PBINDEX_FIRSTAVAILABLE - DEFAULT nType TO SIM_PBSTORAGE_SIM + IF ! ISNUMBER( nType ) + nPos := SIM_PBINDEX_FIRSTAVAILABLE + ENDIF + IF ! ISNUMBER( nType ) + nType := SIM_PBSTORAGE_SIM + ENDIF nResult := wce_SimWritePhoneBookEntry( ::hSim, nType, nPos, cNumber, cName, nPlan, nAddrType ) ::nLastError := nResult @@ -203,7 +215,9 @@ METHOD lDelSimPhoneEntry( nPos, nType ) CLASS wce_sim RETURN .F. ENDIF - DEFAULT nType TO SIM_PBSTORAGE_SIM + IF ! ISNUMBER( nType ) + nType := SIM_PBSTORAGE_SIM + ENDIF 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 699600ba82..a22d2d341c 100644 --- a/harbour/contrib/hbwin/win_os.prg +++ b/harbour/contrib/hbwin/win_os.prg @@ -72,8 +72,12 @@ FUNCTION WIN_OSNETREGOK( lSetIt, lDoVista ) LOCAL cKeySrv LOCAL cKeyWks - DEFAULT lSetIt TO .F. - DEFAULT lDoVista TO .T. + IF ! ISLOGICAL( lSetIt ) + lSetIt := .F. + ENDIF + IF ! ISLOGICAL( lDoVista ) + lDoVista := .T. + ENDIF IF ! lDoVista .AND. hb_osIsWinVista() /* do nothing */ diff --git a/harbour/contrib/hbwin/win_reg.prg b/harbour/contrib/hbwin/win_reg.prg index f569e5dc50..d8cabc643c 100644 --- a/harbour/contrib/hbwin/win_reg.prg +++ b/harbour/contrib/hbwin/win_reg.prg @@ -141,7 +141,9 @@ FUNCTION win_regQuery( nHKEY, cKeyName, cEntryName, xValue, lSetIt ) LOCAL cValType := ValType( xValue ) LOCAL lRetVal - DEFAULT lSetIt TO .F. + IF ! ISLOGICAL( lSetIt ) + lSetIt := .F. + ENDIF IF cValType == "L" xValue := iif( xValue, 1, 0 ) diff --git a/harbour/contrib/hbwin/win_tprn.prg b/harbour/contrib/hbwin/win_tprn.prg index 84cf23cdfd..f8c326524b 100644 --- a/harbour/contrib/hbwin/win_tprn.prg +++ b/harbour/contrib/hbwin/win_tprn.prg @@ -304,7 +304,9 @@ METHOD PROCEDURE Destruct() CLASS WIN_PRN METHOD StartDoc( cDocName ) CLASS WIN_PRN LOCAL lResult - DEFAULT cDocName TO hb_ArgV( 0 ) + " [" + DToC( Date() ) + " - " + Time() + "]" + IF ! ISCHARACTER( cDocName ) + cDocName := hb_ArgV( 0 ) + " [" + DToC( Date() ) + " - " + Time() + "]" + ENDIF IF ( lResult := win_StartDoc( ::hPrinterDc, cDocName ) ) IF !( lResult := ::StartPage( ::hPrinterDc ) ) @@ -317,7 +319,9 @@ METHOD StartDoc( cDocName ) CLASS WIN_PRN METHOD EndDoc( lAbortDoc ) CLASS WIN_PRN IF ::HavePrinted - DEFAULT lAbortDoc TO .F. + IF ! ISLOGICAL( lAbortDoc ) + lAbortDoc := .F. + ENDIF ELSE lAbortDoc := .T. ENDIF @@ -397,7 +401,9 @@ METHOD CheckPage() CLASS WIN_PRN METHOD EndPage( lStartNewPage ) CLASS WIN_PRN - DEFAULT lStartNewPage TO .T. + IF ! ISLOGICAL( lStartNewPage ) + lStartNewPage := .T. + ENDIF win_EndPage( ::hPrinterDC ) IF lStartNewPage @@ -421,7 +427,9 @@ METHOD NewLine() CLASS WIN_PRN METHOD NewPage( lDelay ) CLASS WIN_PRN - DEFAULT lDelay TO .F. + IF ! ISLOGICAL( lDelay ) + lDelay := .F. + ENDIF IF ::Printing IF lDelay @@ -596,9 +604,15 @@ METHOD TextOut( cString, lNewLine, lUpdatePosX, nAlign ) CLASS WIN_PRN IF cString != NIL .AND. ::CheckPage() - DEFAULT lNewLine TO .F. - DEFAULT lUpdatePosX TO .T. - DEFAULT nAlign TO HB_BITOR( WIN_TA_BOTTOM, WIN_TA_LEFT ) + IF ! ISLOGICAL( lNewLine ) + lNewLine := .F. + ENDIF + IF ! ISLOGICAL( lUpdatePosX ) + lUpdatePosX := .T. + ENDIF + IF ! ISNUMBER( nAlign ) + nAlign := HB_BITOR( WIN_TA_BOTTOM, WIN_TA_LEFT ) + ENDIF nPosX := win_TextOut( ::hPrinterDC, ::PosX, ::PosY, cString, Len( cString ), ::fCharWidth, nAlign ) @@ -627,7 +641,9 @@ METHOD TextAtFont( nPosX, nPosY, cString, cFont, nPointSize, nWidth, nBold, lUnd IF ::CheckPage() - DEFAULT nPointSize TO ::FontPointSize + IF ! ISNUMBER( nPointSize ) + nPointSize := ::FontPointSize + ENDIF IF cFont != NIL cType := ValType( nWidth ) diff --git a/harbour/src/rtl/memoedit.prg b/harbour/src/rtl/memoedit.prg index 51da9a3d9e..9ffb548cec 100644 --- a/harbour/src/rtl/memoedit.prg +++ b/harbour/src/rtl/memoedit.prg @@ -292,18 +292,18 @@ FUNCTION MemoEdit( cString,; LOCAL nOldCursor - DEFAULT nTop TO 0 - DEFAULT nLeft TO 0 - DEFAULT nBottom TO MaxRow() - DEFAULT nRight TO MaxCol() - DEFAULT lEditMode TO .T. - DEFAULT nLineLength TO nRight - nLeft + 1 - DEFAULT nTabSize TO 4 - DEFAULT nTextBuffRow TO 1 - DEFAULT nTextBuffColumn TO 0 - DEFAULT nWindowRow TO 0 - DEFAULT nWindowColumn TO nTextBuffColumn - DEFAULT cString TO "" + IF ! ISNUMBER( nTop ) ; nTop := 0 ; ENDIF + IF ! ISNUMBER( nLeft ) ; nLeft := 0 ; ENDIF + IF ! ISNUMBER( nBottom ) ; nBottom := MaxRow() ; ENDIF + IF ! ISNUMBER( nRight ) ; nRight := MaxCol() ; ENDIF + IF ! ISLOGICAL( lEditMode ) ; lEditMode := .T. ; ENDIF + IF ! ISNUMBER( nLineLength ) ; nLineLength := nRight - nLeft + 1 ; ENDIF + IF ! ISNUMBER( nTabSize ) ; nTabSize := 4 ; ENDIF + IF ! ISNUMBER( nTextBuffRow ) ; nTextBuffRow := 1 ; ENDIF + IF ! ISNUMBER( nTextBuffColumn ) ; nTextBuffColumn := 0 ; ENDIF + IF ! ISNUMBER( nWindowRow ) ; nWindowRow := 0 ; ENDIF + IF ! ISNUMBER( nWindowColumn ) ; nWindowColumn := nTextBuffColumn ; ENDIF + IF ! ISCHARACTER( cString ) ; cString := "" ; ENDIF // Original MemoEdit() converts Tabs into spaces; oEd := HBMemoEditor():New( StrTran( cString, Chr( K_TAB ), Space( 1 ) ), nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize, nTextBuffRow, nTextBuffColumn, nWindowRow, nWindowColumn ) diff --git a/harbour/src/rtl/teditor.prg b/harbour/src/rtl/teditor.prg index 5f5bb9393f..2203deda3c 100644 --- a/harbour/src/rtl/teditor.prg +++ b/harbour/src/rtl/teditor.prg @@ -160,10 +160,18 @@ ENDCLASS METHOD Resize( nTop, nLeft, nBottom, nRight ) CLASS HBEditor // don't change coordinates not given - DEFAULT nTop TO ::nTop - DEFAULT nLeft TO ::nLeft - DEFAULT nBottom TO ::nBottom - DEFAULT nRight TO ::nRight + IF ! ISNUMBER( nTop ) + nTop := ::nTop + ENDIF + IF ! ISNUMBER( nLeft ) + nLeft := ::nLeft + ENDIF + IF ! ISNUMBER( nBottom ) + nBottom := ::nBottom + ENDIF + IF ! ISNUMBER( nRight ) + nRight := ::nRight + ENDIF ::nTop := nTop ::nLeft := nLeft @@ -852,8 +860,12 @@ METHOD DeHilite() CLASS HBEditor METHOD SetPos( nRow, nCol ) CLASS HBEditor - DEFAULT nRow TO ::nPhysRow - DEFAULT nCol TO ::nPhysCol + IF ! ISNUMBER( nRow ) + nRow := ::nPhysRow + ENDIF + IF ! ISNUMBER( nCol ) + nCol := ::nPhysCol + ENDIF ::nPhysRow := nRow ::nPhysCol := nCol @@ -967,18 +979,18 @@ METHOD BrowseText( nPassedKey ) METHOD New( cString, nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize, nTextRow, nTextCol, nWndRow, nWndCol ) CLASS HBEditor - DEFAULT cString TO "" - DEFAULT nTop TO 0 - DEFAULT nLeft TO 0 - DEFAULT nBottom TO MaxRow() - DEFAULT nRight TO MaxCol() - DEFAULT lEditMode TO .T. - DEFAULT nLineLength TO NIL - DEFAULT nTabSize TO NIL - DEFAULT nTextRow TO 1 - DEFAULT nTextCol TO 0 - DEFAULT nWndRow TO 0 - DEFAULT nWndCol TO 0 + IF ! ISCHARACTER( cString ) ; cString := "" ; ENDIF + IF ! ISNUMBER( nTop ) ; nTop := 0 ; ENDIF + IF ! ISNUMBER( nLeft ) ; nLeft := 0 ; ENDIF + IF ! ISNUMBER( nBottom ) ; nBottom := MaxRow() ; ENDIF + IF ! ISNUMBER( nRight ) ; nRight := MaxCol() ; ENDIF + IF ! ISLOGICAL( lEditMode ) ; lEditMode := .T. ; ENDIF + IF ! ISNUMBER( nLineLength ) ; nLineLength := NIL ; ENDIF + IF ! ISNUMBER( nTabSize ) ; nTabSize := NIL ; ENDIF + IF ! ISNUMBER( nTextRow ) ; nTextRow := 1 ; ENDIF + IF ! ISNUMBER( nTextCol ) ; nTextCol := 0 ; ENDIF + IF ! ISNUMBER( nWndRow ) ; nWndRow := 0 ; ENDIF + IF ! ISNUMBER( nWndCol ) ; nWndCol := 0 ; ENDIF ::aText := Text2Array( cString, nLineLength ) ::naTextLen := Len( ::aText ) diff --git a/harbour/src/rtl/tobject.prg b/harbour/src/rtl/tobject.prg index ff2f319689..e2df8d1437 100644 --- a/harbour/src/rtl/tobject.prg +++ b/harbour/src/rtl/tobject.prg @@ -173,6 +173,8 @@ STATIC FUNCTION HBObject_Dftonerror( ... ) STATIC FUNCTION HBObject_Error( cDesc, cClass, cMsg, nCode ) - DEFAULT nCode TO 1004 + IF ! ISNUMBER( nCode ) + nCode := 1004 + ENDIF RETURN __errRT_SBASE( iif( nCode == 1005, EG_NOVARMETHOD, EG_NOMETHOD ), nCode, cDesc, cClass + ":" + cMsg, 1, QSelf() ) diff --git a/harbour/src/rtl/tpersist.prg b/harbour/src/rtl/tpersist.prg index 71484476f3..0c7c55990c 100644 --- a/harbour/src/rtl/tpersist.prg +++ b/harbour/src/rtl/tpersist.prg @@ -118,12 +118,14 @@ METHOD SaveToText( cObjectName, nIndent ) CLASS HBPersistent LOCAL cObject LOCAL cType - DEFAULT cObjectName TO "o" + ::ClassName() + IF ! ISCHARACTER( cObjectName ) + cObjectName := "o" + ::ClassName() + ENDIF - IF nIndent == NIL - nIndent := 0 - ELSE + IF ISNUMBER( nIndent ) nIndent += 3 + ELSE + nIndent := 0 ENDIF cObject := iif( nIndent > 0, hb_OSNewLine(), "" ) + Space( nIndent ) + ;