diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b11caaf225..a95e604509 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,54 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-12 01:41 UTC+0200 Viktor Szakats (harbour syenar.net) + * extras/hbxlsxml/xlsxml.prg + ! fixed missing UTF-8 mime-type svn prop + + * tests/gtkeys.prg + ! fixed typo in recent mods causing it to fail under Clipper + + * contrib/hbunix/tests/testdmn.prg + * contrib/xhb/tfile.prg + * contrib/xhb/xhberr.prg + * contrib/xhb/xhbtedit.prg + * contrib/gtwvg/class.prg + * contrib/gtwvg/tests/utils.prg + * contrib/hbnf/dfile.prg + * contrib/hbgd/tests/counter.prg + * contrib/hbtip/tests/tipmime.prg + * src/debug/debugger.prg + * src/rtl/teditor.prg + * src/rtl/typefile.prg + * src/rdd/usrrdd/rdds/logrdd.prg + * tests/testrdd2.prg + * tests/inifiles.prg + * extras/gtwvw/tests/drawimg.prg + * extras/httpsrv/cgifunc.prg + * extras/httpsrv/session.prg + % File() -> hb_FileExists() + ; pls review me in core + + * contrib/gtwvg/class.prg + * contrib/gtwvg/menubar.prg + * contrib/gtwvg/paint.prg + * contrib/gtwvg/parthdlr.prg + * contrib/gtwvg/tests/modal.prg + * contrib/gtwvg/tests/utils.prg + * contrib/gtwvg/toolbar.prg + % VALTYPE() -> HB_IS*() and some related optimizations + + * tests/codebloc.prg + * tests/newrdd.prg + * tests/inkeytst.prg + * tests/files.prg + * tests/testrdd.prg + * tests/wcecon.prg + * tests/testrdd2.prg + * tests/inifiles.prg + * *LTRIM(STR()) -> hb_ntos() + (keeping macro for Clipper where seemed necessary) + 2012-10-11 23:35 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/src/common/hbprintf.c + added HB_NO_MODFL compile time macro. diff --git a/harbour/contrib/gtwvg/class.prg b/harbour/contrib/gtwvg/class.prg index 5a661e501d..e116f4c6eb 100644 --- a/harbour/contrib/gtwvg/class.prg +++ b/harbour/contrib/gtwvg/class.prg @@ -1178,7 +1178,7 @@ METHOD WvtBrowse:HandleEvent( nKey ) LOCAL lRet := .F. - IF ValType( ::bHandleEvent ) == "B" + IF HB_ISBLOCK( ::bHandleEvent ) lRet := Eval( ::bHandleEvent, self, ::oParent:cPaintBlockID, ::oBrw, nKey ) ENDIF @@ -1191,7 +1191,7 @@ METHOD WvtBrowse:NotifyChild( nIndex, nKey, oCurObj ) LOCAL xData, i IF nIndex > 0 .AND. nIndex <= Len( ::aChildren ) - IF ValType( ::aChildren[ nIndex, OBJ_CHILD_DATABLOCK ] ) == "B" + IF HB_ISBLOCK( ::aChildren[ nIndex, OBJ_CHILD_DATABLOCK ] ) xData := Eval( ::aChildren[ nIndex, OBJ_CHILD_DATABLOCK ] ) ENDIF @@ -1589,7 +1589,7 @@ METHOD WvtLabel:Refresh() METHOD WvtLabel:SetText( cTxt ) - IF ValType( cTxt ) == "C" + IF HB_ISSTRING( cTxt ) ::Text := cTxt ::Refresh() ENDIF @@ -1600,7 +1600,7 @@ METHOD WvtLabel:SetText( cTxt ) METHOD WvtLabel:SetTextColor( nRGB ) - IF ValType( nRGB ) == "N" + IF HB_ISNUMERIC( nRGB ) ::nTextColor := nRGB ::nTextColorHoverOff := nRGB ::Refresh() @@ -1612,7 +1612,7 @@ METHOD WvtLabel:SetTextColor( nRGB ) METHOD WvtLabel:SetBackColor( nRGB ) - IF ValType( nRGB ) == "N" + IF HB_ISNUMERIC( nRGB ) ::nBackColor := nRGB ::nBackColorHoverOff := nRGB ::Refresh() @@ -1786,7 +1786,7 @@ METHOD WvtToolBar:AddButton( cFileImage, bBlock, cTooltip ) oObj:nLeft := ::nBtnLeft + 1 oObj:nBottom := ::nBottom - IF ValType( cFileImage ) == "C" + IF HB_ISSTRING( cFileImage ) oObj:nBtnType := TLB_BUTTON_TYPE_IMAGE oObj:nRight := oObj:nLeft + nCol - 1 oObj:cFileImage := cFileImage @@ -1999,7 +1999,7 @@ METHOD WvtImage:New( oParent, nID, nTop, nLeft, nBottom, nRight ) METHOD WvtImage:Create() - ::bPaint := {|| iif( File( ::cImage ), ; + ::bPaint := {|| iif( hb_FileExists( ::cImage ), ; Wvt_DrawImage( ::nTop, ::nLeft, ::nBottom, ::nRight, ::cImage ), "" ) } AAdd( ::aPaint, { ::bPaint, ; @@ -2013,7 +2013,7 @@ METHOD WvtImage:Create() METHOD WvtImage:SetImage( cImage ) - IF cImage != nil .AND. File( cImage ) + IF cImage != NIL .AND. hb_FileExists( cImage ) ::cImageFile := cImage ::Refresh() ENDIF diff --git a/harbour/contrib/gtwvg/menubar.prg b/harbour/contrib/gtwvg/menubar.prg index 8d03f258e7..8267425334 100644 --- a/harbour/contrib/gtwvg/menubar.prg +++ b/harbour/contrib/gtwvg/menubar.prg @@ -271,7 +271,7 @@ METHOD WvgMenuBar:addItem( aItem, p2, p3, p4 ) LOCAL xCaption, bAction, nStyle, nAttrib - IF PCount() == 1 .AND. ValType( aItem ) == "A" + IF PCount() == 1 .AND. HB_ISARRAY( aItem ) ASize( aItem, 4 ) xCaption := aItem[ 1 ] bAction := aItem[ 2 ] @@ -344,7 +344,7 @@ METHOD WvgMenuBar:putItem( aItem, nPos, lInsert ) aItem[ 2 ], ; iif( HB_ISSTRING( aItem[ 3 ] ), StrTran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ) ) ELSE - IF ValType( xCaption ) == "C" + IF HB_ISSTRING( xCaption ) aItem[ 2 ] := ::aMenuItems[ nItemIndex, 2 ] ENDIF ::aMenuItems[ nItemIndex ] := aItem @@ -352,7 +352,7 @@ METHOD WvgMenuBar:putItem( aItem, nPos, lInsert ) nItemIndex - 1, ; aItem[ 2 ], ; iif( HB_ISSTRING( aItem[ 3 ] ), StrTran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ), ; - ValType( xCaption ) == "C" ) + HB_ISSTRING( xCaption ) ) ENDIF ENDIF diff --git a/harbour/contrib/gtwvg/paint.prg b/harbour/contrib/gtwvg/paint.prg index fa77acff9b..7394a5b66b 100644 --- a/harbour/contrib/gtwvg/paint.prg +++ b/harbour/contrib/gtwvg/paint.prg @@ -350,13 +350,13 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle AAdd( aDlg[ 1 ] , nH ) AAdd( aDlg[ 1 ] , 0 ) AAdd( aDlg[ 1 ] , 0 ) - AAdd( aDlg[ 1 ] , iif( ValType( cTitle ) == "C", cTitle, "" ) ) + AAdd( aDlg[ 1 ] , iif( HB_ISSTRING( cTitle ), cTitle, "" ) ) IF hb_bitAnd( nStyle, DS_SETFONT ) == DS_SETFONT - AAdd( aDlg[ 1 ], iif( ValType( nPointSize ) == "N", nPointSize, 8 ) ) - AAdd( aDlg[ 1 ], iif( ValType( nWeight ) == "N", nWeight , 400 ) ) - AAdd( aDlg[ 1 ], iif( ValType( lItalic ) == "L", lItalic , .F. ) ) - AAdd( aDlg[ 1 ], iif( ValType( cFaceName ) == "C", cFaceName , "MS Sans Serif" ) ) + AAdd( aDlg[ 1 ], iif( HB_ISNUMERIC( nPointSize ), nPointSize, 8 ) ) + AAdd( aDlg[ 1 ], iif( HB_ISNUMERIC( nWeight ), nWeight , 400 ) ) + AAdd( aDlg[ 1 ], iif( HB_ISLOGICAL( lItalic ), lItalic , .F. ) ) + AAdd( aDlg[ 1 ], iif( HB_ISSTRING( cFaceName ), cFaceName , "MS Sans Serif" ) ) ENDIF RETURN aDlg @@ -412,9 +412,9 @@ FUNCTION Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet, ; aDlg[ 1,4 ]++ /* item count */ - AAdd( aDlg[ 2 ] , iif( ValType( nHelpId ) == "N", nHelpId , 0 ) ) - AAdd( aDlg[ 3 ] , iif( ValType( nExStyle ) == "N", nExStyle, 0 ) ) - AAdd( aDlg[ 4 ] , iif( ValType( nStyle ) == "N", nStyle , WS_CHILD + WS_VISIBLE ) ) + AAdd( aDlg[ 2 ] , iif( HB_ISNUMERIC( nHelpId ), nHelpId , 0 ) ) + AAdd( aDlg[ 3 ] , iif( HB_ISNUMERIC( nExStyle ), nExStyle, 0 ) ) + AAdd( aDlg[ 4 ] , iif( HB_ISNUMERIC( nStyle ), nStyle , WS_CHILD + WS_VISIBLE ) ) AAdd( aDlg[ 5 ] , nX ) AAdd( aDlg[ 6 ] , nY ) AAdd( aDlg[ 7 ] , nW ) @@ -432,7 +432,7 @@ FUNCTION Wvt_CreateDialog( acnDlg, lOnTop, cbDlgProc, ncIcon, nTimerTicks, hMenu LOCAL hDlg, cType, xTemplate, nDlgMode - IF ValType( cbDlgProc ) == "C" + IF HB_ISSTRING( cbDlgProc ) cbDlgProc := Upper( cbDlgProc ) ENDIF @@ -455,7 +455,7 @@ FUNCTION Wvt_CreateDialog( acnDlg, lOnTop, cbDlgProc, ncIcon, nTimerTicks, hMenu ENDIF - IF ValType( nTimerTicks ) == "N" + IF HB_ISNUMERIC( nTimerTicks ) WVG_SetTimer( hDlg, 1001, nTimerTicks ) ENDIF @@ -475,7 +475,7 @@ FUNCTION Wvt_DialogBox( acnDlg, cbDlgProc, hWndParent ) LOCAL nResult, cType, xTemplate, nDlgMode - IF ValType( cbDlgProc ) == "C" + IF HB_ISSTRING( cbDlgProc ) cbDlgProc := Upper( cbDlgProc ) ENDIF @@ -615,13 +615,13 @@ FUNCTION Wvt_GetTitle() FUNCTION Wvt_SetIcon( ncIconRes, cIconName ) - IF ValType( ncIconRes ) == "N" + IF HB_ISNUMERIC( ncIconRes ) hb_gtInfo( HB_GTI_ICONRES, ncIconRes ) - ELSEIF ValType( cIconName ) == "C" + ELSEIF HB_ISSTRING( cIconName ) hb_gtInfo( HB_GTI_ICONRES, cIconName ) - ELSEIF ValType( ncIconRes ) == "C" + ELSEIF HB_ISSTRING( ncIconRes ) hb_gtInfo( HB_GTI_ICONFILE, ncIconRes ) ENDIF diff --git a/harbour/contrib/gtwvg/parthdlr.prg b/harbour/contrib/gtwvg/parthdlr.prg index e6dacac70c..597467dcca 100644 --- a/harbour/contrib/gtwvg/parthdlr.prg +++ b/harbour/contrib/gtwvg/parthdlr.prg @@ -232,7 +232,7 @@ METHOD WvgPartHandler:setName( nNameId ) LOCAL nOldNameId := ::nNameId - IF ValType( nNameId ) == "N" + IF HB_ISNUMERIC( nNameId ) ::nNameID := nNameId ENDIF @@ -244,7 +244,7 @@ METHOD WvgPartHandler:setOwner( oWvg ) LOCAL oOldXbp := ::oOwner - IF ValType( oWvg ) == "O" + IF HB_ISOBJECT( oWvg ) ::oOwner := oWvg ENDIF @@ -256,7 +256,7 @@ METHOD WvgPartHandler:setParent( oWvg ) LOCAL oOldXbp := ::oParent - IF ValType( oWvg ) == "O" + IF HB_ISOBJECT( oWvg ) ::oParent := oWvg ENDIF diff --git a/harbour/contrib/gtwvg/tests/modal.prg b/harbour/contrib/gtwvg/tests/modal.prg index b4cb89adf8..b0d307940d 100644 --- a/harbour/contrib/gtwvg/tests/modal.prg +++ b/harbour/contrib/gtwvg/tests/modal.prg @@ -113,11 +113,11 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime ) nTime := 10000 // Seconds ENDIF - IF ValType( aText_ ) == "C" + IF HB_ISSTRING( aText_ ) aText_ := { aText_ } ENDIF - IF ValType( aButtons_ ) == "C" + IF HB_ISSTRING( aButtons_ ) aButtons_ := { aButtons_ } ENDIF diff --git a/harbour/contrib/gtwvg/tests/utils.prg b/harbour/contrib/gtwvg/tests/utils.prg index 8f97fb9aa0..658ced0092 100644 --- a/harbour/contrib/gtwvg/tests/utils.prg +++ b/harbour/contrib/gtwvg/tests/utils.prg @@ -254,7 +254,7 @@ FUNCTION WvtSetObjects( aObject ) IF Empty( aObject ) t_aObjects := {} ELSE - IF ValType( aObject[ 1 ] ) == "A" + IF HB_ISARRAY( aObject[ 1 ] ) AEval( aObject, {| e_ | AAdd( t_aObjects, e_ ) } ) ELSE ASize( aObject, WVT_OBJ_VRBLS ) @@ -511,7 +511,7 @@ FUNCTION ClearStatusMsg() FUNCTION WvtPictures( nSlot, cFilePic ) - IF nSlot != NIL .AND. nSlot <= 20 .AND. File( cFilePic ) + IF nSlot != NIL .AND. nSlot <= 20 .AND. hb_FileExists( cFilePic ) IF !( t_pic_[ nSlot ] == cFilePic ) IF Wvt_LoadPicture( cFilePic, nSlot ) t_pic_[ nSlot ] := cFilePic diff --git a/harbour/contrib/gtwvg/toolbar.prg b/harbour/contrib/gtwvg/toolbar.prg index 2afc7837a1..4d3caaea86 100644 --- a/harbour/contrib/gtwvg/toolbar.prg +++ b/harbour/contrib/gtwvg/toolbar.prg @@ -291,7 +291,7 @@ METHOD WvgToolBar:sendToolbarMessage( nMsg, p1, p2 ) METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nStyle, cKey, nMapRGB ) - LOCAL oBtn, pBitmap, cType, nBtn + LOCAL oBtn, pBitmap, nBtn HB_SYMBOL_UNUSED( xDisabledImage ) HB_SYMBOL_UNUSED( xHotImage ) @@ -310,24 +310,28 @@ METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS oBtn:index := ::numItems + 1 oBtn:command := 100 + oBtn:index - cType := ValType( xImage ) - - DO CASE - - CASE cType == "C" - IF ( "." $ xImage ) .OR. ( "/" $ xImage ) .OR. ( "\" $ xImage ) .OR. ( ":" $ xImage ) .OR. File( xImage ) + SWITCH ValType( xImage ) + CASE "C" + IF "." $ xImage .OR. ; + "/" $ xImage .OR. ; + "\" $ xImage .OR. ; + ":" $ xImage .OR. ; + hb_FileExists( xImage ) pBitmap := Wvg_PrepareBitmapFromFile( xImage, ::imageWidth, ::imageHeight, .T. , ::hWnd ) ELSE pBitmap := Wvg_PrepareBitmapFromResourceName( xImage, ::imageWidth, ::imageHeight, .T. , ::hWnd ) ENDIF + EXIT - CASE cType == "N" + CASE "N" pBitmap := Wvg_PrepareBitmapFromResourceID( xImage, ::imageWidth, ::imageHeight, .T. , ::hWnd ) + EXIT - CASE cType == "P" + CASE "P" pBitmap := xImage + EXIT - ENDCASE + ENDSWITCH IF ! Empty( pBitmap ) /* oBtn:image := pBitmap */ @@ -337,7 +341,7 @@ METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS ELSE nBtn := WAPI_ImageList_Add( ::hImageList, pBitmap ) ENDIF - IF !( cType == "P" ) + IF ! HB_ISPOINTER( xImage ) WVG_DeleteObject( pBitmap ) ENDIF diff --git a/harbour/contrib/hbgd/tests/counter.prg b/harbour/contrib/hbgd/tests/counter.prg index 3364590578..920ec8bb50 100644 --- a/harbour/contrib/hbgd/tests/counter.prg +++ b/harbour/contrib/hbgd/tests/counter.prg @@ -36,7 +36,7 @@ PROCEDURE Main( cValue, cBaseImage ) hb_default( @cValue , Str( hb_RandomInt( 1, 10 ^ DISPLAY_NUM ), DISPLAY_NUM ) ) hb_default( @cBaseImage, "57chevy.gif" ) - IF !File( IMAGES_IN + cBaseImage ) + IF ! hb_FileExists( IMAGES_IN + cBaseImage ) ? "ERROR: Base Image File '" + IMAGES_IN + cBaseImage + "' not found" QUIT ENDIF diff --git a/harbour/contrib/hbnf/dfile.prg b/harbour/contrib/hbnf/dfile.prg index a5b8ef7da5..5c12c0661c 100644 --- a/harbour/contrib/hbnf/dfile.prg +++ b/harbour/contrib/hbnf/dfile.prg @@ -34,7 +34,7 @@ FUNCTION FT_DFSETUP( cInFile, nTop, nLeft, nBottom, nRight, ; LOCAL rval - IF File( cInFile ) + IF hb_FileExists( cInFile ) nTop := iif( HB_ISNUMERIC( nTop ) , nTop, 0 ) nLeft := iif( HB_ISNUMERIC( nLeft ) , nLeft, 0 ) nBottom := iif( HB_ISNUMERIC( nBottom ), nBottom, MaxRow() ) diff --git a/harbour/contrib/hbtip/tests/tipmime.prg b/harbour/contrib/hbtip/tests/tipmime.prg index b40b2838a1..5df13dde9b 100644 --- a/harbour/contrib/hbtip/tests/tipmime.prg +++ b/harbour/contrib/hbtip/tests/tipmime.prg @@ -23,7 +23,7 @@ PROCEDURE Main( cFileName ) QUIT ENDIF - IF ( ! File( cFileName ) ) + IF ! hb_FileExists( cFileName ) ? ? "File", cFileName, "is not valid" ? diff --git a/harbour/contrib/hbunix/tests/testdmn.prg b/harbour/contrib/hbunix/tests/testdmn.prg index 1b80df8594..555b6addb9 100644 --- a/harbour/contrib/hbunix/tests/testdmn.prg +++ b/harbour/contrib/hbunix/tests/testdmn.prg @@ -28,7 +28,7 @@ PROCEDURE Main() QUIT ENDIF - IF File( cLogFile ) + IF hb_FileExists( cLogFile ) FErase( cLogFile ) ENDIF diff --git a/harbour/contrib/xhb/tfile.prg b/harbour/contrib/xhb/tfile.prg index 07303164f9..bf036f2f36 100644 --- a/harbour/contrib/xhb/tfile.prg +++ b/harbour/contrib/xhb/tfile.prg @@ -73,7 +73,7 @@ CLASS TCgiFile METHOD ERASE() INLINE FErase( ::File ) == 0 - METHOD Exists() INLINE File( ::File ) + METHOD Exists() INLINE hb_FileExists( ::File ) METHOD Error() INLINE FError() != 0 diff --git a/harbour/contrib/xhb/xhberr.prg b/harbour/contrib/xhb/xhberr.prg index ff4caf7f25..b4ddabb6f8 100644 --- a/harbour/contrib/xhb/xhberr.prg +++ b/harbour/contrib/xhb/xhberr.prg @@ -321,7 +321,7 @@ STATIC FUNCTION LogError( oerr ) IF ! lAppendLog nHandle := FCreate( cLogFile, FC_NORMAL ) ELSE - IF !File( cLogFile ) + IF ! hb_FileExists( cLogFile ) nHandle := FCreate( cLogFile, FC_NORMAL ) ELSE nHandle := FCreate( cLogFile2, FC_NORMAL ) diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index ce3b94e3d9..a981023676 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -2892,7 +2892,7 @@ METHOD LoadFile( cFileName ) CLASS XHBEditor LOCAL cString := "" - IF File( cFileName ) + IF hb_FileExists( cFileName ) ::cFile := cFileName cString := MemoRead( cFileName ) ENDIF @@ -2916,10 +2916,10 @@ METHOD SaveFile() CLASS XHBEditor LOCAL cString - IF !Empty( ::cFile ) + IF ! Empty( ::cFile ) cString := ::GetText() - ::lChanged := !MemoWrit( ::cFile, cString ) - RETURN !::lChanged + ::lChanged := ! MemoWrit( ::cFile, cString ) + RETURN ! ::lChanged ENDIF RETURN .F. diff --git a/harbour/extras/gtwvw/tests/drawimg.prg b/harbour/extras/gtwvw/tests/drawimg.prg index 4c6981f415..5c70657735 100644 --- a/harbour/extras/gtwvw/tests/drawimg.prg +++ b/harbour/extras/gtwvw/tests/drawimg.prg @@ -95,7 +95,7 @@ PROCEDURE Main() CLS SetCursor( SC_NORMAL ) cpict := PadR( cpict, 40 ) - @ 0, 0 SAY "FileName :" GET cpict PICT "@K" VALID File( AllTrim( cpict ) ) + @ 0, 0 SAY "FileName :" GET cpict PICT "@K" VALID hb_FileExists( AllTrim( cpict ) ) @ 1, 0 SAY "Transpar? :" GET ltransp PICT "Y" @ 2, 0 SAY "Max Cache :" GET nMaxCache PICT "999" @ 3, 0 SAY "NumOfCache=" + Transform( wvw_numBMcache(), "999" ) + ; diff --git a/harbour/extras/httpsrv/cgifunc.prg b/harbour/extras/httpsrv/cgifunc.prg index 11d015f580..a804daea18 100644 --- a/harbour/extras/httpsrv/cgifunc.prg +++ b/harbour/extras/httpsrv/cgifunc.prg @@ -715,7 +715,7 @@ PROCEDURE uhttpd_WriteToLogFile( cString, cLog, lCreate ) IF cLog != NIL - IF !lCreate .AND. FILE( cLog ) + IF !lCreate .AND. hb_FileExists( cLog ) nHandle := FOpen( cLog, FO_READWRITE + FO_SHARED ) ELSE nHandle := hb_FCreate( cLog, FC_NORMAL, FO_READWRITE + FO_SHARED ) diff --git a/harbour/extras/httpsrv/session.prg b/harbour/extras/httpsrv/session.prg index 50520d9714..d5d946d970 100644 --- a/harbour/extras/httpsrv/session.prg +++ b/harbour/extras/httpsrv/session.prg @@ -596,7 +596,7 @@ METHOD SessionRead( cID ) CLASS uhttpd_Session __defaultNIL( @cID, ::cSID ) cFile := ::cSavePath + hb_ps() + ::cName + "_" + cID //TraceLog( "SessionRead: cFile", cFile ) - IF File( cFile ) + IF hb_FileExists( cFile ) DO WHILE nRetry++ <= ::nFileRetry IF ( nH := FOpen( cFile, FO_READ + FO_DENYWRITE ) ) != F_ERROR @@ -658,7 +658,7 @@ METHOD SessionWrite( cID, cData ) CLASS uhttpd_Session ENDDO ELSE // If session data is empty, I will delete the file if exist - //IF File( cFile ) + //IF hb_FileExists( cFile ) // FErase( cFile ) //ENDIF // Return that all is ok diff --git a/harbour/src/debug/debugger.prg b/harbour/src/debug/debugger.prg index a2793a1b96..6e053c1d2d 100644 --- a/harbour/src/debug/debugger.prg +++ b/harbour/src/debug/debugger.prg @@ -410,7 +410,7 @@ METHOD New() CLASS HBDebugger ::BuildCommandWindow() ::BuildBrowseStack() - IF File( ::cSettingsFileName ) + IF hb_FileExists( ::cSettingsFileName ) ::LoadSettings() ::lGo := ::lRunAtStartup // Once again after settings file is loaded ENDIF @@ -1071,7 +1071,7 @@ METHOD DoScript( cFileName ) CLASS HBDebugger LOCAL cLine LOCAL nLen - IF File( cFileName ) + IF hb_FileExists( cFileName ) cInfo := MemoRead( cFileName ) nLen := MLCount( cInfo, NIL, NIL, .F. ) FOR n := 1 TO nLen @@ -1826,7 +1826,7 @@ METHOD LocatePrgPath( cPrgName ) CLASS HBDebugger FOR i := 1 TO iMax cRetPrgName := aPaths[ i ] + hb_ps() + cPrgName - IF File( cRetPrgName ) + IF hb_FileExists( cRetPrgName ) RETURN cRetPrgName ENDIF NEXT @@ -1898,7 +1898,7 @@ METHOD Open() CLASS HBDebugger IF !Empty( cFileName ) ; .AND. ( ValType( ::cPrgName ) == "U" .OR. !hb_FileMatch( cFileName, ::cPrgName ) ) - IF ! File( cFileName ) .AND. ! Empty( ::cPathForFiles ) + IF ! hb_FileExists( cFileName ) .AND. ! Empty( ::cPathForFiles ) cRealName := ::LocatePrgPath( cFileName ) IF Empty( cRealName ) __dbgAlert( "File '" + cFileName + "' not found!" ) @@ -1938,11 +1938,11 @@ METHOD OpenPPO() CLASS HBDebugger IF Lower( cExt ) == ".ppo" ::cPrgName := hb_FNameMerge( cDir, cName, ".prg" ) - lSuccess := File( ::cPrgName ) + lSuccess := hb_FileExists( ::cPrgName ) ::lPPO := !lSuccess ELSE ::cPrgName := hb_FNameMerge( cDir, cName, ".ppo" ) - lSuccess := File( ::cPrgName ) + lSuccess := hb_FileExists( ::cPrgName ) ::lPPO := lSuccess ENDIF @@ -2474,16 +2474,16 @@ METHOD ShowCodeLine( nProc ) CLASS HBDebugger IF ! Empty( cPrgName ) - IF !hb_FileMatch( strip_path( cPrgName ), strip_path( ::cPrgName ) ) ; + IF ! hb_FileMatch( strip_path( cPrgName ), strip_path( ::cPrgName ) ) ; .OR. ::oBrwText == NIL - IF ! File( cPrgName ) .AND. !Empty( ::cPathForFiles ) + IF ! hb_FileExists( cPrgName ) .AND. ! Empty( ::cPathForFiles ) cPrgName := ::LocatePrgPath( cPrgName ) ENDIF ::cPrgName := cPrgName - IF !File( cPrgName ) + IF ! hb_FileExists( cPrgName ) ::oBrwText := NIL ::oWndCode:Browser := NIL ::oWndCode:SetCaption( ::aProcStack[ nProc ][ CSTACK_MODULE ] + ; diff --git a/harbour/src/rdd/usrrdd/rdds/logrdd.prg b/harbour/src/rdd/usrrdd/rdds/logrdd.prg index e313d11dcc..dbf5bffee3 100644 --- a/harbour/src/rdd/usrrdd/rdds/logrdd.prg +++ b/harbour/src/rdd/usrrdd/rdds/logrdd.prg @@ -334,7 +334,7 @@ STATIC PROCEDURE OpenLogFile( nWA ) IF lActive .AND. nHandle == NIL /* Open Access Log File */ - IF File( cFileName ) + IF hb_FileExists( cFileName ) nHandle := FOpen( cFileName, FO_READWRITE + FO_SHARED ) ELSE nHandle := FCreate( cFileName ) diff --git a/harbour/src/rtl/teditor.prg b/harbour/src/rtl/teditor.prg index ef1980e559..8e22c0c513 100644 --- a/harbour/src/rtl/teditor.prg +++ b/harbour/src/rtl/teditor.prg @@ -201,7 +201,7 @@ METHOD LoadFile( cFileName ) CLASS HBEditor LOCAL cString - IF File( cFileName ) + IF hb_FileExists( cFileName ) ::cFile := cFileName cString := hb_MemoRead( cFileName ) ELSE @@ -239,11 +239,11 @@ METHOD LoadText( cString ) CLASS HBEditor // Saves file being edited, if there is no file name does nothing, returns .T. if OK METHOD SaveFile() CLASS HBEditor - IF !Empty( ::cFile ) + IF ! Empty( ::cFile ) - ::lDirty := !hb_MemoWrit( ::cFile, ::GetText() ) + ::lDirty := ! hb_MemoWrit( ::cFile, ::GetText() ) - RETURN !::lDirty + RETURN ! ::lDirty ENDIF RETURN .F. diff --git a/harbour/src/rtl/typefile.prg b/harbour/src/rtl/typefile.prg index 17f46077fb..e16623d1e5 100644 --- a/harbour/src/rtl/typefile.prg +++ b/harbour/src/rtl/typefile.prg @@ -100,7 +100,7 @@ PROCEDURE __TypeFile( cFile, lPrint ) ENDDO FOR EACH cPath IN hb_ATokens( cTmp, ";" ) - IF File( cTmp := hb_FNameMerge( cPath, cName, cExt ) ) + IF hb_FileExists( cTmp := hb_FNameMerge( cPath, cName, cExt ) ) cFile := cTmp EXIT ENDIF diff --git a/harbour/tests/codebloc.prg b/harbour/tests/codebloc.prg index 29816db594..fea0b77de7 100644 --- a/harbour/tests/codebloc.prg +++ b/harbour/tests/codebloc.prg @@ -55,7 +55,7 @@ PROCEDURE Main() OutStd( hb_eol() ) yy := 5 - x := {| xx | OutStd( LTrim( Str(xx ) ) ), OutStd( "+" ), OutStd( LTrim( Str(yy ) ) ), OutStd( "=" ), xx + yy } + x := {| xx | OutStd( hb_ntos( xx ) ), OutStd( "+" ), OutStd( hb_ntos( yy ) ), OutStd( "=" ), xx + yy } OutStd( Eval( x, 1 ) ) //this is OK OutStd( hb_eol() ) OutStd( Eval( x, 1, 2 ) ) //this should ignore unnecesary parameters diff --git a/harbour/tests/files.prg b/harbour/tests/files.prg index a352de9c43..e76d968b2a 100644 --- a/harbour/tests/files.prg +++ b/harbour/tests/files.prg @@ -42,11 +42,11 @@ PROCEDURE Main() DO WHILE n < NFILES n++ @ 10, 0 SAY "Building files.... " + Str( n ) - dbCreate( "file" + LTrim( Str( n ) ), aCampos ) - USE ( "file" + LTrim( Str( n ) ) ) NEW + dbCreate( "file" + hb_ntos( n ), aCampos ) + USE ( "file" + hb_ntos( n ) ) NEW #ifdef WITH_ADS - INDEX ON CODIGO TAG CODIGO TO ( "file" + LTrim( Str( n ) ) ) + INDEX ON CODIGO TAG CODIGO TO ( "file" + hb_ntos( n ) ) #endif CLOSE DATA @@ -57,7 +57,7 @@ PROCEDURE Main() DO WHILE n < NFILES n++ @ 12, 0 SAY "Opening files.... " + Str( n ) - USE ( "file" + LTrim( Str( n ) ) ) NEW + USE ( "file" + hb_ntos( n ) ) NEW #ifdef WITH_ADS SET ORDER TO TAG CODIGO @@ -72,7 +72,7 @@ PROCEDURE Main() DO WHILE n < NFILES n++ @ 14, 0 SAY "Deleting files.... " + Str( n ) - hb_dbDrop( "file" + LTrim( Str( n ) ) + ".dbf" ) + hb_dbDrop( "file" + hb_ntos( n ) + ".dbf" ) ENDDO RETURN diff --git a/harbour/tests/gtkeys.prg b/harbour/tests/gtkeys.prg index 8302001ab2..4c586a0b05 100644 --- a/harbour/tests/gtkeys.prg +++ b/harbour/tests/gtkeys.prg @@ -19,7 +19,7 @@ REQUEST HB_CODEPAGE_PLMAZ REQUEST HB_CODEPAGE_PLISO REQUEST HB_CODEPAGE_PL852 REQUEST HB_CODEPAGE_PLWIN - +#else #define hb_keyCode( n ) Asc( n ) #define hb_keyChar( c ) Chr( c ) #define hb_ntos( n ) LTrim( Str( n ) ) diff --git a/harbour/tests/inifiles.prg b/harbour/tests/inifiles.prg index f916c73368..8dd1ce13ac 100644 --- a/harbour/tests/inifiles.prg +++ b/harbour/tests/inifiles.prg @@ -79,7 +79,7 @@ STATIC FUNCTION New( cFileName ) ::Contents := {} CurrArray := ::Contents - IF File( cFileName ) + IF hb_FileExists( cFileName ) hFile := FOpen( cFilename, FO_READ ) ELSE hFile := FCreate( cFilename ) @@ -215,13 +215,13 @@ STATIC FUNCTION ReadNumber( cSection, cIdent, nDefault ) LOCAL Self := QSelf() - RETURN Val( ::ReadString( cSection, cIdent, Str(nDefault ) ) ) + RETURN Val( ::ReadString( cSection, cIdent, Str( nDefault ) ) ) STATIC PROCEDURE WriteNumber( cSection, cIdent, nNumber ) LOCAL Self := QSelf() - ::WriteString( cSection, cIdent, AllTrim( Str(nNumber ) ) ) + ::WriteString( cSection, cIdent, hb_ntos( nNumber ) ) RETURN @@ -229,7 +229,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 ) diff --git a/harbour/tests/inkeytst.prg b/harbour/tests/inkeytst.prg index 4628099f45..bcb385eff2 100644 --- a/harbour/tests/inkeytst.prg +++ b/harbour/tests/inkeytst.prg @@ -14,6 +14,10 @@ #include "inkey.ch" +#ifndef __HARBOUR__ +#define hb_ntos( n ) LTrim( Str( n ) ) +#endif + PROCEDURE Main( cSkip, cRaw ) AltD( 0 ) @@ -263,6 +267,6 @@ PROCEDURE TEST7( cSkip, cRaw ) ENDCASE ENDDO - ? "The TAB key (" + LTrim( Str( nKey ) ) + ") was pressed. Exiting..." + ? "The TAB key (" + hb_ntos( nKey ) + ") was pressed. Exiting..." RETURN diff --git a/harbour/tests/newrdd.prg b/harbour/tests/newrdd.prg index ebd593c9bc..53d6e6a16a 100644 --- a/harbour/tests/newrdd.prg +++ b/harbour/tests/newrdd.prg @@ -138,7 +138,7 @@ PROCEDURE Main() TESTDBF->( RecNo() ) ? "FCount:", TESTDBF->( FCount() ) FOR nI := 1 TO TESTDBF->( FCount() ) - ? "FieldGet( " + LTrim( Str( nI ) ) + " ):", TESTDBF->( FieldGet( nI ) ) + ? "FieldGet( " + hb_ntos( nI ) + " ):", TESTDBF->( FieldGet( nI ) ) NEXT ? "Press any key to continue..." @@ -239,7 +239,7 @@ PROCEDURE Main() ? " NEWRDD->FIRST_NAME := TESTDBF->FIRST" ? " NEWRDD->AGE := TESTDBF->AGE" ? " NEWRDD->DATE := TESTDBF->HIREDATE" - ? " NEWRDD->RATE := Val( Right( LTrim( Str( Seconds() ) ), 5 ) )" + ? " NEWRDD->RATE := Val( Right( hb_ntos( Seconds() ), 5 ) )" ? " NEWRDD->MEMO := TESTDBF->FIRST + Chr( 13 ) + Chr( 10 ) + ;" ? " TESTDBF->LAST + Chr( 13 ) + Chr( 10 ) + ;" ? " TESTDBF->STREET" @@ -265,7 +265,7 @@ PROCEDURE Main() NEWRDD->FIRST_NAME := TESTDBF->FIRST NEWRDD->AGE := TESTDBF->AGE NEWRDD->DATE := TESTDBF->HIREDATE - NEWRDD->RATE := Val( Right( LTrim( Str( Seconds() ) ), 5 ) ) + NEWRDD->RATE := Val( Right( hb_ntos( Seconds() ), 5 ) ) NEWRDD->MEMO := TESTDBF->FIRST + Chr( 13 ) + Chr( 10 ) + ; TESTDBF->LAST + Chr( 13 ) + Chr( 10 ) + ; TESTDBF->STREET diff --git a/harbour/tests/testrdd.prg b/harbour/tests/testrdd.prg index b060b28ff5..7695719477 100644 --- a/harbour/tests/testrdd.prg +++ b/harbour/tests/testrdd.prg @@ -15,7 +15,7 @@ PROCEDURE Main() SET EXCLUSIVE OFF - QOut( "Registered RDD's:", LTrim( Str( Len( aRdd ) ) ), "=>" ) + QOut( "Registered RDD's:", hb_ntos( Len( aRdd ) ), "=>" ) AEval( aRdd, {| cDriver | QQOut( "", cDriver ) } ) QOut() rddSetDefault( "DBFCDX" ) diff --git a/harbour/tests/testrdd2.prg b/harbour/tests/testrdd2.prg index 3791dfa9f2..45cf8f635c 100644 --- a/harbour/tests/testrdd2.prg +++ b/harbour/tests/testrdd2.prg @@ -26,7 +26,7 @@ PROCEDURE Main( cRDDType, cAdsMode ) FIELD CHAR, NUM, DATE, LOG - bMemoText := {|| "This is memo #" + LTrim( Str( RecNo() ) ) + "." + hb_eol() + ; + bMemoText := {|| "This is memo #" + hb_ntos( RecNo() ) + "." + hb_eol() + ; hb_eol() + ; "This is a very long string. " + ; "This may seem silly however strings like this are still " + ; @@ -98,7 +98,7 @@ PROCEDURE Main( cRDDType, cAdsMode ) // Delete test_?.* since may be changing RDD flavors (avoid conflicts) AEval( Directory( "test_?.*" ), {| a | FErase( a[ F_NAME ] ) } ) - IF File( "test_2.dbf" ) + IF hb_FileExists( "test_2.dbf" ) NotifyUser( "Cannot delete test_2.dbf" ) ENDIF @@ -111,7 +111,7 @@ PROCEDURE Main( cRDDType, cAdsMode ) { "LOG", "L", 1, 0 }, ; { "MEMO", "M", 10, 0 } } ) - IF ! File( "test_2.dbf" ) + IF ! hb_FileExists( "test_2.dbf" ) NotifyUser( "Failed to create test_2.dbf" ) ENDIF @@ -138,7 +138,7 @@ PROCEDURE Main( cRDDType, cAdsMode ) // TEST: Header() IF ! Header() == 194 - NotifyUser( "Header() returned wrong size (" + LTrim( Str( Header() ) ) + " bytes)" ) + NotifyUser( "Header() returned wrong size (" + hb_ntos( Header() ) + " bytes)" ) ENDIF // Add a mix of data to table @@ -151,8 +151,8 @@ PROCEDURE Main( cRDDType, cAdsMode ) // TEST: REPLACE - REPLACE CHAR WITH Chr( Asc( "A" ) + Val( SubStr( LTrim( Str( RecNo() ) ), 2, 1 ) ) ) + ; - " RECORD " + LTrim( Str( RecNo() ) ) + REPLACE CHAR WITH Chr( Asc( "A" ) + Val( SubStr( hb_ntos( RecNo() ), 2, 1 ) ) ) + ; + " RECORD " + hb_ntos( RecNo() ) // TEST: Direct field assigment @@ -191,8 +191,8 @@ PROCEDURE Main( cRDDType, cAdsMode ) // TEST: Field access - IF ! RTrim( FIELD->CHAR ) == Chr( 65 + Val( SubStr( LTrim( Str( RecNo() ) ), 2, 1 ) ) ) + ; - " RECORD " + LTrim( Str( RecNo() ) ) .OR. ; + IF ! RTrim( FIELD->CHAR ) == Chr( Asc( "A" ) + Val( SubStr( hb_ntos( RecNo() ), 2, 1 ) ) ) + ; + " RECORD " + hb_ntos( RecNo() ) .OR. ; ! FIELD->NUM == ( iif( RecNo() % 2 > 0, - 1, 1 ) * RecNo() ) + ( RecNo() / 1000 ) .OR. ; ! FIELD->DATE == Date() + Int( FIELD->NUM ) .OR. ; ! FIELD->LOG == ( FIELD->NUM < 0 ) .OR. ; @@ -348,15 +348,15 @@ STATIC PROCEDURE MyError( e ) cErr := "Runtime error" + hb_eol() + ; hb_eol() + ; - "Gencode: " + LTrim( Str( e:GenCode ) ) + hb_eol() + ; + "Gencode: " + hb_ntos( e:GenCode ) + hb_eol() + ; "Desc: " + e:Description + + hb_eol() + ; - "Sub-system: " + LTrim( Str( e:SubCode ) ) + hb_eol() + ; + "Sub-system: " + hb_ntos( e:SubCode ) + hb_eol() + ; hb_eol() + ; "Call trace:" + hb_eol() + ; hb_eol() DO WHILE ! Empty( ProcName( ++i ) ) - cErr += RTrim( ProcName( i ) ) + "(" + LTrim( Str( ProcLine( i ) ) ) + ")" + hb_eol() + cErr += RTrim( ProcName( i ) ) + "(" + hb_ntos( ProcLine( i ) ) + ")" + hb_eol() ENDDO NotifyUser( cErr ) // Calls quit diff --git a/harbour/tests/wcecon.prg b/harbour/tests/wcecon.prg index 5b6caf951b..a5409da96e 100644 --- a/harbour/tests/wcecon.prg +++ b/harbour/tests/wcecon.prg @@ -46,8 +46,8 @@ proc main() SetMode( nMaxScrRow, nMaxScrCol ) /* display console window size */ - ? "rows =", ltrim( str( maxrow() + 1 ) ) - ? "cols =", ltrim( str( maxcol() + 1 ) ) + ? "rows =", hb_ntos( maxrow() + 1 ) + ? "cols =", hb_ntos( maxcol() + 1 ) inkey( 0 ) /* display infomration aboout used OS, harbour version and GT driver */