2012-10-04 13:20 UTC+0200 Viktor Szakats (harbour syenar.net)

- tests/testtok.prg
    - deleted obsolete token test code

  * contrib/hbformat/hbfmtcls.prg
  * contrib/hbgd/tests/test_out.prg
  * contrib/hbhttpd/core.prg
  * contrib/hbmxml/tests/custom.prg
  * contrib/hbmxml/tests/testmxml.prg
  * contrib/hbnf/ftround.prg
  * contrib/hbpgsql/tpostgre.prg
  * contrib/hbtip/ftpcli.prg
  * extras/gfspell/spell.prg
  * extras/gtwvw/tests/ebtest7.prg
  * extras/hbvpdf/hbvpdf.prg
  * extras/hbvpdf/hbvpdft.prg
  * extras/httpsrv/cgifunc.prg
  * extras/httpsrv/session.prg
  * extras/httpsrv/uhttpd.prg
  * src/debug/dbgtmenu.prg
  * src/debug/debugger.prg
  * tests/db_brows.prg
  * tests/inherit.prg
  * tests/rto_tb.prg
  * tests/stripem.prg
  * utils/hbi18n/hbi18n.prg
    ! fixed/avoided != operator on strings
This commit is contained in:
Viktor Szakats
2012-10-04 11:22:13 +00:00
parent c0dc8c254d
commit 4c8277ea01
24 changed files with 159 additions and 166 deletions

View File

@@ -16,6 +16,34 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-04 13:20 UTC+0200 Viktor Szakats (harbour syenar.net)
- tests/testtok.prg
- deleted obsolete token test code
* contrib/hbformat/hbfmtcls.prg
* contrib/hbgd/tests/test_out.prg
* contrib/hbhttpd/core.prg
* contrib/hbmxml/tests/custom.prg
* contrib/hbmxml/tests/testmxml.prg
* contrib/hbnf/ftround.prg
* contrib/hbpgsql/tpostgre.prg
* contrib/hbtip/ftpcli.prg
* extras/gfspell/spell.prg
* extras/gtwvw/tests/ebtest7.prg
* extras/hbvpdf/hbvpdf.prg
* extras/hbvpdf/hbvpdft.prg
* extras/httpsrv/cgifunc.prg
* extras/httpsrv/session.prg
* extras/httpsrv/uhttpd.prg
* src/debug/dbgtmenu.prg
* src/debug/debugger.prg
* tests/db_brows.prg
* tests/inherit.prg
* tests/rto_tb.prg
* tests/stripem.prg
* utils/hbi18n/hbi18n.prg
! fixed/avoided != operator on strings
2012-10-04 12:47 UTC+0200 Viktor Szakats (harbour syenar.net)
* src/rtl/tget.prg
! fixed regression from 2012-01-29 17:22 UTC+0100

View File

@@ -155,7 +155,7 @@ METHOD New( aParams, cIniName ) CLASS HBFORMATCODE
NEXT
ENDIF
IF Right( ::cCommands, 1 ) != ","
IF !( Right( ::cCommands, 1 ) == "," )
::cCommands += ","
ENDIF
::cCommands += "IF,ELSEIF,ELSE,ENDIF,END,DO,WHILE,ENDDO,WITH,CASE,OTHERWISE,ENDCASE,BEGIN," +;
@@ -165,7 +165,7 @@ METHOD New( aParams, cIniName ) CLASS HBFORMATCODE
"LOOP,MENU,NEXT,PACK,PRINT,QUIT,READ,RECALL,REINDEX,RELEASE,RENAME,REQUEST,REPLACE,RESTORE," +;
"RUN,SAVE,SEEK,SELECT,SET,SKIP,SORT,STORE,SUM,TEXT,TOTAL,UNLOCK,USE,WAIT,ZAP,"
IF Right( ::cClauses, 1 ) != ","
IF !( Right( ::cClauses, 1 ) == "," )
::cClauses += ","
ENDIF
::cClauses += "ADDITIVE,ALIAS,ALL,BLANK,BOTTOM,BOX,COLOR,DATE,DELETED,EACH,EXTENDED,EXCLUSIVE,FROM,GET," +;
@@ -173,7 +173,7 @@ METHOD New( aParams, cIniName ) CLASS HBFORMATCODE
"EXACT,EXCLUSIVE,FILTER,FIXED,FORMAT,INTENSITY,KEY,LIKE,MARGIN,MESSAGE,NEW,OFF,ON,ORDER,PATH,PICTURE,PRINTER,PROMPT," +;
"PROTECTED,RELATION,SCOREBOARD,SEQUENCE,SOFTSEEK,STEP,STRUCTURE,TYPEAHEAD,UNIQUE,WRAP,TAG,TO,TOP,VALID,WHEN,"
IF Right( ::cFunctions, 1 ) != ","
IF !( Right( ::cFunctions, 1 ) == "," )
::cFunctions += ","
ENDIF
IF !( ",STR," $ Upper( ::cFunctions ) )
@@ -289,7 +289,7 @@ METHOD Reformat( aFile ) CLASS HBFORMATCODE
nLineSegment := 1
DO WHILE .T.
nPos := nPosSep
IF Left( aFile[ i ], 1 ) != "#" .AND. ;
IF !( Left( aFile[ i ], 1 ) == "#" ) .AND. ;
( nPosSep := FindNotQuoted( ";", aFile[ i ], nPosSep ) ) != 0 .AND. ;
nPosSep < Len( aFile[ i ] ) .AND. ( nPosComment == 0 .OR. nPosSep < nPosComment )
cLine := SubStr( aFile[ i ], nPos, nPosSep - nPos + 1 )
@@ -581,7 +581,7 @@ METHOD FormatLine( cLine, lContinued ) CLASS HBFORMATCODE
nA := i
ENDIF
nState := FL_STATE_ANY
ELSEIF c == "!" .AND. SubStr( cLine, i + 1, 1 ) != "="
ELSEIF c == "!" .AND. !( SubStr( cLine, i + 1, 1 ) == "=" )
IF nState == FL_STATE_STRING
IF nEnd == nBegin
nEnd := i
@@ -610,12 +610,12 @@ METHOD FormatLine( cLine, lContinued ) CLASS HBFORMATCODE
lFirst := .F.
ENDIF
IF !( "|" + SubStr( cLine, nB, 2 ) + "|" $ "|--|++|->|" )
IF nA != 0 .AND. ::lSpaces .AND. nA < nLen .AND. SubStr( cLine, nA + 1, 1 ) != " "
IF nA != 0 .AND. ::lSpaces .AND. nA < nLen .AND. !( SubStr( cLine, nA + 1, 1 ) == " " )
cLine := Left( cLine, nA ) + " " + SubStr( cLine, nA + 1 )
nLen++
i++
ENDIF
IF nB != 0 .AND. ::lSpaces .AND. nB > 1 .AND. SubStr( cLine, nB - 1, 1 ) != " "
IF nB != 0 .AND. ::lSpaces .AND. nB > 1 .AND. !( SubStr( cLine, nB - 1, 1 ) == " " )
cLine := Left( cLine, nB - 1 ) + " " + SubStr( cLine, nB )
nLen++
i++
@@ -747,7 +747,7 @@ METHOD SetOption( cLine, i, aIni ) CLASS HBFORMATCODE
ELSE
::nErr := 3
ENDIF
IF ::nErr == 0 .AND. ValType( xRes ) != Left( cToken1, 1 )
IF ::nErr == 0 .AND. !( ValType( xRes ) == Left( cToken1, 1 ) )
::nErr := 4
ENDIF
ELSE
@@ -774,7 +774,7 @@ METHOD ReadIni( cIniName ) CLASS HBFORMATCODE
nLen := Len( aIni )
FOR i := 1 TO nLen
IF ! Empty( aIni[ i ] := AllTrim( aIni[ i ] ) ) .AND. ;
( c := Left( aIni[ i ], 1 ) ) != ";" .AND. c != "#"
!( ( c := Left( aIni[ i ], 1 ) ) == ";" ) .AND. !( c == "#" )
IF ! ::SetOption( aIni[ i ], @i, aIni )
EXIT
ENDIF
@@ -807,14 +807,14 @@ METHOD Array2File( cFileName, aFile ) CLASS HBFORMATCODE
cName := iif( ( i := RAt( ".", cFileName ) ) == 0, cFileName, SubStr( cFileName, 1, i - 1 ) )
IF Empty( ::cExtSave )
cBakName := cName + iif( Left( ::cExtBack, 1 ) != ".", ".", "" ) + ::cExtBack
cBakName := cName + iif( Left( ::cExtBack, 1 ) == ".", "", "." ) + ::cExtBack
IF hb_FCopy( cFileName, cBakName ) == F_ERROR
RETURN .F.
ENDIF
ENDIF
IF ! Empty( ::cExtSave )
cFileName := cName + iif( Left( ::cExtSave, 1 ) != ".", ".", "" ) + ::cExtSave
cFileName := cName + iif( Left( ::cExtSave, 1 ) == ".", "", "." ) + ::cExtSave
ENDIF
IF ::lFCaseLow
cPath := iif( ( i := RAt( "\", cFileName ) ) == 0, ;

View File

@@ -67,19 +67,19 @@ PROCEDURE Main( ... )
//
//hb_default( @cText, "Testo di Prova" )
//hb_default( @cText, "Testo di Prova" )
hb_default( @nPt, 30 )
IF cImg != NIL
//OutJpg( cImg, nPt )
//OutJpg( cImg, nPt )
OutPhoto( cImg, nWidth, nHeight )
ELSEIF cPhoto != NIL
StartHTML()
//OutHTML ValToPrg( hParams ) + "<br>"
//OutHTML ValToPrg( cParams ) + "<br>"
//OutHTML ValToPrg( cQuery ) + "<br>"
//OutHTML "<img src='test_out.exe?img=" + cPhoto + "&width=" + hb_ntos( nWidth ) + "&height=" + hb_ntos( nHeight ) + "'>" + "<br>"
//OutHTML ValToPrg( hParams ) + "<br>"
//OutHTML ValToPrg( cParams ) + "<br>"
//OutHTML ValToPrg( cQuery ) + "<br>"
//OutHTML "<img src='test_out.exe?img=" + cPhoto + "&width=" + hb_ntos( nWidth ) + "&height=" + hb_ntos( nHeight ) + "'>" + "<br>"
OutHTML "<table border=1>"
OutHTML "<tr><td align='center'>"
OutHTML "<img src='test_out.exe?img=" + cPhoto + "'>" + "<br>"
@@ -95,9 +95,9 @@ PROCEDURE Main( ... )
OutHTML "</td></tr>"
OutHTML "</table>"
OutHTML "<br>"
//OutHTML "<img src='test_out.exe?img=" + cText + "_2&pt=" + hb_ntos( nPt ) + "'>" + "<br>"
//OutHTML OS() + "<br>"
//OutHTML iif( OS_ISWINNT(), "WIN NT", "NON WIN NT" ) + "<br>"
//OutHTML "<img src='test_out.exe?img=" + cText + "_2&pt=" + hb_ntos( nPt ) + "'>" + "<br>"
//OutHTML OS() + "<br>"
//OutHTML iif( OS_ISWINNT(), "WIN NT", "NON WIN NT" ) + "<br>"
EndHTML()
ELSE
StartHTML()
@@ -180,10 +180,10 @@ PROCEDURE OutJpg( cText, nPitch )
oI := GDImage( 400, 100 )
/* Allocate background */
// cyan := oI:SetColor( 0, 255, 255 )
// cyan := oI:SetColor( 0, 255, 255 )
/* Allocate drawing color */
// blue := oI:SetColor( 0, 0, 200 )
// blue := oI:SetColor( 0, 0, 200 )
//oI:SetTransparent( blue )
oI:SetFontName( cFont )
@@ -293,10 +293,10 @@ FUNCTION GetParams( aParams )
RETURN hHashVars
//***********************************************************
// Decoding URL
// Can return both a string or a number
//
//***********************************************************
// Decoding URL
// Can return both a string or a number
//
FUNCTION URLDecode( cStr )
@@ -321,7 +321,7 @@ FUNCTION URLDecode( cStr )
ENDCASE
// IF (cRet[ i ] > "9" .or. cRet[ i ] < "0") .and. cRet[ i ] != "."
// IF ( cRet[ i ] > "9" .or. cRet[ i ] < "0" ) .AND. !( cRet[ i ] == "." )
// lNumeric := .F.
// ENDIF
NEXT

View File

@@ -87,7 +87,7 @@ METHOD RUN( hConfig ) CLASS UHttpd
"FirewallFilter" => "0.0.0.0/0" }
FOR EACH xValue IN hConfig
IF ! HB_HHasKey( Self:hConfig, xValue:__enumKey ) .OR. ValType( xValue ) != ValType( Self:hConfig[xValue:__enumKey] )
IF ! HB_HHasKey( Self:hConfig, xValue:__enumKey ) .OR. !( ValType( xValue ) == ValType( Self:hConfig[ xValue:__enumKey ] ) )
Self:cError := "Invalid config option '" + xValue:__enumKey + "'"
RETURN .F.
ENDIF
@@ -1440,7 +1440,7 @@ PROCEDURE UProcFiles( cFileName, lIndex )
UWrite( HB_MEMOREAD( UOsFileName(cFileName ) ) )
ENDIF
ELSEIF HB_DirExists( UOsFileName( cFileName ) )
IF Right( cFileName, 1 ) != "/"
IF !( Right( cFileName, 1 ) == "/" )
URedirect( "http://" + server["HTTP_HOST"] + server["SCRIPT_NAME"] + "/" )
RETURN
ENDIF
@@ -1551,14 +1551,14 @@ STATIC FUNCTION parse_data( aData, aCode, hConfig )
cExtend := NIL
cRet := ""
FOR EACH aInstr IN aCode
SWITCH aInstr[1]
SWITCH aInstr[ 1 ]
CASE "txt"
cRet += aInstr[2]
cRet += aInstr[ 2 ]
EXIT
CASE "="
IF HB_HHasKey( aData, aInstr[2] )
xValue := aData[aInstr[2]]
IF HB_HHasKey( aData, aInstr[ 2 ] )
xValue := aData[ aInstr[ 2 ] ]
IF HB_ISSTRING( xValue )
cRet += UHtmlEncode( xValue )
ELSEIF HB_ISNUMERIC( xValue )
@@ -1573,13 +1573,13 @@ STATIC FUNCTION parse_data( aData, aCode, hConfig )
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: invalid type '%s'", ValType( xValue ) ) )
ENDIF
ELSE
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: variable '%s' not found", aInstr[2] ) )
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: variable '%s' not found", aInstr[ 2 ] ) )
ENDIF
EXIT
CASE ":"
IF HB_HHasKey( aData, aInstr[2] )
xValue := aData[aInstr[2]]
IF HB_HHasKey( aData, aInstr[ 2 ] )
xValue := aData[ aInstr[ 2 ] ]
IF HB_ISSTRING( xValue )
cRet += xValue
ELSEIF HB_ISNUMERIC( xValue )
@@ -1594,44 +1594,44 @@ STATIC FUNCTION parse_data( aData, aCode, hConfig )
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: invalid type '%s'", ValType( xValue ) ) )
ENDIF
ELSE
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: variable '%s' not found", aInstr[2] ) )
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: variable '%s' not found", aInstr[ 2 ] ) )
ENDIF
EXIT
CASE "if"
xValue := iif( HB_HHasKey( aData, aInstr[2] ), aData[aInstr[2]], NIL )
xValue := iif( HB_HHasKey( aData, aInstr[ 2 ] ), aData[ aInstr[ 2 ] ], NIL )
IF ! Empty( xValue )
cRet += parse_data( aData, aInstr[3], hConfig )
cRet += parse_data( aData, aInstr[ 3 ], hConfig )
ELSE
cRet += parse_data( aData, aInstr[4], hConfig )
cRet += parse_data( aData, aInstr[ 4 ], hConfig )
ENDIF
EXIT
CASE "loop"
IF HB_HHasKey( aData, aInstr[2] ) .AND. HB_ISARRAY( aValue := aData[aInstr[2]] )
IF HB_HHasKey( aData, aInstr[ 2 ] ) .AND. HB_ISARRAY( aValue := aData[ aInstr[ 2 ] ] )
FOR EACH xValue IN aValue
aData2 := HB_HCLONE( aData )
HB_HEVAL( xValue, {| k, v | aData2[aInstr[2] + "." + k] := v } )
aData2[aInstr[2] + ".__index"] := xValue:__enumIndex
cRet += parse_data( aData2, aInstr[3], hConfig )
HB_HEVAL( xValue, {| k, v | aData2[ aInstr[ 2 ] + "." + k ] := v } )
aData2[ aInstr[ 2 ] + ".__index"] := xValue:__enumIndex
cRet += parse_data( aData2, aInstr[ 3 ], hConfig )
aData2 := NIL
NEXT
ELSE
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: loop variable '%s' not found", aInstr[2] ) )
Eval( hConfig[ "Trace" ], HB_STRFORMAT( "Template error: loop variable '%s' not found", aInstr[ 2 ] ) )
ENDIF
EXIT
CASE "extend"
cExtend := aInstr[2]
cExtend := aInstr[ 2 ]
EXIT
CASE "include"
cRet += parse_data( aData, compile_file( aInstr[2], hConfig ), hConfig )
cRet += parse_data( aData, compile_file( aInstr[ 2 ], hConfig ), hConfig )
EXIT
ENDSWITCH
NEXT
IF cExtend != NIL
aData[""] := cRet
aData[ "" ] := cRet
cRet := ""
aCode := compile_file( cExtend, hConfig )
ENDIF

View File

@@ -30,7 +30,7 @@ PROCEDURE main()
RETURN
ENDIF
IF hb_md5( _ENCODE( node ) ) != mxmlElementGetAttr( node, "checksum" )
IF !( hb_md5( _ENCODE( node ) ) == mxmlElementGetAttr( node, "checksum" ) )
OutErr( "Custom data of element <hash> is corrupted!" )
mxmlDelete( tree )

View File

@@ -82,7 +82,7 @@ PROCEDURE Main( cFileArg )
ENDIF
cStr := mxmlGetElement( hTree )
IF cStr != "element"
IF !( cStr == "element" )
OutErr( hb_strFormat( "ERROR: Parent value is '%s', expected 'element'", cStr ) + hb_eol() )
mxmlDelete( hTree )
@@ -215,7 +215,7 @@ PROCEDURE Main( cFileArg )
ENDIF
cStr := mxmlGetText( hNode, @nNum )
IF nNum != 1 .OR. Empty( cStr ) .OR. cStr != "text"
IF nNum != 1 .OR. Empty( cStr ) .OR. !( cStr == "text" )
OutErr( hb_strFormat( "ERROR: Fourth child value is %d, '%s', expected 1, 'text'!", ;
nNum, cStr ) + hb_eol() )
@@ -259,7 +259,7 @@ PROCEDURE Main( cFileArg )
mxmlDelete( hTree )
ErrorLevel( 1 )
QUIT
ELSEIF mxmlGetType( hNode ) != MXML_OPAQUE .OR. mxmlGetOpaque( hNode ) != "value"
ELSEIF mxmlGetType( hNode ) != MXML_OPAQUE .OR. !( mxmlGetOpaque( hNode ) == "value" )
OutErr( "ERROR: Bad value for '*/two'." + hb_eol() )
mxmlDelete( hTree )
@@ -274,7 +274,7 @@ PROCEDURE Main( cFileArg )
mxmlDelete( hTree )
ErrorLevel( 1 )
QUIT
ELSEIF mxmlGetType( hNode ) != MXML_OPAQUE .OR. mxmlGetOpaque( hNode ) != "value"
ELSEIF mxmlGetType( hNode ) != MXML_OPAQUE .OR. !( mxmlGetOpaque( hNode ) == "value" )
OutErr( "ERROR: Bad value for 'foo/*/two'." + hb_eol() )
mxmlDelete( hTree )
@@ -289,7 +289,7 @@ PROCEDURE Main( cFileArg )
mxmlDelete( hTree )
ErrorLevel( 1 )
QUIT
ELSEIF mxmlGetType( hNode ) != MXML_OPAQUE .OR. mxmlGetOpaque( hNode ) != "value"
ELSEIF mxmlGetType( hNode ) != MXML_OPAQUE .OR. !( mxmlGetOpaque( hNode ) == "value" )
OutErr( "ERROR: Bad value for 'foo/bar/one/two'." + hb_eol() )
mxmlDelete( hTree )

View File

@@ -44,8 +44,8 @@ FUNCTION FT_ROUND( nNumber, nRoundToAmount, cRoundType, cRoundDirection, ;
// Are We Rounding to the Nearest Whole
// Number or to Zero Decimal Places??
IF ( Left( cRoundType, 1 ) != NEAREST_WHOLE_NUMBER .AND. ;
( nRoundToAmount := Int( nRoundToAmount ) ) != 0 )
IF !( Left( cRoundType, 1 ) == NEAREST_WHOLE_NUMBER ) .AND. ;
( nRoundToAmount := Int( nRoundToAmount ) ) != 0
// No, Are We Rounding to the Nearest
// Decimal Place??
@@ -58,8 +58,7 @@ FUNCTION FT_ROUND( nNumber, nRoundToAmount, cRoundType, cRoundDirection, ;
// Are We Already Within the Acceptable
// Error Factor??
IF ( Abs( Int( nResult * nRoundToAmount ) - ( nResult * nRoundToAmount ) ) > ;
nAcceptableError )
IF Abs( Int( nResult * nRoundToAmount ) - ( nResult * nRoundToAmount ) ) > nAcceptableError
// No, Are We Rounding Down??
nResult -= iif( Left( cRoundDirection, 1 ) == ROUND_DOWN, ;
; // Yes, Make Downward Adjustment

View File

@@ -509,7 +509,7 @@ CREATE CLASS TPQQuery
METHOD Append( oRow )
METHOD SetKey()
METHOD Changed( nField ) INLINE ::aRow[ nField ] != ::aOld[ nField ]
METHOD Changed( nField ) INLINE !( ::aRow[ nField ] == ::aOld[ nField ] )
METHOD Blank() INLINE ::GetBlankRow()
METHOD Struct()

View File

@@ -215,7 +215,7 @@ METHOD GetReply() CLASS tIPClientFTP
ENDDO
// 4 and 5 are error codes
IF ::InetErrorCode( ::SocketCon ) != 0 .OR. Left( ::cReply, 1 ) >= "4"
IF ::InetErrorCode( ::SocketCon ) != 0 .OR. Val( Left( ::cReply, 1 ) ) >= 4
RETURN .F.
ENDIF

View File

@@ -1588,8 +1588,8 @@ else
if nPatSize == nStrSize
lMatch := .T.
for y := 1 to nPatSize
if substr(cPattern,y,1)!="?" .and. ;
substr(cPattern,y,1)!= substr(cString,y,1)
if !(substr(cPattern,y,1)=="?") .and. ;
!(substr(cPattern,y,1)== substr(cString,y,1))
lMatch := .F.
exit
endif

View File

@@ -531,7 +531,7 @@ return NIL
/************* borrowed and modified from minigui *************/
//from h_textbox.prg
static PROCEDURE ProcessCharMask ( mnwinnum, mnebid, mcvaltype, mcpict )
static PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
Local InBuffer , OutBuffer := '' , icp , x , CB , CM , BadEntry := .F. , InBufferLeft , InBufferRight , Mask , OldChar , BackInbuffer
Local pc := 0
Local fnb := 0
@@ -560,28 +560,28 @@ Local ol := 0
pFlag := .F. //x for clarity
if mcvaltype=="N"
// RL 104
If Left ( AllTrim(InBuffer) , 1 ) == '-' .And. Val(InBuffer) == 0
If Left( AllTrim(InBuffer) , 1 ) == '-' .And. Val(InBuffer) == 0
NegativeZero := .T.
EndIf
If Pcount() > 1
// Point Count For Numeric InputMask
For x := 1 To Len ( InBuffer )
CB := SubStr (InBuffer , x , 1 )
For x := 1 To Len( InBuffer )
CB := SubStr(InBuffer , x , 1 )
If CB == '.' .or. CB == ','
pc++
EndIf
Next x
// RL 89
If left (InBuffer,1) == '.' .or. left (InBuffer,1) == ','
If left( InBuffer, 1 ) == '.' .or. left( InBuffer, 1 ) == ','
pFlag := .T.
EndIf
// Find First Non-Blank Position
For x := 1 To Len ( InBuffer )
CB := SubStr (InBuffer , x , 1 )
If CB != ' '
For x := 1 To Len( InBuffer )
CB := SubStr( InBuffer , x , 1 )
If !( CB == " " )
fnb := x
Exit
EndIf
@@ -591,12 +591,12 @@ Local ol := 0
BackInBuffer := InBuffer
OldChar := SubStr ( InBuffer , icp+1 , 1 )
OldChar := SubStr( InBuffer , icp+1 , 1 )
If Len ( InBuffer ) < Len ( Mask )
InBufferLeft := Left ( InBuffer , icp )
If Len( InBuffer ) < Len( Mask )
InBufferLeft := Left( InBuffer , icp )
InBufferRight := Right ( InBuffer , Len (InBuffer) - icp )
InBufferRight := Right( InBuffer , Len(InBuffer) - icp )
if CharMaskTekstOK(InBufferLeft + ' ' + InBufferRight,mcvaltype, Mask) .and. ;
!CharMaskTekstOK(InBufferLeft + InBufferRight,mcvaltype,Mask)
@@ -606,12 +606,12 @@ Local ol := 0
endif
EndIf
If Len ( InBuffer ) > Len ( Mask ) .and.;
If Len( InBuffer ) > Len( Mask ) .and.;
len(Mask)>0
InBufferLeft := Left ( InBuffer , icp )
InBufferLeft := Left( InBuffer , icp )
InBufferRight := Right ( InBuffer , Len (InBuffer) - icp - 1 )
InBufferRight := Right( InBuffer , Len(InBuffer) - icp - 1 )
InBuffer := InBufferLeft + InBufferRight
EndIf
@@ -619,13 +619,13 @@ Local ol := 0
// Process Mask
OutBuffer := "" //x for clarity
BadEntry := .F. //x for clarity
For x := 1 To Len (Mask)
CB := SubStr (InBuffer , x , 1 )
CM := SubStr (Mask , x , 1 )
For x := 1 To Len(Mask)
CB := SubStr(InBuffer , x , 1 )
CM := SubStr(Mask , x , 1 )
Do Case
Case (CM) == 'A' .or. (CM) == '!'
If IsAlpha ( CB ) .Or. CB == ' '
If IsAlpha( CB ) .Or. CB == ' '
if (CM)=="!"
OutBuffer := OutBuffer + UPPER(CB)
else
@@ -641,7 +641,7 @@ Local ol := 0
EndIf
Case CM == '9'
If IsDigit ( CB ) .Or. CB == ' ' .Or.;
If IsDigit( CB ) .Or. CB == ' ' .Or.;
( mcvaltype=="N" .and.; //x
CB == '-' .And. x == fnb .And. Pcount() > 1 )
@@ -687,7 +687,7 @@ Local ol := 0
// RL 104
If NegativeZero == .T.
Output := Transform ( GetValFromText ( wvw_ebgettext(mnwinnum, mnebid) , mcvaltype ) , Mask )
Output := Transform( GetValFromText( wvw_ebgettext(mnwinnum, mnebid) , mcvaltype ) , Mask )
//x better:
ol := len(Output)
@@ -697,13 +697,13 @@ Local ol := 0
wvw_ebsettext(mnwinnum, mnebid, Output)
wvw_ebsetsel(mnwinnum, mnebid, at('.',OutBuffer) + dc, at('.',OutBuffer) + dc)
Else
wvw_ebsettext(mnwinnum, mnebid, Transform ( GetValFromText ( wvw_ebgettext(mnwinnum, mnebid) , mcvaltype ) , Mask ))
wvw_ebsettext(mnwinnum, mnebid, Transform( GetValFromText( wvw_ebgettext(mnwinnum, mnebid) , mcvaltype ) , Mask ))
wvw_ebsetsel(mnwinnum, mnebid, at('.',OutBuffer) + dc, at('.',OutBuffer) + dc)
EndIf
Else
If pFlag == .T.
ncp := at ( '.' , wvw_ebgettext(mnwinnum, mnebid) )
ncp := at( '.' , wvw_ebgettext(mnwinnum, mnebid) )
wvw_ebsetsel(mnwinnum, mnebid, ncp, ncp)
Else
// Restore Initial CaretPos
@@ -714,9 +714,9 @@ Local ol := 0
wvw_ebsetsel(mnwinnum, mnebid, icp, icp)
// Skip Protected Characters
For x := 1 To Len (OutBuffer)
CB := SubStr ( OutBuffer , icp+x , 1 )
CM := SubStr ( Mask , icp+x , 1 )
For x := 1 To Len(OutBuffer)
CB := SubStr( OutBuffer , icp+x , 1 )
CM := SubStr( Mask , icp+x , 1 )
If !IsDigit(CB) .And. !IsAlpha(CB) .And.;
( !( CB == ' ' ) .or. ( CB == ' ' .and. CM == ' ' ) )
@@ -735,11 +735,11 @@ Local lPassed:=.T.,CB,CM,x
//x BEGIN
if cvaltype=="D"
For x := 1 To min(Len(cString),Len(cMask))
CB := SubStr ( cString , x , 1 )
CM := SubStr ( cMask , x , 1 )
CB := SubStr( cString , x , 1 )
CM := SubStr( cMask , x , 1 )
Do Case
Case CM == '9'
If IsDigit ( CB ) .Or. CB == ' '
If IsDigit( CB ) .Or. CB == ' '
* lPassed:=.T.
Else
Return .F.
@@ -753,18 +753,18 @@ Local lPassed:=.T.,CB,CM,x
//x END
For x := 1 To min(Len(cString),Len(cMask))
CB := SubStr ( cString , x , 1 )
CM := SubStr ( cMask , x , 1 )
CB := SubStr( cString , x , 1 )
CM := SubStr( cMask , x , 1 )
Do Case
// JK
Case (CM) == 'A' .or. (CM) == '!'
If IsAlpha ( CB ) .Or. CB == ' '
If IsAlpha( CB ) .Or. CB == ' '
* lPassed:=.T.
Else
Return .F.
EndIf
Case CM == '9'
If IsDigit ( CB ) .Or. CB == ' '
If IsDigit( CB ) .Or. CB == ' '
* lPassed:=.T.
Else
Return .F.
@@ -782,7 +782,7 @@ Local lPassed:=.T.,CB,CM,x
Return .T. //lPassed
//from h_textbox.prg
static Function GetValFromText ( Text , mcvaltype )
static Function GetValFromText( Text , mcvaltype )
* eg. GetValFromText( "999,999.99" ) --> 999999.99
Local x , c , s
@@ -799,7 +799,7 @@ Local x , c , s
* ASSUME numeric
s := ''
For x := 1 To Len ( Text )
For x := 1 To Len( Text )
c := SubStr(Text,x,1)
//If c='0' .or. c='1' .or. c='2' .or. c='3' .or. c='4' .or. c='5' .or. c='6' .or. c='7' .or. c='8' .or. c='9' .or. c='.' .or. c='-'
If c $ '0123456789' .or. c $ '.-'
@@ -807,17 +807,17 @@ Local x , c , s
EndIf
Next x
If Left ( AllTrim(Text) , 1 ) == '(' .OR. Right ( AllTrim(Text) , 2 ) == 'DB'
If Left( AllTrim(Text) , 1 ) == '(' .OR. Right( AllTrim(Text) , 2 ) == 'DB'
s := '-' + s
EndIf
//useless!
//s := Transform ( Val(s) , Getnummask(s_cmask, mcvaltype) )
//s := Transform( Val(s) , Getnummask(s_cmask, mcvaltype) )
Return Val(s)
//from h_textbox.prg
static Function GetNumMask ( Text, mcvaltype )
static Function GetNumMask( Text, mcvaltype )
* eg. GetNumMask("999,999.99") --> "999999.99"
Local i , c , s
//x BEGIN
@@ -828,7 +828,7 @@ Local i , c , s
//x END
s := ''
For i := 1 To Len ( Text )
For i := 1 To Len( Text )
c := SubStr(Text,i,1)
If c='9' .or. c='.'
s := s + c

View File

@@ -2470,7 +2470,7 @@ if hFile == NIL
endif
cData := space(3)
fRead(hFile,@cData,3)
if left(cData,1) != 'A'
if !( left(cData,1) == 'A' )
return aRay
endif
nLen := bin2i(right(cData,2))
@@ -2483,7 +2483,7 @@ do while nDepth < nLen
endif
cType:= padl(cData,1)
nDataLen:= bin2i(right(cData,2))
if cType != 'A'
if !( cType == 'A' )
cData := space(nDataLen)
nBytes:= fRead(hFile,@cData,nDataLen)
if nBytes<nDataLen

View File

@@ -2563,7 +2563,7 @@ if hFile == NIL // First Timer
endif
cData := space( 3 )
fRead( hFile, @cData, 3 )
if !( left( cData,1 ) == "A" ) // If format of file != array
if !( left( cData,1 ) == "A" ) // If format of file not an array
fClose( hFile ) //////////
return aRay
endif

View File

@@ -680,8 +680,8 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd)
dEnd := DATE()
ENDIF
iif( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
iif( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
iif( ! HB_ISSTRING( cTimeStart ), cTimeStart := '00:00:00', )
iif( ! HB_ISSTRING( cTimeEnd ) , cTimeEnd := '00:00:00', )
nTotalSec := (dEnd - dStart) * 86400 + ;
VAL(cTimeEnd) * 3600 + ;
@@ -779,7 +779,7 @@ RETURN hExeFile:FULLNAME
FUNCTION uhttpd_CStrToVal( cExp, cType )
IF ValType( cExp ) != 'C'
IF ! HB_ISSTRING( cExp )
Throw( ErrorNew( "CSTR", 0, 3101, ProcName(), "Argument error", { cExp, cType } ) )
ENDIF

View File

@@ -253,11 +253,10 @@ METHOD Start( cSID ) CLASS uhttpd_Session
// // Check whether the current request was referred to by
// // an external site which invalidates the previously found ID
// $url = parse_url($GLOBALS['HTTP_REFERER']);
// if (trim($url['host']) != $GLOBALS['SERVER_NAME']) {
// unset($session->id);
// $send_cookie = true;
// $define_sid = true;
// }
// IF !(trim($url['host']) == $GLOBALS['SERVER_NAME'])
// unset(session->id)
// send_cookie := .T.
// define_sid := .T.
ENDIF
// Do we have an existing session ID?
@@ -751,8 +750,8 @@ STATIC FUNCTION FT_ELAPSED(dStart, dEnd, cTimeStart, cTimeEnd)
dEnd := DATE()
ENDIF
iif( VALTYPE(cTimeStart) != 'C', cTimeStart := '00:00:00', )
iif( VALTYPE(cTimeEnd) != 'C', cTimeEnd := '00:00:00', )
iif( ! HB_ISSTRING(cTimeStart), cTimeStart := '00:00:00', )
iif( ! HB_ISSTRING(cTimeEnd) , cTimeEnd := '00:00:00', )
nTotalSec := (dEnd - dStart) * 86400 + ;
VAL(cTimeEnd) * 3600 + ;

View File

@@ -407,7 +407,7 @@ FUNCTION Main( ... )
IF HB_ISSTRING( cApplicationRoot )
cI := cApplicationRoot
IF HB_DirExists( cI )
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. SUBSTR( cI, LEN( cI ) - 2, 1 ) != ":"
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. !( SUBSTR( cI, LEN( cI ) - 2, 1 ) == ":" )
s_cApplicationRoot := LEFT( cI, LEN( cI ) - 1 )
ELSE
s_cApplicationRoot := cI
@@ -431,7 +431,7 @@ FUNCTION Main( ... )
//cI := STRTRAN( SUBSTR( cDocumentRoot, 2 ), "\", "/" )
cI := cDocumentRoot
IF HB_DirExists( cI )
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. SUBSTR( cI, LEN( cI ) - 2, 1 ) != ":"
IF RIGHT( cI, 1 ) == "/" .AND. LEN(cI) > 2 .AND. !( SUBSTR( cI, LEN( cI ) - 2, 1 ) == ":" )
s_cDocumentRoot := LEFT( cI, LEN( cI ) - 1 )
ELSE
s_cDocumentRoot := cI
@@ -1120,8 +1120,9 @@ STATIC FUNCTION ParseRequest( cRequest )
WriteToConsole( aRequest[ 1 ] )
aLine := uhttpd_split( " ", aRequest[ 1 ] )
IF LEN( aLine ) != 3 .OR. ;
( aLine[1] != "GET" .AND. aLine[ 1 ] != "POST" ) .OR. ; // Sorry, we support GET and POST only
LEFT( aLine[ 3 ], 5 ) != "HTTP/"
( !( Left( aLine[ 1 ], 3 ) == "GET" ) .AND. ;
!( Left( aLine[ 1 ], 4 ) == "POST" ) ) .OR. ; // Sorry, we support GET and POST only
!( LEFT( aLine[ 3 ], 5 ) == "HTTP/" )
// Set status code
t_nStatusCode := 501 // Not Implemented
RETURN .F.
@@ -1619,10 +1620,10 @@ STATIC FUNCTION CGIKill( hProc, hmtxCGIKill )
********************************************************************/
FUNCTION uhttpd_OSFileName( cFileName )
IF hb_ps() != "/"
RETURN STRTRAN( cFileName, "/", hb_ps() )
IF hb_ps() == "/"
RETURN cFileName
ENDIF
RETURN cFileName
RETURN STRTRAN( cFileName, "/", hb_ps() )
PROCEDURE uhttpd_SetStatusCode(nStatusCode)
t_nStatusCode := nStatusCode
@@ -1888,7 +1889,7 @@ STATIC FUNCTION uproc_default()
ELSEIF HB_DirExists( uhttpd_OSFileName( cFileName ) )
// if it exists as folder and it is missing trailing slash I add it and redirect to it
IF RIGHT( cFileName, 1 ) != "/"
IF !( RIGHT( cFileName, 1 ) == "/" )
uhttpd_SetHeader( "Location", "http://" + _SERVER[ "HTTP_HOST" ] + _SERVER[ "SCRIPT_NAME" ] + "/" )
RETURN MakeResponse()
ENDIF

View File

@@ -186,7 +186,7 @@ METHOD Build() CLASS HBDbMenu
::nRight := nPos + 1
::nBottom := ::nTop + Len( ::aItems ) + 1
FOR n := 1 TO Len( ::aItems )
IF ::aItems[ n ]:cPrompt != "-"
IF !( Left( ::aItems[ n ]:cPrompt, 1 ) == "-" )
::aItems[ n ]:cPrompt := " " + PadR( ::aItems[ n ]:cPrompt, ::nRight - ::nLeft - 1 )
ENDIF
NEXT

View File

@@ -1092,7 +1092,7 @@ METHOD EditColor( nColor, oBrwColors ) CLASS HBDebugger
oBrwColors:ForceStable()
IF __dbgInput( Row(), Col() + 15,, @cColor, ;
{| cColor | iif( Type( cColor ) != "C", ;
{| cColor | iif( !( Type( cColor ) == "C" ), ;
( __dbgAlert( "Must be string" ), .F. ), .T. ) }, ;
SubStr( ::ClrModal(), 5 ) )
::aColors[ nColor ] := &cColor
@@ -1112,7 +1112,7 @@ METHOD EditSet( nSet, oBrwSets ) CLASS HBDebugger
oBrwSets:ForceStable()
IF __dbgInput( Row(), Col() + 13,, @cSet, ;
{| cSet | iif( Type( cSet ) != cType, ;
{| cSet | iif( !( Type( cSet ) == cType ), ;
( __dbgAlert( "Must be of type '" + cType + "'" ), .F. ), .T. ) }, ;
SubStr( ::ClrModal(), 5 ) )
Set( nSet, &cSet )
@@ -1511,7 +1511,7 @@ METHOD InputBox( cMsg, uValue, bValid, lEditable ) CLASS HBDebugger
IF lEditable
IF cType != "C" .OR. Len( uValue ) < nWidth
IF !( cType == "C" ) .OR. Len( uValue ) < nWidth
uTemp := PadR( uValue, nWidth )
ENDIF
__dbgInput( nTop + 1, nLeft + 1, nWidth, @uTemp, bValid, ;

View File

@@ -375,7 +375,7 @@ FUNCTION DBFLIST( mslist, x1, y1, x2, y2, title, maskey )
CASE ( xkey == K_ENTER .OR. ! Empty( 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 !( ValType( LI_MSED ) == "N" )
vartmp := iif( Len( LI_MSED ) < fipos, 1, LI_MSED[ fipos ] )
IF ValType( vartmp ) == "N"
IF vartmp != 2

View File

@@ -214,7 +214,7 @@ FUNCTION READ()
IF ::hFile == F_ERROR
? "DosFile:Read : No file open"
ELSEIF ::cMode != "R"
ELSEIF !( ::cMode == "R" )
? "File ", ::cFileName, " not open for reading"
ELSEIF ! ::lEoF

View File

@@ -823,7 +823,7 @@ FUNCTION __eInstVar53( oVar, cMethod, xValue, cType, nSubCode, bValid )
LOCAL oError
IF VALTYPE( xValue ) != cType .OR. ;
IF !( VALTYPE( xValue ) == cType ) .OR. ;
( bValid != NIL .AND. !EVAL( bValid, oVar, xValue ) )
oError := ErrorNew()
oError:description := HB_LANGERRMSG( 1 )
@@ -835,7 +835,7 @@ FUNCTION __eInstVar53( oVar, cMethod, xValue, cType, nSubCode, bValid )
oError:subcode := nSubCode
oError:args := { xValue }
xValue := EVAL( ERRORBLOCK(), oError )
IF VALTYPE( xValue ) != cType
IF !( VALTYPE( xValue ) == cType )
__errInHandler()
ENDIF
ENDIF

View File

@@ -158,7 +158,7 @@ FUNCTION READ()
IF ::hFile == F_ERROR
? "DosFile:Read : No file open"
ELSEIF ::cMode != "R"
ELSEIF !( ::cMode == "R" )
? "File ", ::cFileName, " not open for reading"
ELSEIF ! ::lEoF

View File

@@ -1,34 +0,0 @@
/*
* $Id$
*/
#include "set.ch"
PROCEDURE Main()
LOCAL a
LOCAL i
SET( _SET_EXACT, .T. )
a := strtoarray( "this is a great big test of strtoken" )
FOR i := 1 TO Len( a )
? a[ i ] )
NEXT
RETURN
FUNCTION strtoarray( s )
LOCAL aResult := {}
LOCAL t, l
DO WHILE s != ""
t := StrToken( s, 1, , @l )
AAdd( aResult, t )
s := SubStr( s, l + 2 ) /* skip the delimiter */
? t, Str( l ), s )
ENDDO
RETURN aResult

View File

@@ -101,7 +101,7 @@ PROCEDURE Main( ... )
ELSEIF LEFTEQUAL( param, "o" )
IF !Empty( param := SubStr( param, 2 ) )
cFileOut := param
ELSEIF n < Len( aParams ) .AND. aParams[ n + 1 ] != "-"
ELSEIF n < Len( aParams ) .AND. ! LEFTEQUAL( aParams[ n + 1 ], "-" )
cFileOut := aParams[ ++n ]
ELSE
lError := .T.