diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fcaf6a85d9..d0e7eace62 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,55 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-11 01:41 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/gtwvg/class.prg + * contrib/gtwvg/menubar.prg + * contrib/gtwvg/paint.prg + * contrib/gtwvg/parthdlr.prg + * contrib/gtwvg/statbar.prg + * contrib/hbmzip/tests/myunzip.prg + * contrib/hbnf/aredit.prg + * extras/gtwvw/tests/cbtest6.prg + * extras/gtwvw/tests/drawimg.prg + * extras/gtwvw/tests/ebtest7.prg + * extras/gtwvw/tests/prog0.prg + * extras/gtwvw/tests/prog1.prg + * extras/gtwvw/tests/prog2.prg + * extras/gtwvw/tests/wvwmouse.prg + * extras/guestbk/inifiles.prg + * extras/hbdoc/hbdoc.prg + * src/debug/debugger.prg + * src/rdd/usrrdd/rdds/arrayrdd.prg + * src/rdd/usrrdd/rdds/hscdx.prg + * src/rdd/usrrdd/rdds/rlcdx.prg + * src/rtl/tbrowse.prg + * src/rtl/tpersist.prg + * src/rtl/tscalar.prg + * tests/db_brows.prg + * tests/debugtst.prg + * tests/inifiles.prg + * tests/mathtest.prg + ! inifiles.prg fixed to run + % using HB_IS*() functions instead of ValType() checks + % using HB_AINS() instead of ASIZE()+AINS() + % using HB_ADEL() instead of ADEL()+ASIZE() + * some formatting + + * contrib/hbnf/popadder.prg + * deleted ASHRINK() macro used only once + + * contrib/hbmagic/tests/hbmagit.prg + * contrib/hbmisc/tests/rtfclass.prg + * contrib/hbmxml/tests/testmxml.prg + * contrib/hbsqlit3/hdbcsqlt.prg + * contrib/xhb/trpccli.prg + * contrib/xhb/ttable.ch + * contrib/xhb/ttable.prg + * contrib/xhb/xhbtedit.prg + * extras/gtwvw/tests/wvwtest9.prg + * utils/hbtest/rt_class.prg + * formatting + 2012-10-11 00:43 UTC+0200 Viktor Szakats (harbour syenar.net) * src/rtl/teditor.prg + added three TODOs, related to Ctrl+B and Ctrl+T missing diff --git a/harbour/contrib/gtwvg/class.prg b/harbour/contrib/gtwvg/class.prg index a0bc748d7f..5a661e501d 100644 --- a/harbour/contrib/gtwvg/class.prg +++ b/harbour/contrib/gtwvg/class.prg @@ -3450,8 +3450,7 @@ METHOD wvtMenu:DelItem( nItemNum ) ENDIF IF ( lResult := Wvt_DeleteMenu( ::hMenu, nItemNum - 1,MF_BYPOSITION ) ) /* Remember ZERO base */ - ADel( ::aItems, nItemNum ) - ASize( ::aItems, Len( ::aItems ) - 1 ) + hb_ADel( ::aItems, nItemNum, .T. ) ELSE #if 0 Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:DelItem()", "Delete menu item FAILED", { nItemNum },"wvt.prg" ) ) diff --git a/harbour/contrib/gtwvg/menubar.prg b/harbour/contrib/gtwvg/menubar.prg index 9f31ec624b..8d03f258e7 100644 --- a/harbour/contrib/gtwvg/menubar.prg +++ b/harbour/contrib/gtwvg/menubar.prg @@ -252,8 +252,7 @@ METHOD WvgMenuBar:delItem( nItemNum ) ENDIF IF ( lResult := WVG_DeleteMenu( ::hMenu, nItemNum - 1, MF_BYPOSITION ) ) /* Remember ZERO base */ - ADel( ::aMenuItems, nItemNum ) - ASize( ::aMenuItems, Len( ::aMenuItems ) - 1 ) + hb_ADel( ::aMenuItems, nItemNum, .T. ) ELSE #if 0 Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:DelItem()", "Delete menu item FAILED", { nItemNum },"wvt.prg" ) ) diff --git a/harbour/contrib/gtwvg/paint.prg b/harbour/contrib/gtwvg/paint.prg index c32fa8d95c..fa77acff9b 100644 --- a/harbour/contrib/gtwvg/paint.prg +++ b/harbour/contrib/gtwvg/paint.prg @@ -225,8 +225,7 @@ FUNCTION wvg_PurgePaint( cID, lDummy ) IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0 aPaint := t_paint_[ n ] - ADel( t_paint_, n ) - ASize( t_paint_, Len( t_paint_ ) - 1 ) + hb_ADel( t_paint_, n, .T. ) ENDIF IF lDummy diff --git a/harbour/contrib/gtwvg/parthdlr.prg b/harbour/contrib/gtwvg/parthdlr.prg index 0f4c046352..e6dacac70c 100644 --- a/harbour/contrib/gtwvg/parthdlr.prg +++ b/harbour/contrib/gtwvg/parthdlr.prg @@ -221,8 +221,7 @@ METHOD WvgPartHandler:delChild( oWvg ) n := AScan( ::aChildren, {| o | o == oWvg } ) IF n > 0 oWvg:destroy() - ADel( ::aChildren, n ) - ASize( ::aChildren, Len( ::aChildren ) - 1 ) + hb_ADel( ::aChildren, n, .T. ) ENDIF RETURN Self diff --git a/harbour/contrib/gtwvg/statbar.prg b/harbour/contrib/gtwvg/statbar.prg index a992c95232..b75dbfec2d 100644 --- a/harbour/contrib/gtwvg/statbar.prg +++ b/harbour/contrib/gtwvg/statbar.prg @@ -264,8 +264,7 @@ METHOD WvgStatusBar:delItem( nItemORcKey ) IF nIndex > 0 /* Delete panel by window */ - ADel( ::aItems, nIndex ) - ASize( ::aItems, Len( ::aItems ) - 1 ) + hb_ADel( ::aItems, nIndex, .T. ) ENDIF RETURN Self diff --git a/harbour/contrib/hbmagic/tests/hbmagit.prg b/harbour/contrib/hbmagic/tests/hbmagit.prg index b4dcb70438..e28e7f0450 100644 --- a/harbour/contrib/hbmagic/tests/hbmagit.prg +++ b/harbour/contrib/hbmagic/tests/hbmagit.prg @@ -110,7 +110,7 @@ PROCEDURE Main() T( "COM binary", cCom ) T( "Short buffer", " " ) T( "Empty buffer", "" ) - T( "Null buffer", nil ) + T( "Null buffer", NIL ) T( "Compressed data", cText ) cText := hb_zuncompress( cText ) T( "Plain text", cText ) diff --git a/harbour/contrib/hbmisc/tests/rtfclass.prg b/harbour/contrib/hbmisc/tests/rtfclass.prg index 999e7baacc..5d720f8eb2 100644 --- a/harbour/contrib/hbmisc/tests/rtfclass.prg +++ b/harbour/contrib/hbmisc/tests/rtfclass.prg @@ -41,7 +41,7 @@ FUNCTION trtf() STATIC oclass - IF oclass == nil + IF oclass == NIL oclass := HBClass():new( "trtf" ) oclass:adddata( "nhandle" ) oclass:addmethod( "new", @new() ) diff --git a/harbour/contrib/hbmxml/tests/testmxml.prg b/harbour/contrib/hbmxml/tests/testmxml.prg index 967af258e3..15f35acc9b 100644 --- a/harbour/contrib/hbmxml/tests/testmxml.prg +++ b/harbour/contrib/hbmxml/tests/testmxml.prg @@ -457,14 +457,14 @@ PROCEDURE Main( cFileArg ) */ IF Left( cFileArg, 1 ) == "<" - hTree := mxmlLoadString( nil, cFileArg, @type_cb() ) + hTree := mxmlLoadString( NIL, cFileArg, @type_cb() ) ELSE /* * Read the file... */ - hTree := mxmlLoadFile( nil, cFileArg, @type_cb() ) + hTree := mxmlLoadFile( NIL, cFileArg, @type_cb() ) ENDIF IF Empty( hTree ) @@ -525,14 +525,14 @@ PROCEDURE Main( cFileArg ) */ IF Left( cFileArg, 1 ) == "<" - mxmlSAXLoadString( nil, cFileArg, @type_cb(), @sax_cb(), nil ) + mxmlSAXLoadString( NIL, cFileArg, @type_cb(), @sax_cb(), NIL ) ELSE /* * Read the file... */ - mxmlSAXLoadFile( nil, cFileArg, @type_cb(), @sax_cb(), nil ) + mxmlSAXLoadFile( NIL, cFileArg, @type_cb(), @sax_cb(), NIL ) ENDIF IF cFileArg == "test.xml" @@ -632,7 +632,7 @@ FUNCTION type_cb( hNode ) /* O - Data type */ * newlines and tabs... */ -FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or nil */ +FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or NIL */ /* I - Element node */ /* I - Open or close tag? */ @@ -681,7 +681,7 @@ FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or nil */ IF nWhere == MXML_WS_AFTER_OPEN RETURN hb_eol() ELSE - RETURN nil + RETURN NIL ENDIF ELSEIF nWhere == MXML_WS_BEFORE_OPEN .OR. ; ( ( cName == "choice" .OR. cName == "option" ) .AND. nWhere == MXML_WS_BEFORE_CLOSE ) @@ -712,4 +712,4 @@ FUNCTION whitespace_cb( hNode, nWhere ) /* O - Whitespace string or nil */ * Return NULL for no added whitespace... */ - RETURN nil + RETURN NIL diff --git a/harbour/contrib/hbmzip/tests/myunzip.prg b/harbour/contrib/hbmzip/tests/myunzip.prg index c3cc5b0642..3e3be5b711 100644 --- a/harbour/contrib/hbmzip/tests/myunzip.prg +++ b/harbour/contrib/hbmzip/tests/myunzip.prg @@ -68,8 +68,7 @@ PROCEDURE Main( ... ) ENDIF cFileName := hb_FNameMerge( cPath, cFileName, cExt ) - ADel( aWild, 1 ) - ASize( aWild, Len( aWild ) - 1 ) + hb_ADel( aWild, 1, .T. ) FOR tmp := 1 TO Len( aWild ) - 1 IF Lower( aWild[ tmp ] ) == "--pass" diff --git a/harbour/contrib/hbnf/aredit.prg b/harbour/contrib/hbnf/aredit.prg index 8a037afd70..f9c7b05f5a 100644 --- a/harbour/contrib/hbnf/aredit.prg +++ b/harbour/contrib/hbnf/aredit.prg @@ -118,8 +118,7 @@ FUNCTION FT_ArEdit( nTop, nLeft, nBot, nRight, ; DO CASE CASE nKey == K_F7 FOR nDim := 1 TO Len( ar ) - ADel( ar[ nDim ], nElem ) - ASize( ar[ nDim ], Len( ar[ nDim ] ) - 1 ) + hb_ADel( ar[ nDim ], nElem, .T. ) NEXT b:refreshAll() @@ -128,8 +127,7 @@ FUNCTION FT_ArEdit( nTop, nLeft, nBot, nRight, ; // check valtype of current element before AINS() cType := ValType( ar[ nDim, nElem ] ) cVal := ar[ nDim, nElem ] - ASize( ar[ nDim ], Len( ar[ nDim ] ) + 1 ) - AIns( ar[ nDim ], nElem ) + hb_AIns( ar[ nDim ], nElem,, .T. ) IF cType == "C" ar[ nDim, nElem ] := Space( Len( cVal ) ) ELSEIF cType == "N" diff --git a/harbour/contrib/hbnf/popadder.prg b/harbour/contrib/hbnf/popadder.prg index f331cc67eb..4da5204e08 100644 --- a/harbour/contrib/hbnf/popadder.prg +++ b/harbour/contrib/hbnf/popadder.prg @@ -63,8 +63,6 @@ MemoEdit( , , , , , .F., NIL, ( ) - ( ) + 1 ) ;; _ftPopKeys() -#define ASHRINK( ar ) ASize( ar, Len( ar ) - 1 ) - /* This INKEY UDC was posted by Don Caton on NanForum... Thanks Don */ #command FT_INKEY [ ] TO ; => ; @@ -1510,7 +1508,7 @@ STATIC FUNCTION _ftPopWin _ftLastWinColor() ENDIF - ASHRINK( t_aWindow ) + ASize( t_aWindow, Len( t_aWindow ) - 1 ) IF ! Empty( t_aWindow ) _ftSetWinColor( W_CURR, W_SCREEN, W_VARIAB ) diff --git a/harbour/contrib/hbsqlit3/hdbcsqlt.prg b/harbour/contrib/hbsqlit3/hdbcsqlt.prg index dd9a627862..5dc2b2c980 100644 --- a/harbour/contrib/hbsqlit3/hdbcsqlt.prg +++ b/harbour/contrib/hbsqlit3/hdbcsqlt.prg @@ -56,7 +56,7 @@ #include "error.ch" #include "hbsqlit3.ch" -#define _TODO_ nil +#define _TODO_ NIL create class hdbcSQLTConnection @@ -96,9 +96,9 @@ method new( cDBFile, lCreateIfNotExist ) class hdbcSQLTConnection method close() class hdbcSQLTConnection - ::pDb := nil + ::pDb := NIL - return nil + return NIL method startTransaction() class hdbcSQLTConnection @@ -106,7 +106,7 @@ method startTransaction() class hdbcSQLTConnection raiseError( sqlite3_errmsg( ::pDb ) ) endif - return nil + return NIL method commit() class hdbcSQLTConnection @@ -115,7 +115,7 @@ method commit() class hdbcSQLTConnection raiseError( sqlite3_errmsg( ::pDb ) ) endif - return nil + return NIL method rollback() class hdbcSQLTConnection @@ -123,7 +123,7 @@ method rollback() class hdbcSQLTConnection raiseError( sqlite3_errmsg( ::pDb ) ) endif - return nil + return NIL method createStatement() class hdbcSQLTConnection @@ -193,11 +193,11 @@ method Close() class hdbcSQLTStatement sqlite3_finalize( ::pRes ) - ::pRes := nil + ::pRes := NIL endif - return nil + return NIL create class hdbcSQLTPreparedStatement @@ -270,7 +270,7 @@ method setString( nParam, xValue ) class hdbcSQLTPreparedStatement endif endif - return nil + return NIL method Close() class hdbcSQLTPreparedStatement @@ -278,11 +278,11 @@ method Close() class hdbcSQLTPreparedStatement sqlite3_finalize( ::pRes ) - ::pRes := nil + ::pRes := NIL endif - return nil + return NIL create class hdbcSQLTResultSet @@ -370,7 +370,7 @@ method new( pDB, pStmt ) class hdbcSQLTResultSet method Close() class hdbcSQLTResultSet - return nil + return NIL method beforeFirst() class hdbcSQLTResultSet @@ -378,7 +378,7 @@ method beforeFirst() class hdbcSQLTResultSet ::lBeforeFirst := .T. ::lAfterLast := .F. - return nil + return NIL method afterLast() class hdbcSQLTResultSet @@ -386,7 +386,7 @@ method afterLast() class hdbcSQLTResultSet ::lBeforeFirst := .F. ::lAfterLast := .T. - return nil + return NIL method relative( nMove ) class hdbcSQLTResultSet @@ -469,13 +469,13 @@ method moveToInsertRow() class hdbcSQLTResultSet ::aBuffer := array( _TODO_ ) - return nil + return NIL method moveToCurrentRow() class hdbcSQLTResultSet ::nRow := ::nCurrentRow - return nil + return NIL method updateBuffer( nField, xValue, cType ) class hdbcSQLTResultSet @@ -483,31 +483,31 @@ method updateBuffer( nField, xValue, cType ) class hdbcSQLTResultSet nField := ::findColumn( nField ) endif - if ::aBuffer == nil + if ::aBuffer == NIL ::aBuffer := array( _TODO_ ) endif ::aBuffer[ nField ] := { xValue, cType } - return nil + return NIL method insertRow() class hdbcSQLTResultSet /* TODO */ - return nil + return NIL method updateRow() class hdbcSQLTResultSet /* TODO */ - return nil + return NIL method deleteRow() class hdbcSQLTResultSet /* TODO */ - return nil + return NIL create class hdbcSQLTResultSetMetaData diff --git a/harbour/contrib/xhb/trpccli.prg b/harbour/contrib/xhb/trpccli.prg index 68aca34404..921566e56e 100644 --- a/harbour/contrib/xhb/trpccli.prg +++ b/harbour/contrib/xhb/trpccli.prg @@ -881,7 +881,7 @@ METHOD TCPParse( cCode ) CLASS tRPCClient IF ::oResult != NIL ::OnFunctionReturn( ::oResult ) ENDIF - // todo: rise an error if ::oResult is nil + // TODO: rise an error if ::oResult is NIL ENDIF ENDIF diff --git a/harbour/contrib/xhb/ttable.ch b/harbour/contrib/xhb/ttable.ch index 2d3d4c8fac..c22cd3e332 100644 --- a/harbour/contrib/xhb/ttable.ch +++ b/harbour/contrib/xhb/ttable.ch @@ -72,8 +72,8 @@ #xcommand DEFAULT := ; [, := ] => ; - := If( == nil, , ) ;; - [ := If( == nil, , ); ] + := iif( == NIL, , ) ;; + [ := iif( == NIL, , ); ] #xcommand DEFAULT TO [, TO ] ; => ; @@ -83,7 +83,7 @@ // --> OOPs #xtranslate BYNAME [, ] => :: := [; :: := ] #xtranslate BYNAME DEFAULT => :: := BYDEFAULT , -#xtranslate BYDEFAULT , => if( == NIL, , ) +#xtranslate BYDEFAULT , => iif( == NIL, , ) #xCommand NETUSE <(cDBF)> ; [ALIAS ] ; diff --git a/harbour/contrib/xhb/ttable.prg b/harbour/contrib/xhb/ttable.prg index 0dfd989b33..419dd08ea7 100644 --- a/harbour/contrib/xhb/ttable.prg +++ b/harbour/contrib/xhb/ttable.prg @@ -1455,13 +1455,13 @@ METHOD OnError( uParam ) CLASS HBTable LOCAL nPos LOCAL uRet, oErr - IF uParam != nil .AND. Left( cMsg, 1 ) == '_' + IF uParam != NIL .AND. Left( cMsg, 1 ) == '_' cMsg := SubStr( cMsg, 2 ) ENDIF nPos := ( ::Alias )->( FieldPos( cMsg ) ) IF nPos != 0 - uRet := ( ::Alias )->( iif( uParam == nil, FieldGet(nPos ), FieldPut(nPos, uParam ) ) ) + uRet := ( ::Alias )->( iif( uParam == NIL, FieldGet(nPos ), FieldPut(nPos, uParam ) ) ) ELSE oErr := ErrorNew() diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index 915a0e9be8..29de5f210d 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -709,7 +709,7 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor ENDIF /* - * 2006/AUG/12 -E.F. Trap Set key only if nKey is nil. + * 2006/AUG/12 -E.F. Trap Set key only if nKey is NIL. */ IF nPassedKey == NIL IF ( ::bKeyBlock := SetKey( nKey ) ) != NIL @@ -2689,7 +2689,7 @@ METHOD SetTextSelection( cAction, nCount ) CLASS XHBEditor ENDIF - RETURN nil + RETURN NIL // // Clear current selection @@ -2705,7 +2705,7 @@ METHOD ClrTextSelection() CLASS XHBEditor ::RefreshWindow() ENDIF - RETURN nil + RETURN NIL METHOD DelText() CLASS XHBEditor @@ -2812,7 +2812,7 @@ METHOD AddText( cString, lAtPos ) CLASS XHBEditor IF !Empty( cString ) - aTmpText := Text2Array( cString, iif( ::lWordWrap, ::nNumCols, nil ) ) + aTmpText := Text2Array( cString, iif( ::lWordWrap, ::nNumCols, NIL ) ) nLines := Len( aTmpText ) nAtRow := ::nRow lSaveIns := ::lInsert @@ -2875,7 +2875,7 @@ METHOD GetTextIndex() CLASS XHBEditor METHOD LoadText( cString ) CLASS XHBEditor - ::aText := Text2Array( cString, iif( ::lWordWrap, ::nNumCols, nil ) ) + ::aText := Text2Array( cString, iif( ::lWordWrap, ::nNumCols, NIL ) ) IF ::LastRow() == 0 AAdd( ::aText, HBTextLine():New() ) @@ -2897,7 +2897,7 @@ METHOD LoadFile( cFileName ) CLASS XHBEditor cString := MemoRead( cFileName ) ENDIF - ::aText := Text2Array( cString, iif( ::lWordWrap, ::nNumCols, nil ) ) + ::aText := Text2Array( cString, iif( ::lWordWrap, ::nNumCols, NIL ) ) IF ::LastRow() == 0 AAdd( ::aText, HBTextLine():New() ) diff --git a/harbour/extras/gtwvw/tests/cbtest6.prg b/harbour/extras/gtwvw/tests/cbtest6.prg index be5ef91080..8a1a9c6f4b 100644 --- a/harbour/extras/gtwvw/tests/cbtest6.prg +++ b/harbour/extras/gtwvw/tests/cbtest6.prg @@ -249,7 +249,7 @@ FUNCTION CBreader( oGet ) oGet:exitState := GE_NOEXIT ENDIF - ELSEIF ValType( bKeyBlock := SetKey( nKey ) ) == "B" + ELSEIF HB_ISBLOCK( bKeyBlock := SetKey( nKey ) ) oGetList:GetDoSetKey( bKeyBlock ) //eval(bKeyBlock) oGet:exitState := GE_NOEXIT diff --git a/harbour/extras/gtwvw/tests/drawimg.prg b/harbour/extras/gtwvw/tests/drawimg.prg index f4608214a6..4c6981f415 100644 --- a/harbour/extras/gtwvw/tests/drawimg.prg +++ b/harbour/extras/gtwvw/tests/drawimg.prg @@ -202,7 +202,7 @@ METHOD New( nWinNum, nType, cId, nRow1, nCol1, nRow2, nCol2, aOffTLBR, lTransp ) ::nRow2 := nRow2 ::nCol2 := nCol2 - IF !( ValType( aOffTLBR ) == "A" ) + IF ! HB_ISARRAY( aOffTLBR ) aOffTLBR := { 0, 0, 0, 0 } ENDIF diff --git a/harbour/extras/gtwvw/tests/ebtest7.prg b/harbour/extras/gtwvw/tests/ebtest7.prg index ff7a3b2cff..b95ca405ac 100644 --- a/harbour/extras/gtwvw/tests/ebtest7.prg +++ b/harbour/extras/gtwvw/tests/ebtest7.prg @@ -191,39 +191,40 @@ FUNCTION AddEBGet( aEBGets, mnrow, mncol, mxValue, mcVarName, mbAssign, mcLabel, mcVarType := ValType( mxValue ) DO CASE CASE mcVarType == "C" - mcPict := iif( ValType( mcPict ) == "C", mcPict, repl( "X", Len(mxValue ) ) ) + mcPict := iif( HB_ISSTRING( mcPict ), mcPict, replicate( "X", Len(mxValue ) ) ) mbText := {|| mxValue } CASE mcVarType == "N" - mcPict := iif( ValType( mcPict ) == "C", mcPict, "999,999,999.99" ) + mcPict := iif( HB_ISSTRING( mcPict ), mcPict, "999,999,999.99" ) mbText := {|| Transform( mxValue, mcPict ) } CASE mcVarType == "D" - mcPict := iif( ValType( mcPict ) == "C", mcPict, "99/99/9999" ) + mcPict := iif( HB_ISSTRING( mcPict ), mcPict, "99/99/9999" ) mbText := {|| DToC( mxValue ) } OTHERWISE // unsupported valtype RETURN .F. ENDCASE - IF !( ValType( aEBGets ) == "A" ) + IF ! HB_ISARRAY( aEBGets ) aEBGEts := {} ENDIF - IF !( ValType( mlMultiline ) == "L" ) .OR. ; - !( ValType( mxValue ) == "C" ) + IF ! HB_ISLOGICAL( mlMultiline ) .OR. ; + ! HB_ISSTRING( mxValue ) mlMultiline := .F. ENDIF - IF !( ValType( mcLabel ) == "C" ) + IF ! HB_ISSTRING( mcLabel ) mcLabel := mcVarName + ":" ENDIF - AAdd( aEBGets, { mlMultiline, ; //__GET_LMULTILINE - mcLabel, ; //__GET_CLABEL + AAdd( aEBGets, { ; + mlMultiline, ; //__GET_LMULTILINE + mcLabel, ; //__GET_CLABEL mnrow, ; //__GET_NROW - mncol, ; //__GET_NCOL + mncol, ; //__GET_NCOL mxValue, ; //__GET_XINIT mcPict, ; //__GET_CPICT mcVarType, ; //__GET_CVALTYPE - mbText, ; //__GET_BTEXT + mbText, ; //__GET_BTEXT mbAssign, ; //__GET_BASSIGN NIL, ; //__GET_NEBID .F. } ) //__GET_LFOCUSED @@ -301,7 +302,7 @@ PROCEDURE EBReadGets( nwinnum, aEBGets ) nFocus := 1 ch := Inkey( 0.5 ) DO WHILE !lDone - IF ValType( SetKey( ch ) ) == "B" + IF HB_ISBLOCK( SetKey( ch ) ) Eval( SetKey( ch ) ) ELSEIF ch != 0 lchangefocus := .T. @@ -358,7 +359,7 @@ STATIC PROCEDURE InpKeyHandler( nwinnum, ch, aEBGets, nOKbutton, nCancelbutton ) LOCAL nNumGets := Len( aEBGets ) LOCAL nFocus, lchangefocus - IF ValType( SetKey( ch ) ) == "B" + IF HB_ISBLOCK( SetKey( ch ) ) Eval( SetKey( ch ) ) RETURN ELSEIF ch == 0 @@ -425,8 +426,8 @@ STATIC PROCEDURE SaveVar( nwinnum, aEBGets, lDone ) LOCAL i, cdebugreport FOR i := 1 TO Len( aEBGets ) // do some validation if necessary - Eval( aEBGets[i][__GET_BASSIGN], ; - GetValFromText( wvw_ebgettext( nwinnum, aEBGets[i][__GET_NEBID] ), aEBGets[i][__GET_CVALTYPE] ) ) + Eval( aEBGets[ i ][ __GET_BASSIGN ], ; + GetValFromText( wvw_ebgettext( nwinnum, aEBGets[ i ][ __GET_NEBID ] ), aEBGets[ i ][ __GET_CVALTYPE ] ) ) NEXT lDone := .T. @@ -562,20 +563,20 @@ STATIC FUNCTION MaskEditBox( nWinNum, nId, nEvent, aEBGets ) // don't leave it in an invalid state wvw_ebsetfocus( nwinnum, nid ) ELSE - wvw_ebsettext( nwinnum, nId, Transform( GetValFromText(ctext,mcvaltype ), mcpict ) ) + wvw_ebsettext( nwinnum, nId, Transform( GetValFromText( ctext, mcvaltype ), mcpict ) ) ENDIF ENDIF CASE nEvent == EN_SETFOCUS IF !mlmultiline .AND. mcvaltype == "N" ctext := wvw_ebgettext( nwinnum, nid ) - wvw_ebsettext( nwinnum, nId, Transform( GetValFromText(ctext,mcvaltype ), GetNumMask(mcpict, mcvaltype ) ) ) + wvw_ebsettext( nwinnum, nId, Transform( GetValFromText( ctext, mcvaltype ), GetNumMask( mcpict, mcvaltype ) ) ) ENDIF - wvw_ebsetsel( nwinnum, nid, 0, - 1 ) + wvw_ebsetsel( nwinnum, nid, 0, -1 ) nwasFocus := nFocused( aEBGets ) IF nwasFocus != 0 - aEBGets[nwasFocus][__GET_LFOCUSED] := .F. + aEBGets[ nwasFocus ][ __GET_LFOCUSED ] := .F. ENDIF - aEBGets[nIndex][__GET_LFOCUSED] := .T. + aEBGets[ nIndex ][ __GET_LFOCUSED ] := .T. CASE nEvent == EN_CHANGE IF !mlmultiline ProcessCharMask( nwinnum, nId, mcvaltype, mcpict ) @@ -591,7 +592,7 @@ STATIC FUNCTION MaskEditBox( nWinNum, nId, nEvent, aEBGets ) STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict ) - LOCAL InBuffer , OutBuffer := '' , icp , x , CB , CM , BadEntry := .F. , InBufferLeft , InBufferRight , Mask , OldChar , BackInbuffer + LOCAL InBuffer, OutBuffer := "", icp, x, CB, CM, BadEntry := .F., InBufferLeft, InBufferRight, Mask, OldChar, BackInbuffer LOCAL pc := 0 LOCAL fnb := 0 LOCAL dc := 0 @@ -959,7 +960,7 @@ FUNCTION WVW_INPUTFOCUS( nWinNum, hWnd, message, wParam, lParam ) CASE message == WM_CHAR ch := wParam bhandler := inp_handler( nWinNum ) - IF ValType( bhandler ) == "B" + IF HB_ISBLOCK( bhandler ) Eval( bhandler, nWinNum, ch ) RETURN .T. ELSE @@ -978,7 +979,7 @@ FUNCTION inp_handler( nwinnum, bhandler ) LOCAL i LOCAL retval := iif( Len( sbhandlers ) >= nwinnum + 1, sbhandlers[nwinnum+1], NIL ) - IF ValType( bhandler ) == "B" + IF HB_ISBLOCK( bhandler ) IF Len( sbhandlers ) < nwinnum + 1 ASize( sbhandlers, nwinnum + 1 ) ENDIF diff --git a/harbour/extras/gtwvw/tests/prog0.prg b/harbour/extras/gtwvw/tests/prog0.prg index 250f2d8911..8359566818 100644 --- a/harbour/extras/gtwvw/tests/prog0.prg +++ b/harbour/extras/gtwvw/tests/prog0.prg @@ -106,7 +106,7 @@ FUNCTION xBrowse1() USE '..\..\..\tests\test' NEW IF NetErr() - RETURN nil + RETURN NIL ENDIF info_ := dbStruct() @@ -178,7 +178,7 @@ FUNCTION xBrowse1() dbCloseArea() - RETURN nil + RETURN NIL // @@ -380,13 +380,12 @@ FUNCTION ZREVWINDOW() ENDIF // restore states - RestScreen( s_zwin[ i ][2], s_zwin[ i ][3], s_zwin[ i ][4], s_zwin[ i ][5], s_zwin[ i ][6] ) - SetPos( s_zwin[ i ][8], s_zwin[ i ][9] ) - SetColor( s_zwin[ i ][10] ) + RestScreen( s_zwin[ i ][ 2 ], s_zwin[ i ][ 3 ], s_zwin[ i ][ 4 ], s_zwin[ i ][ 5 ], s_zwin[ i ][ 6 ] ) + SetPos( s_zwin[ i ][ 8 ], s_zwin[ i ][ 9 ] ) + SetColor( s_zwin[ i ][ 10 ] ) // remove window from list - ADel( s_zwin, i ) - ASize( s_zwin, Len( s_zwin ) - 1 ) + hb_ADel( s_zwin, i, .T. ) RETURN NIL diff --git a/harbour/extras/gtwvw/tests/prog1.prg b/harbour/extras/gtwvw/tests/prog1.prg index 005a0bbbab..b92a7e9604 100644 --- a/harbour/extras/gtwvw/tests/prog1.prg +++ b/harbour/extras/gtwvw/tests/prog1.prg @@ -130,7 +130,7 @@ FUNCTION xBrowse1() USE '..\..\..\tests\TEST' NEW IF NetErr() - RETURN nil + RETURN NIL ENDIF info_ := dbStruct() @@ -202,7 +202,7 @@ FUNCTION xBrowse1() dbCloseArea() - RETURN nil + RETURN NIL // @@ -414,13 +414,12 @@ FUNCTION ZREVWINDOW() #endif // restore states - RestScreen( s_zwin[ i ][2], s_zwin[ i ][3], s_zwin[ i ][4], s_zwin[ i ][5], s_zwin[ i ][6] ) - SetPos( s_zwin[ i ][8], s_zwin[ i ][9] ) - SetColor( s_zwin[ i ][10] ) + RestScreen( s_zwin[ i ][ 2 ], s_zwin[ i ][ 3 ], s_zwin[ i ][ 4 ], s_zwin[ i ][ 5 ], s_zwin[ i ][ 6 ] ) + SetPos( s_zwin[ i ][ 8 ], s_zwin[ i ][ 9 ] ) + SetColor( s_zwin[ i ][ 10 ] ) // remove window from list - ADel( s_zwin, i ) - ASize( s_zwin, Len( s_zwin ) - 1 ) + hb_ADel( s_zwin, i, .T. ) RETURN NIL diff --git a/harbour/extras/gtwvw/tests/prog2.prg b/harbour/extras/gtwvw/tests/prog2.prg index 27bd1a958e..464f6042a7 100644 --- a/harbour/extras/gtwvw/tests/prog2.prg +++ b/harbour/extras/gtwvw/tests/prog2.prg @@ -142,7 +142,7 @@ FUNCTION xBrowse1() USE '..\..\..\tests\TEST' NEW IF NetErr() - RETURN nil + RETURN NIL ENDIF info_ := dbStruct() @@ -232,7 +232,7 @@ FUNCTION xBrowse1() dbCloseArea() - RETURN nil + RETURN NIL // @@ -456,13 +456,12 @@ FUNCTION ZREVWINDOW() #endif // restore states - RestScreen( s_zwin[ i ][2], s_zwin[ i ][3], s_zwin[ i ][4], s_zwin[ i ][5], s_zwin[ i ][6] ) - SetPos( s_zwin[ i ][8], s_zwin[ i ][9] ) - SetColor( s_zwin[ i ][10] ) + RestScreen( s_zwin[ i ][ 2 ], s_zwin[ i ][ 3 ], s_zwin[ i ][ 4 ], s_zwin[ i ][ 5 ], s_zwin[ i ][ 6 ] ) + SetPos( s_zwin[ i ][ 8 ], s_zwin[ i ][ 9 ] ) + SetColor( s_zwin[ i ][ 10 ] ) // remove window from list - ADel( s_zwin, i ) - ASize( s_zwin, Len( s_zwin ) - 1 ) + hb_ADel( s_zwin, i, .T. ) RETURN NIL diff --git a/harbour/extras/gtwvw/tests/wvwmouse.prg b/harbour/extras/gtwvw/tests/wvwmouse.prg index 8ed9fe3051..6930edffe9 100644 --- a/harbour/extras/gtwvw/tests/wvwmouse.prg +++ b/harbour/extras/gtwvw/tests/wvwmouse.prg @@ -144,7 +144,7 @@ METHOD New( cCaption, nRow1, nCol1, nRow2, nCol2, bClickBlock, nType, lDraw, nWi ::nRow2 := nRow2 ::nCol2 := nCol2 - ::bClickBlock := iif( ValType( bClickBlock ) == "B", bClickBlock, NIL ) + ::bClickBlock := iif( HB_ISBLOCK( bClickBlock ), bClickBlock, NIL ) ::bPressBlock := NIL ::lRepeatPress := .F. @@ -222,7 +222,7 @@ METHOD OnPress() CLASS WVWMouseButton wvwm_SetKeyRepeater( .T. ) //activate key repeater ENDIF - IF ValType( ::bPressBlock ) == "B" + IF HB_ISBLOCK( ::bPressBlock ) Eval( ::bPressBlock ) ENDIF @@ -236,7 +236,7 @@ METHOD OnClick() CLASS WVWMouseButton RETURN Self ENDIF - IF ValType( ::bClickBlock ) == "B" + IF HB_ISBLOCK( ::bClickBlock ) Eval( ::bClickBlock ) ENDIF @@ -322,9 +322,9 @@ METHOD DRAW( nWinNum ) CLASS WVWMouseButton LOCAL lPressed := ::lPressed .AND. lMouseOver LOCAL aFontInfo := iif( ::nCaptionHeight == NIL, wvw_getFontInfo( nWinNum ), NIL ) LOCAL nLabelColor := iif( !lPressed, rgb( 0, 0, 0 ), rgb( 96, 96, 96 ) ) - LOCAL lUseImage := ( ValType( ::cImage ) == "C" ) //20040325 + LOCAL lUseImage := HB_ISSTRING( ::cImage ) //20040325 - IF !::lVisible .OR. ( ::nType == _BUTTON_NONE ) + IF !::lVisible .OR. ::nType == _BUTTON_NONE SetCursor( nOldCursor ) //20040303 RETURN Self ENDIF @@ -352,7 +352,7 @@ METHOD DRAW( nWinNum ) CLASS WVWMouseButton ENDIF IF ! Empty( ::cCaption ) - Wvw_DrawLabel( nWinNum, ::nRow1, nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, rgb( 198,198,198 ), ::cCaptionFont, iif( ValType(afontinfo ) == "A", afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F. , .F. ) + Wvw_DrawLabel( nWinNum, ::nRow1, nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, rgb( 198,198,198 ), ::cCaptionFont, iif( HB_ISARRAY( afontinfo ), afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F. , .F. ) ENDIF ELSE IF lMouseOver .OR. ::nType == _BUTTON_NORMAL .OR. ::nType == _BUTTON_HARD @@ -376,7 +376,7 @@ METHOD DRAW( nWinNum ) CLASS WVWMouseButton ENDIF IF ! Empty( ::cCaption ) - Wvw_DrawLabel( nWinNum, ::nRow1, nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, rgb( 198,198,198 ), ::cCaptionFont, iif( ValType( afontinfo ) == "A", afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F. , .F. ) + Wvw_DrawLabel( nWinNum, ::nRow1, nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, rgb( 198,198,198 ), ::cCaptionFont, iif( HB_ISARRAY( afontinfo ), afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F. , .F. ) ENDIF ENDIF SetCursor( nOldCursor ) diff --git a/harbour/extras/gtwvw/tests/wvwtest9.prg b/harbour/extras/gtwvw/tests/wvwtest9.prg index 3376a75da8..20d3de150c 100644 --- a/harbour/extras/gtwvw/tests/wvwtest9.prg +++ b/harbour/extras/gtwvw/tests/wvwtest9.prg @@ -538,7 +538,7 @@ FUNCTION DEMO_Browse() USE '..\..\..\tests\TEST' NEW IF NetErr() WVW_lCloseWindow() - RETURN nil + RETURN NIL ENDIF INDEX ON FIELD->LAST TO TEST1 //20040707 @@ -673,7 +673,7 @@ FUNCTION DEMO_Browse() SetColor( cColor ) // SetCursor( nCursor ) - RETURN nil //DEMO_Browse() + RETURN NIL //DEMO_Browse() /* generic Vertical Scrollbar handler for tbrowse */ @@ -917,7 +917,7 @@ FUNCTION WVW_SetFocus( hWnd, nWinNum ) Alert( "Got focus " + tran( nGotFocus,"9999" ) + "th times" ) ENDIF - RETURN nil + RETURN NIL #endif // @@ -926,7 +926,7 @@ FUNCTION WVW_SetFocus( hWnd, nWinNum ) // received by the window. // //FUNCTION WVW_KillFocus( hWnd ) -//RETURN nil +//RETURN NIL FUNCTION WVW_TIMER( nWinNum, hWnd, message, wParam, lParam ) diff --git a/harbour/extras/guestbk/inifiles.prg b/harbour/extras/guestbk/inifiles.prg index a3ed42af34..299b57f0eb 100644 --- a/harbour/extras/guestbk/inifiles.prg +++ b/harbour/extras/guestbk/inifiles.prg @@ -8,7 +8,7 @@ FUNCTION TIniFile() STATIC oClass - IF oClass == nil + IF oClass == NIL oClass := HBClass():New( "TINIFILE" ) // starts a new class definition oClass:AddData( "FileName" ) // define this class objects datas @@ -43,7 +43,7 @@ STATIC FUNCTION New( cFileName ) IF Empty( cFileName ) // raise an error? OutErr( "No filename passed to TIniFile():New()" ) - RETURN nil + RETURN NIL ELSE ::FileName := cFilename @@ -156,7 +156,7 @@ STATIC PROCEDURE WriteString( cSection, cIdent, cString ) IF j > 0 ::Contents[ j ][ 2 ] := cString ELSE - AAdd( ::Contents, nil ) + AAdd( ::Contents, NIL ) AIns( ::Contents, 1 ) ::Contents[ 1 ] := { cIdent, cString } ENDIF @@ -198,7 +198,7 @@ STATIC FUNCTION ReadDate( cSection, cIdent, dDefault ) LOCAL Self := QSelf() - RETURN SToD( ::ReadString( cSection, cIdent, DToS(dDefault ) ) ) + RETURN SToD( ::ReadString( cSection, cIdent, DToS( dDefault ) ) ) STATIC PROCEDURE WriteDate( cSection, cIdent, dDate ) @@ -235,8 +235,7 @@ STATIC PROCEDURE DeleteKey( cSection, cIdent ) cIdent := Lower( cIdent ) j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cIdent } ) - ADel( ::Contents[ i ][ 2 ], j ) - ASize( ::Contents[ i ][ 2 ], Len( ::Contents[ i ][ 2 ] ) - 1 ) + hb_ADel( ::Contents[ i ][ 2 ], j, .T. ) ENDIF RETURN @@ -247,16 +246,14 @@ STATIC PROCEDURE EraseSection( cSection ) LOCAL i IF Empty( cSection ) - WHILE ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. HB_ISSTRING(x[ 2 ] ) } ) ) > 0 - ADel( ::Contents, i ) - ASize( ::Contents, Len( ::Contents ) - 1 ) - end + WHILE ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. HB_ISSTRING( x[ 2 ] ) } ) ) > 0 + hb_ADel( ::Contents, i, .T. ) + ENDDO ELSE cSection := Lower( cSection ) IF ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cSection .AND. HB_ISARRAY( x[ 2 ] ) } ) ) > 0 - ADel( ::Contents, i ) - ASize( ::Contents, Len( ::Contents ) - 1 ) + hb_ADel( ::Contents, i, .T. ) ENDIF ENDIF @@ -276,7 +273,7 @@ STATIC FUNCTION ReadSection( cSection ) ELSE cSection := Lower( cSection ) - IF ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. x[ 1 ] == cSection .AND. HB_ISARRAY(x[ 2 ] ) } ) ) > 0 + IF ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. x[ 1 ] == cSection .AND. HB_ISARRAY( x[ 2 ] ) } ) ) > 0 FOR j := 1 TO Len( ::Contents[ i ][ 2 ] ) @@ -311,7 +308,7 @@ STATIC PROCEDURE UpdateFile() hFile := FCreate( ::Filename ) FOR i := 1 TO Len( ::Contents ) - if ::Contents[ i ][ 1 ] == NIL + IF ::Contents[ i ][ 1 ] == NIL FWrite( hFile, ::Contents[ i ][ 2 ] + hb_eol() ) ELSEIF HB_ISARRAY( ::Contents[ i ][ 2 ] ) diff --git a/harbour/extras/hbdoc/hbdoc.prg b/harbour/extras/hbdoc/hbdoc.prg index 2c7b719e43..bc8c52da4b 100644 --- a/harbour/extras/hbdoc/hbdoc.prg +++ b/harbour/extras/hbdoc/hbdoc.prg @@ -242,8 +242,8 @@ PROCEDURE Main( ... ) hb_ntos( oR:CategoryIndex( oR:Category ) ) + " " + hb_ntos( oR:SubcategoryIndex( oR:Category, oR:Subcategory ) ) + " " + oR:Name ; } ) ELSE - ASize( ADel( p_aCategories[ idx ][ 2 ], idx2 ), Len( p_aCategories[ idx ][ 2 ] ) - 1 ) - ASize( ADel( p_aCategories[ idx ][ 3 ], idx2 ), Len( p_aCategories[ idx ][ 3 ] ) - 1 ) + hb_ADel( p_aCategories[ idx ][ 2 ], idx2, .T. ) + hb_ADel( p_aCategories[ idx ][ 3 ], idx2, .T. ) ENDIF NEXT ELSE diff --git a/harbour/src/debug/debugger.prg b/harbour/src/debug/debugger.prg index 49bdfce8ae..a2793a1b96 100644 --- a/harbour/src/debug/debugger.prg +++ b/harbour/src/debug/debugger.prg @@ -1883,8 +1883,7 @@ METHOD Open() CLASS HBDebugger LOCAL cExt ASort( aFiles ) - ASize( aFiles, Len( aFiles ) + 1 ) - HB_AIns( aFiles, 1, "(Another file)", .F. ) + hb_AIns( aFiles, 1, "(Another file)", .T. ) nFileName := ::ListBox( "Please choose a source file", aFiles ) IF nFileName == 0 diff --git a/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg b/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg index 4bcf5cf4cf..ea644d6ec9 100644 --- a/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg +++ b/harbour/src/rdd/usrrdd/rdds/arrayrdd.prg @@ -949,8 +949,7 @@ STATIC FUNCTION AR_UNLOCK( nWA, nRec ) nPos := AScan( aRecords, nRec ) IF nPos > 0 aRecInfo[ nRec, RECDATA_LOCKED ] := 0 - ADel( aRecords, nPos ) - ASize( aRecords, Len( aRecords ) - 1 ) + hb_ADel( aRecords, nPos, .T. ) ENDIF ENDIF ENDIF diff --git a/harbour/src/rdd/usrrdd/rdds/hscdx.prg b/harbour/src/rdd/usrrdd/rdds/hscdx.prg index 11d6ad2368..f336c4379b 100644 --- a/harbour/src/rdd/usrrdd/rdds/hscdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/hscdx.prg @@ -200,10 +200,8 @@ FUNCTION HSX_CLOSE( xHSX ) nSlot := 0 ENDIF IF nSlot != 0 - ADEL( aWData[ 2 ], nSlot ) - ADEL( aWData[ 3 ], nSlot ) - ASIZE( aWData[ 2 ], LEN( aWData[ 2 ] ) - 1 ) - ASIZE( aWData[ 3 ], LEN( aWData[ 3 ] ) - 1 ) + hb_ADEL( aWData[ 2 ], nSlot, .T. ) + hb_ADEL( aWData[ 3 ], nSlot, .T. ) ENDIF ENDIF diff --git a/harbour/src/rdd/usrrdd/rdds/rlcdx.prg b/harbour/src/rdd/usrrdd/rdds/rlcdx.prg index dc9d967939..157485579d 100644 --- a/harbour/src/rdd/usrrdd/rdds/rlcdx.prg +++ b/harbour/src/rdd/usrrdd/rdds/rlcdx.prg @@ -159,8 +159,7 @@ STATIC FUNCTION RLCDX_UNLOCK( nWA, xRecID ) IF --aWData[ 2, i, 2 ] > 0 RETURN HB_SUCCESS ENDIF - ADEL( aWData[ 2 ], i ) - ASIZE( aWData[ 2 ], LEN( aWData[ 2 ] ) - 1 ) + hb_ADEL( aWData[ 2 ], i, .T. ) ELSE RETURN HB_SUCCESS ENDIF diff --git a/harbour/src/rtl/tbrowse.prg b/harbour/src/rtl/tbrowse.prg index 78fd147e77..8251d0cbf0 100644 --- a/harbour/src/rtl/tbrowse.prg +++ b/harbour/src/rtl/tbrowse.prg @@ -2147,8 +2147,7 @@ METHOD delColumn( nColumn ) CLASS TBROWSE IF .T. /* It's optimized by compiler without any RT overhead */ #endif oCol := ::columns[ nColumn ] - ADel( ::columns, nColumn ) - ASize( ::columns, Len( ::columns ) - 1 ) + hb_ADel( ::columns, nColumn, .T. ) ::configure( _TBR_CONF_COLUMNS ) ENDIF @@ -2657,8 +2656,7 @@ METHOD setKey( nKey, bBlock ) CLASS TBROWSE ELSE bReturn := ::keys[ nPos ][ _TBC_SETKEY_BLOCK ] IF PCount() == 2 .AND. bBlock == NIL .AND. nKey != 0 - ADel( ::keys, nPos ) - ASize( ::keys, Len( ::keys ) - 1 ) + hb_ADel( ::keys, nPos, .T. ) ENDIF ENDIF diff --git a/harbour/src/rtl/tpersist.prg b/harbour/src/rtl/tpersist.prg index 57628b21c4..5272adacad 100644 --- a/harbour/src/rtl/tpersist.prg +++ b/harbour/src/rtl/tpersist.prg @@ -102,7 +102,7 @@ METHOD LoadFromText( cObjectText, lIgnoreErrors ) CLASS HBPersistent AAdd( aObjects, &( cLine ) ) ENDIF - CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "ENDOBJECT" + CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "ENDOBJECT" ASize( aObjects, Len( aObjects ) - 1 ) CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "ARRAY" diff --git a/harbour/src/rtl/tscalar.prg b/harbour/src/rtl/tscalar.prg index fe11f1534e..48a65b0d44 100644 --- a/harbour/src/rtl/tscalar.prg +++ b/harbour/src/rtl/tscalar.prg @@ -85,7 +85,7 @@ METHOD AsString() CLASS ScalarObject CASE "T" ; RETURN HB_TToC( Self ) CASE "H" ; RETURN "{ ... => ... }" CASE "L" ; RETURN iif( Self, ".T.", ".F." ) - CASE "N" ; RETURN hb_NToS( Self ) + CASE "N" ; RETURN hb_ntos( Self ) CASE "S" ; RETURN "@" + Self:name + "()" CASE "P" ; RETURN "<0x...>" CASE "U" ; RETURN "NIL" @@ -184,8 +184,7 @@ METHOD Copy() CLASS Array METHOD DeleteAt( n ) CLASS Array IF n > 0 .AND. n <= Len( Self ) - ADel( Self, n ) - ASize( Self, Len( Self ) - 1 ) + hb_ADel( Self, n, .T. ) ENDIF RETURN Self @@ -196,9 +195,7 @@ METHOD InsertAt( n, x ) CLASS Array ASize( Self, n ) Self[ n ] := x ELSEIF n > 0 - ASize( Self, Len( Self ) + 1 ) - AIns( Self, n ) - Self[ n ] := x + hb_AIns( Self, n, x, .T. ) ENDIF RETURN Self @@ -386,7 +383,7 @@ CREATE CLASS Numeric INHERIT HBScalar FUNCTION __HBNumeric ENDCLASS METHOD AsString() CLASS Numeric - RETURN hb_NToS( Self ) + RETURN hb_ntos( Self ) /* -------------------------------------------- */ diff --git a/harbour/tests/db_brows.prg b/harbour/tests/db_brows.prg index b431810796..61b62d3e31 100644 --- a/harbour/tests/db_brows.prg +++ b/harbour/tests/db_brows.prg @@ -158,7 +158,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) LI_MSLEN := Array( LI_COLCOUNT ) LI_MSDEC := Array( LI_COLCOUNT ) FOR i := 1 TO LI_COLCOUNT - IF ValType( LI_MSF[ i ] ) == "B" + IF HB_ISBLOCK( LI_MSF[ i ] ) vartmp := Eval( LI_MSF[ i ], mslist, i ) LI_MSTYP[ i ] := ValType( vartmp ) IF LI_MSTYP[ i ] == "C" @@ -178,7 +178,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) NEXT ENDIF ENDIF - IF ValType( LI_MSED ) == "N" + IF HB_ISNUMERIC( LI_MSED ) predxx := predit := LI_MSED ELSE predxx := predit := iif( AScan( LI_MSED, 3 ) != 0, 3, iif( AScan( LI_MSED, 2 ) != 0, 2, 1 ) ) @@ -374,9 +374,9 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) CASE ( xkey == K_ENTER .OR. !( hb_keyChar( xkey ) == "" ) ) .AND. predit > 1 fipos := LI_COLPOS + LI_NLEFT - 1 - LI_FREEZE IF LI_WHEN == NIL .OR. Len( LI_WHEN ) < fipos .OR. LI_WHEN[ fipos ] == NIL .OR. Eval( LI_WHEN[ fipos ] ) - IF !( ValType( LI_MSED ) == "N" ) + IF ! HB_ISNUMERIC( LI_MSED ) vartmp := iif( Len( LI_MSED ) < fipos, 1, LI_MSED[ fipos ] ) - IF ValType( vartmp ) == "N" + IF HB_ISNUMERIC( vartmp ) IF vartmp != 2 LOOP ENDIF @@ -411,7 +411,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey ) ENDIF ENDIF ENDIF - IF LI_BDESHOUT != NIL .AND. ValType( varbuf ) == "C" + IF LI_BDESHOUT != NIL .AND. HB_ISSTRING( varbuf ) varbuf := Eval( LI_BDESHOUT, mslist, varbuf ) ENDIF FieldPut( fipos, varbuf ) diff --git a/harbour/tests/debugtst.prg b/harbour/tests/debugtst.prg index ac60600c8d..f1ac5180d9 100644 --- a/harbour/tests/debugtst.prg +++ b/harbour/tests/debugtst.prg @@ -238,15 +238,15 @@ STATIC FUNCTION Transfer( x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 ) /* etc */ FOR n := 1 TO nLen xData := aParam[ n ] - IF ValType( xData ) == "A" + IF HB_ISARRAY( xData ) - IF ValType( xData[ 1 ] ) == "A" // 2D array passed + IF HB_ISARRAY( xData[ 1 ] ) // 2D array passed xRet := __objSetValueList( self, xData ) ELSE // 1D array passed xRet := __objSetValueList( self, { xData } ) ENDIF - ELSEIF ValType( xData ) == "O" // Object passed + ELSEIF HB_ISOBJECT( xData ) // Object passed xRet := ::Transfer( xData:Transfer() ) ELSEIF !( ValType( xData ) == "U" ) ? "TRANSFER: Incorrect argument(", n, ") ", xData diff --git a/harbour/tests/inifiles.prg b/harbour/tests/inifiles.prg index 5e10fde0f8..f916c73368 100644 --- a/harbour/tests/inifiles.prg +++ b/harbour/tests/inifiles.prg @@ -6,8 +6,14 @@ PROCEDURE Main( cFilename, cSection ) - LOCAL oIni := TIniFile():New( Default( cFilename, "harbour.ini" ) ) - LOCAL s, n := Val( Default( cSection, "1" ) ) + LOCAL oIni + LOCAL s, n + + hb_default( @cFilename, "harbour.ini" ) + hb_default( @cSection, "1" ) + + oIni := TIniFile():New( cFileName ) + n := Val( cSection ) ? ? "Sections:" @@ -142,7 +148,7 @@ STATIC FUNCTION ReadString( cSection, cIdent, cDefault ) IF Empty( cSection ) cFind := Lower( cIdent ) - j := AScan( ::Contents, {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cFind .AND. ValType( x[ 2 ] ) == "C" } ) + j := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind .AND. HB_ISSTRING( x[ 2 ] ) } ) IF j > 0 cResult := ::Contents[ j ][ 2 ] @@ -150,11 +156,11 @@ STATIC FUNCTION ReadString( cSection, cIdent, cDefault ) ELSE cFind := Lower( cSection ) - i := AScan( ::Contents, {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cFind } ) + i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind } ) IF i > 0 cFind := Lower( cIdent ) - j := AScan( ::Contents[ i ][ 2 ], {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cFind } ) + j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind } ) IF j > 0 cResult := ::Contents[ i ][ 2 ][ j ][ 2 ] @@ -174,7 +180,7 @@ STATIC PROCEDURE WriteString( cSection, cIdent, cString ) ELSEIF Empty( cSection ) cFind := Lower( cIdent ) - j := AScan( ::Contents, {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cFind .AND. ValType( x[ 2 ] ) == "C" } ) + j := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind .AND. HB_ISSTRING( x[ 2 ] ) } ) IF j > 0 ::Contents[ j ][ 2 ] := cString @@ -187,9 +193,9 @@ STATIC PROCEDURE WriteString( cSection, cIdent, cString ) ELSE cFind := Lower( cSection ) - IF ( i := AScan( ::Contents, {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cFind .AND. ValType( x[ 2 ] ) == "A" } ) ) > 0 + IF ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind .AND. HB_ISARRAY( x[ 2 ] ) } ) ) > 0 cFind := Lower( cIdent ) - j := AScan( ::Contents[ i ][ 2 ], {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cFind } ) + j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind } ) IF j > 0 ::Contents[ i ][ 2 ][ j ][ 2 ] := cString @@ -254,14 +260,13 @@ STATIC PROCEDURE DeleteKey( cSection, cIdent ) LOCAL i, j cSection := Lower( cSection ) - i := AScan( ::Contents, {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cSection } ) + i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cSection } ) IF i > 0 cIdent := Lower( cIdent ) - j := AScan( ::Contents[ i ][ 2 ], {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cIdent } ) + j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cIdent } ) - ADel( ::Contents[ i ][ 2 ], j ) - ASize( ::Contents[ i ][ 2 ], Len( ::Contents[ i ][ 2 ] ) - 1 ) + hb_ADel( ::Contents[ i ][ 2 ], j, .T. ) ENDIF RETURN @@ -272,16 +277,14 @@ STATIC PROCEDURE EraseSection( cSection ) LOCAL i IF Empty( cSection ) - DO WHILE ( i := AScan( ::Contents, {| x | ValType( x[ 1 ] ) == "C" .AND. ValType( x[ 2 ] ) == "C" } ) ) > 0 - ADel( ::Contents, i ) - ASize( ::Contents, Len( ::Contents ) - 1 ) + DO WHILE ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. HB_ISSTRING( x[ 2 ] ) } ) ) > 0 + hb_ADel( ::Contents, i, .T. ) ENDDO ELSE cSection := Lower( cSection ) - IF ( i := AScan( ::Contents, {| x | ValType( x[ 1 ] ) == "C" .AND. Lower( x[ 1 ] ) == cSection .AND. ValType( x[ 2 ] ) == "A" } ) ) > 0 - ADel( ::Contents, i ) - ASize( ::Contents, Len( ::Contents ) - 1 ) + IF ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cSection .AND. HB_ISARRAY( x[ 2 ] ) } ) ) > 0 + hb_ADel( ::Contents, i, .T. ) ENDIF ENDIF @@ -294,14 +297,14 @@ STATIC FUNCTION ReadSection( cSection ) IF Empty( cSection ) FOR i := 1 TO Len( ::Contents ) - IF ValType( ::Contents[ i ][ 1 ] ) == "C" .AND. ValType( ::Contents[ i ][ 2 ] ) == "C" + IF HB_ISSTRING( ::Contents[ i ][ 1 ] ) .AND. HB_ISSTRING( ::Contents[ i ][ 2 ] ) AAdd( aSection, ::Contents[ i ][ 1 ] ) ENDIF NEXT ELSE cSection := Lower( cSection ) - IF ( i := AScan( ::Contents, {| x | ValType(x[ 1 ] ) == "C" .AND. x[ 1 ] == cSection .AND. ValType( x[ 2 ] ) == "A" } ) ) > 0 + IF ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. x[ 1 ] == cSection .AND. HB_ISARRAY( x[ 2 ] ) } ) ) > 0 FOR j := 1 TO Len( ::Contents[ i ][ 2 ] ) @@ -321,7 +324,7 @@ STATIC FUNCTION ReadSections() FOR i := 1 TO Len( ::Contents ) - IF ValType( ::Contents[ i ][ 2 ] ) == "A" + IF HB_ISARRAY( ::Contents[ i ][ 2 ] ) AAdd( aSections, ::Contents[ i ][ 1 ] ) ENDIF NEXT @@ -339,7 +342,7 @@ STATIC PROCEDURE UpdateFile() IF ::Contents[ i ][ 1 ] == NIL FWrite( hFile, ::Contents[ i ][ 2 ] + hb_eol() ) - ELSEIF ValType( ::Contents[ i ][ 2 ] ) == "A" + ELSEIF HB_ISARRAY( ::Contents[ i ][ 2 ] ) FWrite( hFile, "[" + ::Contents[ i ][ 1 ] + "]" + hb_eol() ) FOR j := 1 TO Len( ::Contents[ i ][ 2 ] ) @@ -351,7 +354,7 @@ STATIC PROCEDURE UpdateFile() NEXT FWrite( hFile, hb_eol() ) - ELSEIF ValType( ::Contents[ i ][ 2 ] ) == "C" + ELSEIF HB_ISSTRING( ::Contents[ i ][ 2 ] ) FWrite( hFile, ::Contents[ i ][ 1 ] + "=" + ::Contents[ i ][ 2 ] + hb_eol() ) ENDIF diff --git a/harbour/tests/mathtest.prg b/harbour/tests/mathtest.prg index a680ce7567..ee90e98546 100644 --- a/harbour/tests/mathtest.prg +++ b/harbour/tests/mathtest.prg @@ -72,18 +72,18 @@ FUNCTION localmatherr( nType, cFuncname, cError, nArg1, nArg2, aInfo ) cStr += hb_ntos( nType ) + " in " + cFuncname + "(" - IF ValType( nArg1 ) == "N" + IF HB_ISNUMERIC( nArg1 ) cStr += hb_ntos( nArg1 ) ENDIF - IF ValType( nArg2 ) == "N" + IF HB_ISNUMERIC( nArg2 ) cStr += "," + hb_ntos( nArg2 ) ENDIF cStr += "):" ? cStr ? "!! " + cError - IF aInfo[HB_MATHERRORBLOCK_HANDLED] + IF aInfo[ HB_MATHERRORBLOCK_HANDLED ] ? "!! --> already handled with return value: " + ; - hb_ntos( aInfo[HB_MATHERRORBLOCK_RETVAL] ) + hb_ntos( aInfo[ HB_MATHERRORBLOCK_RETVAL ] ) RETURN 1 ENDIF diff --git a/harbour/utils/hbtest/rt_class.prg b/harbour/utils/hbtest/rt_class.prg index 80b337b69a..1db0cef756 100644 --- a/harbour/utils/hbtest/rt_class.prg +++ b/harbour/utils/hbtest/rt_class.prg @@ -109,7 +109,7 @@ PROCEDURE Main_CLASS() oValue := DTORCLASS():NEW(0) TEST_LINE( oValue:type , 0 ) /* create cross reference */ - aRef := { oValue, nil }; aRef[2] := aRef; aRef := NIL + aRef := { oValue, NIL }; aRef[2] := aRef; aRef := NIL TEST_LINE( oValue := NIL , NIL ) TEST_LINE( objHolder , NIL ) TEST_LINE( cDtorResult , "" ) @@ -122,7 +122,7 @@ PROCEDURE Main_CLASS() oValue := DTORCLASS():NEW(1) TEST_LINE( oValue:type , 1 ) /* create cross reference */ - aRef := { oValue, nil }; aRef[2] := aRef; aRef := NIL + aRef := { oValue, NIL }; aRef[2] := aRef; aRef := NIL TEST_LINE( oValue := NIL , NIL ) TEST_LINE( objHolder , NIL ) TEST_LINE( cDtorResult , "" ) @@ -135,7 +135,7 @@ PROCEDURE Main_CLASS() oValue := DTORCLASS():NEW(2) TEST_LINE( oValue:type , 2 ) /* create cross reference */ - aRef := { oValue, nil }; aRef[2] := aRef; aRef := NIL + aRef := { oValue, NIL }; aRef[2] := aRef; aRef := NIL TEST_LINE( oValue := NIL , NIL ) TEST_LINE( objHolder , NIL ) TEST_LINE( cDtorResult , "" ) @@ -148,7 +148,7 @@ PROCEDURE Main_CLASS() oValue := DTORCLASS():NEW(3) TEST_LINE( oValue:type , 3 ) /* create cross reference */ - aRef := { oValue, nil }; aRef[2] := aRef; aRef := NIL + aRef := { oValue, NIL }; aRef[2] := aRef; aRef := NIL TEST_LINE( oValue := NIL , NIL ) TEST_LINE( objHolder , NIL ) TEST_LINE( cDtorResult , "" )