diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c7a700aca6..2c32ef5127 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,58 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-09 20:03 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/hbi18n2.prg + * utils/hbi18n/hbi18n.prg + * contrib/hbformat/hbfmtcls.prg + * changed ' = ' to LEFTEQUAL() macro + + * src/rdd/hbsix/sxini.prg + * contrib/hbgd/tests/gdtestcl.prg + * contrib/hbide/idebrowse.prg + * changed ' = ' to ' Left( ... ) == ' + + * contrib/hbct/tests/csetarge.prg + * contrib/hbct/tests/trig.prg + * contrib/gtwvg/tests/wvgactivex.prg + * contrib/xhb/trpccli.prg + * contrib/xhb/trpc.prg + * contrib/hbcairo/tests/glyphdbg.prg + * contrib/hbide/hbqreportsmanager.prg + * examples/httpsrv/cgifunc.prg + * examples/httpsrv/session.prg + * ' = ' -> ' := ' + + * contrib/xhb/traceprg.prg + * contrib/xhb/ttable.prg + * contrib/hbfbird/tfirebrd.prg + * contrib/hbtip/tests/base64.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/idebrowse.prg + * examples/terminal/trm_srv.prg + * ' = ' -> ' == ' + + * contrib/xhb/tedit.prg + * ' = ' -> ' == ' (I'm unsure about this, pls correct if you know the intent) + + * contrib/xhb/hbstruct.prg + * ' = ' -> ' := ' + * formatted + + * contrib/hbtip/tests/base64.prg + * File() -> hb_FileExists() + + ; TOFIX: + - it's impossible for me to decide what the intent is in these files with ' = ' operator, + please fix them: + * contrib/hbide/idetags.prg + * contrib/xhb/tcgi.prg + - these also need to be fixed: + * contrib/hbwin/legacy.prg:298: xRet := ( ::OleValue = xArg ) /* NOTE: Intentionally using '=' operator. */ + * examples/rddado/tests/access2.prg:40: LOCATE FOR ( 'First = "Lara"' ) + + There are a ton more in gtwvw, hbnf, other examples and tests, I left them as is + 2011-05-09 19:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/memofile.c ! enabled EOF char on *nix platforms diff --git a/harbour/contrib/gtwvg/tests/wvgactivex.prg b/harbour/contrib/gtwvg/tests/wvgactivex.prg index 82e04fdf89..0099647dcc 100644 --- a/harbour/contrib/gtwvg/tests/wvgactivex.prg +++ b/harbour/contrib/gtwvg/tests/wvgactivex.prg @@ -607,7 +607,7 @@ STATIC FUNCTION ConfigureRMChart( RMChart ) RMChart:AddRegion() oRegion := RMChart:Region( 1 ) - oRegion:Footer = "http://vouch.info" + oRegion:Footer := "http://vouch.info" oRegion:AddCaption() diff --git a/harbour/contrib/hbcairo/tests/glyphdbg.prg b/harbour/contrib/hbcairo/tests/glyphdbg.prg index 1845dc503e..d6bd1d1c40 100644 --- a/harbour/contrib/hbcairo/tests/glyphdbg.prg +++ b/harbour/contrib/hbcairo/tests/glyphdbg.prg @@ -14,7 +14,7 @@ PROC main() cairo_select_font_face( hCairo, "Times", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL ) cairo_set_font_size( hCairo, 200 ) cairo_set_source_rgb( hCairo, 0, 0, 0.7 ) - + cairo_move_to( hCairo, 100, 250 ) cairo_text_path( hCairo, "Ag" ) path_debug( hCairo ) @@ -35,11 +35,11 @@ PROC path_debug( hCairo, nTolerance ) cairo_save( hCairo ) IF EMPTY( nTolerance ) - hPath = cairo_copy_path( hCairo ) + hPath := cairo_copy_path( hCairo ) ELSE cairo_save( hCairo ) cairo_set_tolerance( hCairo, nTolerance ) - hPath = cairo_copy_path_flat( hCairo ) + hPath := cairo_copy_path_flat( hCairo ) cairo_restore( hCairo ) ENDIF diff --git a/harbour/contrib/hbct/tests/csetarge.prg b/harbour/contrib/hbct/tests/csetarge.prg index 2efe428c3c..9ba2943851 100644 --- a/harbour/contrib/hbct/tests/csetarge.prg +++ b/harbour/contrib/hbct/tests/csetarge.prg @@ -239,7 +239,7 @@ local ni, nDigit qout (" 3 is Float, 4 is Boolean, 5 is Date") qout (" 6 is Block, 7 is Array, 8 is Object") qout (" 9 is unknown") - nDigit = int (oerr:subCode%10) + nDigit := int (oerr:subCode%10) qout (" Here it's a "+alltrim(str(nDigit))+", so I return a ") do case case nDigit == 0 diff --git a/harbour/contrib/hbct/tests/trig.prg b/harbour/contrib/hbct/tests/trig.prg index 3ddda30b12..8f0801ed10 100644 --- a/harbour/contrib/hbct/tests/trig.prg +++ b/harbour/contrib/hbct/tests/trig.prg @@ -244,8 +244,8 @@ ? "Testing ATN2( x, y )... where:" - x = SIN( DTOR( 30 ) ) - y = COS( DTOR( 30 ) ) + x := SIN( DTOR( 30 ) ) + y := COS( DTOR( 30 ) ) ? "x = SIN( DTOR( 30 ) ) =", x ? "y = COS( DTOR( 30 ) ) =", y ? @@ -268,4 +268,3 @@ PROCEDURE WAIT4 CLS RETURN - diff --git a/harbour/contrib/hbfbird/tfirebrd.prg b/harbour/contrib/hbfbird/tfirebrd.prg index 3677a72534..ce26c8b014 100644 --- a/harbour/contrib/hbfbird/tfirebrd.prg +++ b/harbour/contrib/hbfbird/tfirebrd.prg @@ -896,7 +896,7 @@ STATIC FUNCTION KeyField( aTables, db, dialect ) /* Check row, many tables exists in current query, so we must have only one table */ - IF Len( aTables ) = 1 + IF Len( aTables ) == 1 cTable := aTables[ 1 ] cQuery := ' select ' diff --git a/harbour/contrib/hbformat/hbfmtcls.prg b/harbour/contrib/hbformat/hbfmtcls.prg index c00eeebcaa..3edf9766ff 100644 --- a/harbour/contrib/hbformat/hbfmtcls.prg +++ b/harbour/contrib/hbformat/hbfmtcls.prg @@ -60,6 +60,8 @@ #define RF_STATE_CODE 3 #define RF_STATE_RET 4 +#define LEFTEQUAL( l, r ) ( Left( l, Len( r ) ) == r ) + /* TOFIX: 1. 'var ++' 2. '- 1' for numeric literals. @@ -312,11 +314,11 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE ENDIF cToken2 := Lower( hb_TokenGet( cLine, 2 ) ) IF Left( cToken1, 1 ) == "#" - ELSEIF nLenToken >= 4 .AND. ( ( "static" = cToken1 .AND. ; - ( "function" = cToken2 .OR. "procedure" = cToken2 ) ) .OR. ; - "function" = cToken1 .OR. "procedure" = cToken1 ; - .OR. ( "method" == cToken1 .AND. !lClass ) .OR. ; - ( "class" == cToken1 .AND. !lClass ) ) + ELSEIF nLenToken >= 4 .AND. ( ( LEFTEQUAL( "static", cToken1 ) .AND. ; + ( LEFTEQUAL( "function", cToken2 ) .OR. LEFTEQUAL( "procedure", cToken2 ) ) ) .OR. ; + LEFTEQUAL( "function", cToken1 ) .OR. LEFTEQUAL( "procedure", cToken1 ) ; + .OR. ( LEFTEQUAL( "method", cToken1 ) .AND. !lClass ) .OR. ; + ( LEFTEQUAL( "class", cToken1 ) .AND. !lClass ) ) IF nDeep == 0 nState := RF_STATE_FUNC IF "class" == cToken1 @@ -328,11 +330,15 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE ::cLineErr := cLine RETURN .F. ENDIF - ELSEIF nLenToken >= 4 .AND. ( "local" = cToken1 .OR. ; - "private" = cToken1 ; - .OR. "public" = cToken1 .OR. "field" = cToken1 ; - .OR. "static" = cToken1 .OR. "memvar" = cToken1 ; - .OR. "parameters" = cToken1 .OR. "declare" = cToken1 ) + ELSEIF nLenToken >= 4 .AND. ( ; + LEFTEQUAL( "local", cToken1 ) .OR. ; + LEFTEQUAL( "private", cToken1 ) .OR. ; + LEFTEQUAL( "public", cToken1 ) .OR. ; + LEFTEQUAL( "field", cToken1 ) .OR. ; + LEFTEQUAL( "static", cToken1 ) .OR. ; + LEFTEQUAL( "memvar", cToken1 ) .OR. ; + LEFTEQUAL( "parameters", cToken1 ) .OR. ; + LEFTEQUAL( "declare", cToken1 ) ) IF nStatePrev == RF_STATE_FUNC nState := RF_STATE_VAR ENDIF diff --git a/harbour/contrib/hbgd/tests/gdtestcl.prg b/harbour/contrib/hbgd/tests/gdtestcl.prg index 68e385fc4a..f0d18822c9 100644 --- a/harbour/contrib/hbgd/tests/gdtestcl.prg +++ b/harbour/contrib/hbgd/tests/gdtestcl.prg @@ -183,7 +183,7 @@ PROCEDURE Main() //oI4:SetColor( black ) //oI4:Say( 100, 10, "Valentina" ) - IF OS() = "Linux" + IF Left( OS(), Len( "Linux" ) ) == "Linux" oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD power", "arib____", 40, 45 ) ELSE nSecs := Seconds() diff --git a/harbour/contrib/hbide/hbqreportsmanager.prg b/harbour/contrib/hbide/hbqreportsmanager.prg index 2cbeee4515..9e4a77cc38 100644 --- a/harbour/contrib/hbide/hbqreportsmanager.prg +++ b/harbour/contrib/hbide/hbqreportsmanager.prg @@ -2488,7 +2488,7 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRectF ) sh := 0 IF drawTextType == HBQT_GRAPHICSITEM_TEXT_DRAW_ABOVE .OR. ::drawTextType == HBQT_GRAPHICSITEM_TEXT_DRAW_BELOW - textH = qPainter:font():pixelSize() + textH := qPainter:font():pixelSize() ENDIF qPix := ::pixmap() @@ -2511,13 +2511,13 @@ METHOD HqrGraphicsItem:drawImage( qPainter, qRectF ) CASE HBQT_GRAPHICSITEM_CENTER_PICTURE_TO_ITEM point:setX( point:x() + ( rc:width() - image:width() ) / 2 ) point:setY( point:y() + ( rc:height() - image:height() - textH ) / 2 ) - IF ( point:x() < 0 ) + IF point:x() < 0 cx := abs( point:x() ) cw -= 2 * cx point:setX( 0 ) ENDIF - IF ( point:y() < 0 ) - cy = abs( point:y() ) + IF point:y() < 0 + cy := abs( point:y() ) ch -= 2 * cy point:setY( 0 ) ENDIF diff --git a/harbour/contrib/hbide/idebrowse.prg b/harbour/contrib/hbide/idebrowse.prg index 7599ee370b..0991691f5a 100644 --- a/harbour/contrib/hbide/idebrowse.prg +++ b/harbour/contrib/hbide/idebrowse.prg @@ -1742,7 +1742,7 @@ METHOD IdeBrowse:create( oIde, oManager, oPanel, aInfo ) ENDIF IF !empty( ::oManager:aConxns ) - n := ascan( ::oManager:aConxns, {|e| e = ::cConxn } ) + n := ascan( ::oManager:aConxns, {|e| e == ::cConxn } ) ::cConxnFull := ::oManager:aConxns[ n ] ENDIF @@ -2435,7 +2435,7 @@ METHOD IdeBrowse:toColumn( ncIndex ) IF valtype( ncIndex ) == "C" ncIndex := upper( ncIndex ) - nIndex := ascan( ::aStruct, {|e_| e_[ 1 ] = ncIndex } ) + nIndex := ascan( ::aStruct, {|e_| Left( e_[ 1 ], Len( ncIndex ) ) == ncIndex } ) ELSE nIndex := ncIndex ENDIF diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index a4afb67996..66c87764fc 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -935,10 +935,10 @@ function hbide_toString( x, lLineFeed, lInherited, lType, cFile, lForceLineFeed s := iif( lType, "[U]=", "" ) + 'NIL' CASE ( t == "A" ) s := iif( lType, "[A]=", "" ) + "{" - IF len( x ) = 0 + IF len( x ) == 0 s += " " ELSE - s += iif( valtype( x[1] ) = "A" .or. lForceLineFeed, hb_eol(), "" ) + s += iif( valtype( x[1] ) == "A" .or. lForceLineFeed, hb_eol(), "" ) j := len( x ) FOR i := 1 TO j diff --git a/harbour/contrib/hbtip/tests/base64.prg b/harbour/contrib/hbtip/tests/base64.prg index 7404883d3d..9cd6686402 100644 --- a/harbour/contrib/hbtip/tests/base64.prg +++ b/harbour/contrib/hbtip/tests/base64.prg @@ -47,10 +47,10 @@ PROCEDURE MAIN( ... ) lUrl := .T. OTHERWISE - IF File( cData ) .AND. hInput = hSTDIN - hInput = FOpen( cData ) - ELSEIF hOutput = hSTDOUT - hOutput = FCreate( cData ) + IF hb_FileExists( cData ) .AND. hInput == hSTDIN + hInput := FOpen( cData ) + ELSEIF hOutput == hSTDOUT + hOutput := FCreate( cData ) ELSE ? "Wrong parameter", cData ? diff --git a/harbour/contrib/xhb/hbstruct.prg b/harbour/contrib/xhb/hbstruct.prg index f10c9aab44..c853528899 100644 --- a/harbour/contrib/xhb/hbstruct.prg +++ b/harbour/contrib/xhb/hbstruct.prg @@ -50,71 +50,70 @@ * */ -procedure HB_HashAddMember( aName, cType, uInit, oObj ) +PROCEDURE HB_HashAddMember( aName, cType, uInit, oObj ) - local cName + LOCAL cName - if !( cType == nil ) + IF !( cType == NIL ) - switch Upper( Left( cType, 1 ) ) + SWITCH Upper( Left( cType, 1 ) ) + CASE "S" // STRING - case "S" // STRING + IF uInit == NIL + uInit := "" + ENDIF - if uInit == nil - uInit = "" - endif + EXIT - exit + CASE "N" // NUMERIC - case "N" // NUMERIC + IF uInit == NIL + uInit := 0 + ENDIF - if uInit == nil - uInit = 0 - endif + EXIT - exit + CASE "L" // LOGICAL - case "L" // LOGICAL + IF uInit == NIL + uInit := .F. + ENDIF - if uInit == nil - uInit = .f. - endif + EXIT - exit + CASE "D" // DATE - case "D" // DATE + IF uInit == NIL + uInit := hb_SToD() + ENDIF - if uInit == nil - uInit = CtoD( "" ) - endif + EXIT - exit + CASE "C" // CODEBLOCK - case "C" // CODEBLOCK + IF uInit == NIL + uInit := {|| NIL } + ENDIF - if uInit == nil - uInit = { || nil } - endif + EXIT - exit + CASE "A" // ARRAY - case "A" // ARRAY + IF uInit == NIL + uInit := {} + ENDIF - if uInit == nil - uInit = {} - endif + EXIT - exit + CASE "O" // OBJECT + EXIT - case "O" // OBJECT - exit + ENDSWITCH - end switch + ENDIF - endif + FOR EACH cName IN aName + oObj[ cName ] := uInit + NEXT - for each cName in aName - oObj[ cName ] = uInit - next - -return + RETURN diff --git a/harbour/contrib/xhb/tedit.prg b/harbour/contrib/xhb/tedit.prg index 79d25c6622..5ea804b832 100644 --- a/harbour/contrib/xhb/tedit.prg +++ b/harbour/contrib/xhb/tedit.prg @@ -219,7 +219,7 @@ METHOD Put() CLASS THtmlControl ::cOutput += Space( 2 ) + ' NAME="' + ::Name + '"' + CRLF() ENDIF - IF ::Type = "TEXTAREA" + IF ::Type == "TEXTAREA" IF ::Rows != NIL ::cOutput += Space( 2 ) + ' ROWS="' + hb_ntos( ::Rows ) + '"' + CRLF() @@ -260,7 +260,7 @@ METHOD Put() CLASS THtmlControl ::cOutput += Space( 2 ) + ' STYLE="' + ::Style + '"' + CRLF() ENDIF - IF ::type = "IMAGE" + IF ::type == "IMAGE" IF ::Source != NIL ::cOutput += Space( 2 ) + ' SRC="' + ::Source + '"' + CRLF() @@ -272,7 +272,7 @@ METHOD Put() CLASS THtmlControl ::cOutput += Space( 2 ) + ' ALIGN="' + ::Align + '"' + CRLF() ENDIF - IF ::type = "RADIO" .or. ::type = "CHECKBOX" + IF ::type == "RADIO" .or. ::type == "CHECKBOX" IF ::Checked ::cOutput += Space( 2 ) + ' CHECKED' + CRLF() @@ -717,7 +717,7 @@ RETURN Self METHOD GetControl( cName ) CLASS THtmlForm LOCAL oRet - LOCAL nPos := Ascan( ::aControls, { | e | e:name = cName } ) + LOCAL nPos := Ascan( ::aControls, { | e | e:name == cName } ) IF nPos > 0 oRet := ::aControls[ nPos ] diff --git a/harbour/contrib/xhb/traceprg.prg b/harbour/contrib/xhb/traceprg.prg index 93c7e8aa75..9d2fe8adfb 100644 --- a/harbour/contrib/xhb/traceprg.prg +++ b/harbour/contrib/xhb/traceprg.prg @@ -68,9 +68,9 @@ FUNCTION xhb_setTrace( xTrace ) IF HB_ISLOGICAL( xTrace ) s_lSET_TRACE := xTrace ELSEIF HB_ISSTRING( xTrace ) - IF Upper( xTrace ) = "ON" + IF Upper( xTrace ) == "ON" s_lSET_TRACE := .T. - ELSEIF Upper( xTrace ) = "OFF" + ELSEIF Upper( xTrace ) == "OFF" s_lSET_TRACE := .F. ENDIF ENDIF diff --git a/harbour/contrib/xhb/trpc.prg b/harbour/contrib/xhb/trpc.prg index f21f9992c4..048b170329 100644 --- a/harbour/contrib/xhb/trpc.prg +++ b/harbour/contrib/xhb/trpc.prg @@ -649,7 +649,7 @@ METHOD Run() CLASS tRPCServeCon nSafeStatus := RPCS_STATUS_ERROR ELSE HB_MutexLock( ::mtxBusy ) - ::lCanceled = .T. + ::lCanceled := .T. HB_MutexUnlock( ::mtxBusy ) hb_inetSendAll( ::skRemote, "XHBR34") ENDIF @@ -749,7 +749,7 @@ METHOD LaunchChallenge( cUserid, cPassword ) CLASS tRPCServeCon cChallenge[ nCount ] := Chr( HB_Random(0,255 ) ) NEXT - ::nChallengeCRC = HB_Checksum( cChallenge ) + ::nChallengeCRC := HB_Checksum( cChallenge ) cChallenge := HB_Crypt( cChallenge, ::cCryptKey ) hb_inetSendAll( ::skRemote, "XHBR94" + HB_CreateLen8( Len( cChallenge ) ) + cChallenge ) @@ -980,7 +980,7 @@ METHOD FunctionRunner( cFuncName, oFunc, nMode, aParams, aDesc ) CLASS tRPCServe CASE 'C' // Vector of all results aRet := {} - ::lAllowProgress = .F. + ::lAllowProgress := .F. FOR nCount := aDesc[ 2 ] TO aDesc[ 3 ] STEP aDesc[ 4 ] IF nSubstPos > 0 aSubst[ nSubstPos ] := nCount @@ -998,7 +998,7 @@ METHOD FunctionRunner( cFuncName, oFunc, nMode, aParams, aDesc ) CLASS tRPCServe EXIT CASE 'E' // Just send confirmation at end - ::lAllowProgress = .F. + ::lAllowProgress := .F. FOR nCount := aDesc[ 2 ] TO aDesc[ 3 ] STEP aDesc[ 4 ] IF nSubstPos > 0 aSubst[ nSubstPos ] := nCount @@ -1033,7 +1033,7 @@ METHOD FunctionRunner( cFuncName, oFunc, nMode, aParams, aDesc ) CLASS tRPCServe CASE 'C' // Vector of all results aRet := {} - ::lAllowProgress = .F. + ::lAllowProgress := .F. FOR EACH oElem IN aDesc[ 2 ] IF nSubstPos > 0 aSubst[ nSubstPos ] := oElem @@ -1051,7 +1051,7 @@ METHOD FunctionRunner( cFuncName, oFunc, nMode, aParams, aDesc ) CLASS tRPCServe EXIT CASE 'E' // Just send confirmation at end - ::lAllowProgress = .F. + ::lAllowProgress := .F. FOR EACH oElem IN aDesc[ 2 ] IF nSubstPos > 0 aSubst[ nSubstPos ] := oElem diff --git a/harbour/contrib/xhb/trpccli.prg b/harbour/contrib/xhb/trpccli.prg index 9e76d0a0a5..3b619c1f60 100644 --- a/harbour/contrib/xhb/trpccli.prg +++ b/harbour/contrib/xhb/trpccli.prg @@ -254,7 +254,7 @@ METHOD ScanServers(cName) CLASS tRPCClient ENDIF HB_MutexLock( ::mtxBusy ) - ::aServers = {} + ::aServers := {} HB_MutexUnlock( ::mtxBusy ) hb_inetDGramSend( ::skUDP, ::cNetwork , ::nUdpPort, "XHBR00" + HB_Serialize( cName ) ) @@ -299,8 +299,8 @@ METHOD ScanFunctions( cFunc, cSerial ) CLASS tRPCClient cSerial := "00000000.0" ENDIF HB_MutexLock( ::mtxBusy ) - ::aFunctions = {} - ::aServers = {} + ::aFunctions := {} + ::aServers := {} HB_MutexUnlock( ::mtxBusy ) hb_inetDGramSend( ::skUDP, ::cNetwork, ::nUdpPort,; @@ -744,23 +744,23 @@ METHOD SendCall( cFunction, aParams ) CLASS tRPCClient SWITCH ::nLoopMode CASE RPC_LOOP_NONE - nReq = 0 - cType = "" + nReq := 0 + cType := "" EXIT CASE RPC_LOOP_ALLDATA - nReq = 2 - cType = "A" + nReq := 2 + cType := "A" EXIT CASE RPC_LOOP_SUMMARY - nReq = 2 - cType = "C" + nReq := 2 + cType := "C" EXIT CASE RPC_LOOP_CONFIRMATION - nReq = 2 - cType = "E" + nReq := 2 + cType := "E" EXIT END @@ -807,7 +807,7 @@ METHOD TCPAccept() CLASS tRPCClient cCode := Space(6) ::nTCPTimeBegin := INT( Seconds() * 1000 ) - nTimeLimit = Max( ::nTimeout, ::nTimeLimit ) + nTimeLimit := Max( ::nTimeout, ::nTimeLimit ) DO WHILE .T. @@ -880,7 +880,7 @@ METHOD TCPParse( cCode ) CLASS tRPCClient /* We have a reply */ CASE cCode == "XHBR31" IF hb_inetRecvAll( ::skTCP, @cOrigLen ) == Len( cOrigLen ) - nOrigLen = HB_GetLen8( cOrigLen ) + nOrigLen := HB_GetLen8( cOrigLen ) IF hb_inetRecvAll( ::skTCP, @cDataLen ) == Len( cDataLen ) nDataLen := HB_GetLen8( cDataLen ) cData := Space( nDataLen ) @@ -928,7 +928,7 @@ METHOD TCPParse( cCode ) CLASS tRPCClient IF hb_inetRecvAll( ::skTCP, @cProgress ) == Len( cProgress ) nProgress := HB_Deserialize( cProgress, Len( cProgress ) ) IF nProgress != NIL .and. hb_inetRecvAll( ::skTCP, @cOrigLen ) == Len( cOrigLen ) - nOrigLen = HB_GetLen8( cOrigLen ) + nOrigLen := HB_GetLen8( cOrigLen ) IF hb_inetRecvAll( ::skTCP, @cDataLen ) == Len( cDataLen ) nDataLen := HB_GetLen8( cDataLen ) cData := Space( nDataLen ) diff --git a/harbour/contrib/xhb/ttable.prg b/harbour/contrib/xhb/ttable.prg index 916c94d43e..70d93f6155 100644 --- a/harbour/contrib/xhb/ttable.prg +++ b/harbour/contrib/xhb/ttable.prg @@ -92,7 +92,7 @@ FUNCTION NetDbUse( cDataBase, cAlias, nSeconds, cDriver, ; slNetOk := .F. nSeconds *= 1.00 - lforever := ( nSeconds = 0 ) + lforever := ( nSeconds == 0 ) KEYBOARD CHR( 255 ) INKEY() diff --git a/harbour/examples/httpsrv/cgifunc.prg b/harbour/examples/httpsrv/cgifunc.prg index ecb62caa0a..0579a7f0bb 100644 --- a/harbour/examples/httpsrv/cgifunc.prg +++ b/harbour/examples/httpsrv/cgifunc.prg @@ -695,7 +695,7 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd) nTemp := nTotalSec - FOR nCtr = 1 to 4 + FOR nCtr := 1 to 4 nConstant := IF(nCtr == 1, 86400, IF(nCtr == 2, 3600, IF( nCtr == 3, 60, 1))) aRetVal[nCtr,1] := INT(nTemp/nConstant) aRetval[nCtr,2] := nTotalSec / nConstant diff --git a/harbour/examples/httpsrv/session.prg b/harbour/examples/httpsrv/session.prg index 2ee22b3056..d5aecafffc 100644 --- a/harbour/examples/httpsrv/session.prg +++ b/harbour/examples/httpsrv/session.prg @@ -766,7 +766,7 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd) nTemp := nTotalSec - FOR nCtr = 1 to 4 + FOR nCtr := 1 to 4 nConstant := IF(nCtr == 1, 86400, IF(nCtr == 2, 3600, IF( nCtr == 3, 60, 1))) aRetVal[nCtr,1] := INT(nTemp/nConstant) aRetval[nCtr,2] := nTotalSec / nConstant diff --git a/harbour/examples/terminal/trm_srv.prg b/harbour/examples/terminal/trm_srv.prg index 23516292d6..6cacc160c6 100644 --- a/harbour/examples/terminal/trm_srv.prg +++ b/harbour/examples/terminal/trm_srv.prg @@ -318,13 +318,13 @@ PROCEDURE Progress( nProgress, nDrow, nDcol ) DispOutAt( nDrow, nDcol, "[ ]" ) DO CASE - CASE nProgress = 0 + CASE nProgress == 0 DispOutAt( nDrow, nDcol+1, "-" ) - CASE nProgress = 1 + CASE nProgress == 1 DispOutAt( nDrow, nDcol+1, "\" ) - CASE nProgress = 2 + CASE nProgress == 2 DispOutAt( nDrow, nDcol+1, "|" ) - CASE nProgress = 3 + CASE nProgress == 3 DispOutAt( nDrow, nDcol+1, "/" ) ENDCASE @@ -347,13 +347,13 @@ PROCEDURE Looping( nProgress, nDrow, nDcol ) DispOutAt( nDrow, nDcol, "[ ]" ) DO CASE - CASE nProgress = 0 + CASE nProgress == 0 DispOutAt( nDrow, nDcol+1, "-" ) - CASE nProgress = 1 + CASE nProgress == 1 DispOutAt( nDrow, nDcol+1, "\" ) - CASE nProgress = 2 + CASE nProgress == 2 DispOutAt( nDrow, nDcol+1, "|" ) - CASE nProgress = 3 + CASE nProgress == 3 DispOutAt( nDrow, nDcol+1, "/" ) ENDCASE diff --git a/harbour/src/rdd/hbsix/sxini.prg b/harbour/src/rdd/hbsix/sxini.prg index dd6630e352..e73524395c 100644 --- a/harbour/src/rdd/hbsix/sxini.prg +++ b/harbour/src/rdd/hbsix/sxini.prg @@ -85,8 +85,8 @@ FUNCTION _sx_INIinit( nArea ) * by workarea number. In Harbour we are using hash arrays. */ - IF Type( "SxIniInfo" ) = "U" /* NOTE: Intentionally using '=' operator */ - public SxIniInfo := {=>} + IF Left( Type( "SxIniInfo" ), 1 ) == "U" + PUBLIC SxIniInfo := { => } HB_HCaseMatch( SxIniInfo, .F. ) HB_HAutoAdd( SxIniInfo, HB_HAUTOADD_ASSIGN ) ENDIF diff --git a/harbour/src/rtl/hbi18n2.prg b/harbour/src/rtl/hbi18n2.prg index 2c8a3ba107..b838beda72 100644 --- a/harbour/src/rtl/hbi18n2.prg +++ b/harbour/src/rtl/hbi18n2.prg @@ -65,6 +65,7 @@ #define _I18N_EOL chr( 10 ) #define _I18N_DELIM ( chr( 0 ) + chr( 3 ) + chr( 0 ) ) +#define LEFTEQUAL( l, r ) ( Left( l, Len( r ) ) == r ) STATIC FUNCTION __I18N_fileName( cFile ) LOCAL cExt @@ -146,8 +147,8 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) IF lCont cValue += hb_eol() ELSE - IF cLine = "#" .AND. nMode == _I18N_NONE - IF cLine = "#:" // source code references + IF LEFTEQUAL( cLine, "#" ) .AND. nMode == _I18N_NONE + IF LEFTEQUAL( cLine, "#:" ) // source code references IF Empty( aItem[ _I18N_SOURCE ] ) aItem[ _I18N_SOURCE ] := "" ELSE @@ -155,7 +156,7 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) ENDIF aItem[ _I18N_SOURCE ] += strtran( ltrim( substr( cLine, 3 ) ), "\", "/" ) /* - ELSEIF cLine = "#," // flags + ELSEIF LEFTEQUAL( cLine, "#," ) // flags cLine := ltrim( substr( cLine, 3 ) ) IF cLine == "c-format" ELSE @@ -165,11 +166,11 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) */ ENDIF cLine := "" - ELSEIF cLine = "msgctxt " .AND. nMode == _I18N_NONE + ELSEIF LEFTEQUAL( cLine, "msgctxt " ) .AND. nMode == _I18N_NONE cLine := ltrim( substr( cLine, 9 ) ) nMode := _I18N_CONTEXT cValue := NIL - ELSEIF cLine = "msgid " .AND. ; + ELSEIF LEFTEQUAL( cLine, "msgid " ) .AND. ; ( nMode == _I18N_NONE .OR. nMode == _I18N_CONTEXT ) nIndex := 1 cLine := ltrim( substr( cLine, 7 ) ) @@ -182,7 +183,7 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) ENDIF nMode := _I18N_MSGID cValue := NIL - ELSEIF cLine = "msgid_plural" .AND. nMode == _I18N_MSGID + ELSEIF LEFTEQUAL( cLine, "msgid_plural" ) .AND. nMode == _I18N_MSGID nOldIndex := nIndex nIndex := 2 n := 13 @@ -208,7 +209,7 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) AAdd( aItem[ _I18N_MSGID ], cValue ) cLine := ltrim( substr( cLine, n ) ) cValue := NIL - ELSEIF cLine = "msgstr " .AND. nMode == _I18N_MSGID + ELSEIF LEFTEQUAL( cLine, "msgstr " ) .AND. nMode == _I18N_MSGID nIndex := 0 cLine := ltrim( substr( cLine, 8 ) ) nMode := _I18N_MSGSTR @@ -218,7 +219,7 @@ FUNCTION __I18N_POTARRAYLOAD( cFile, cErrorMsg ) ENDIF AAdd( aItem[ _I18N_MSGID ], cValue ) cValue := NIL - ELSEIF cLine = "msgstr[" .AND. ; + ELSEIF LEFTEQUAL( cLine, "msgstr[" ) .AND. ; ( nMode == _I18N_MSGID .OR. nMode == _I18N_MSGSTR ) nOldIndex := IIF( nMode == _I18N_MSGSTR, nIndex, -1 ) nIndex := 0 diff --git a/harbour/utils/hbi18n/hbi18n.prg b/harbour/utils/hbi18n/hbi18n.prg index e7e1f9969e..284f360a4a 100644 --- a/harbour/utils/hbi18n/hbi18n.prg +++ b/harbour/utils/hbi18n/hbi18n.prg @@ -57,6 +57,8 @@ #define _HB_I18N_GENHBL 2 #define _HB_I18N_TRANS 3 +#define LEFTEQUAL( l, r ) ( Left( l, Len( r ) ) == r ) + ANNOUNCE HB_GTSYS REQUEST HB_GT_CGI_DEFAULT @@ -76,7 +78,7 @@ PROCEDURE Main( ... ) aFiles := {} nMode := 0 FOR n := 1 TO Len( aParams ) - IF aParams[ n ] = "-" + IF LEFTEQUAL( aParams[ n ], "-" ) param := SubStr( aParams[ n ], 2 ) IF param == "m" IF nMode != 0 @@ -96,7 +98,7 @@ PROCEDURE Main( ... ) ELSE nMode := _HB_I18N_TRANS ENDIF - ELSEIF param = "o" + ELSEIF LEFTEQUAL( param, "o" ) IF !Empty( param := SubStr( param, 2 ) ) cFileOut := param ELSEIF n < Len( aParams ) .AND. aParams[ n + 1 ] != "-"