2009-06-17 09:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbct/fcopy.prg
  * contrib/xhb/stream.prg
  * contrib/xhb/traceprg.prg
  * contrib/xhb/hblog.prg
  * contrib/xhb/ttable.prg
  * contrib/hbxbp/xbpmenubar.prg
  * contrib/hbxbp/xbptoolbar.prg
  * contrib/hbxbp/xbppushbutton.prg
  * contrib/hbnf/tbwhile.prg
  * contrib/rddado/adordd.prg
  * contrib/hbgd/gd.prg
  * contrib/hbtip/thtml.prg
  * contrib/hbtip/popcln.prg
  * contrib/hbtip/sendmail.prg
  * contrib/hbtip/cgi.prg
  * contrib/hbtip/ftpcln.prg
    % File() -> hb_FileExists().
    ; NOTE: I didn't convert in hbblat, because I'm not sure whether wildcards
            are also expected there.
This commit is contained in:
Viktor Szakats
2009-06-17 07:30:31 +00:00
parent 3d8424928c
commit f068c2f707
17 changed files with 53 additions and 32 deletions

View File

@@ -17,6 +17,27 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-06-17 09:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbct/fcopy.prg
* contrib/xhb/stream.prg
* contrib/xhb/traceprg.prg
* contrib/xhb/hblog.prg
* contrib/xhb/ttable.prg
* contrib/hbxbp/xbpmenubar.prg
* contrib/hbxbp/xbptoolbar.prg
* contrib/hbxbp/xbppushbutton.prg
* contrib/hbnf/tbwhile.prg
* contrib/rddado/adordd.prg
* contrib/hbgd/gd.prg
* contrib/hbtip/thtml.prg
* contrib/hbtip/popcln.prg
* contrib/hbtip/sendmail.prg
* contrib/hbtip/cgi.prg
* contrib/hbtip/ftpcln.prg
% File() -> hb_FileExists().
; NOTE: I didn't convert in hbblat, because I'm not sure whether wildcards
are also expected there.
2009-06-17 00:10 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/hbxbp/tests/demoxbp.prg
! Commented out <Dialogs> menu option.

View File

@@ -194,7 +194,7 @@ FUNCTION FILEAPPEND( cSrc, cDest )
hSrcFile := FOPEN( cSrc, FO_READ )
IF hSrcFile != -1
IF !FILE( cDest )
IF !hb_FileExists( cDest )
hDstFile := FCREATE( cDest )
ELSE
hDstFile := FOPEN( cDest, FO_WRITE )

View File

@@ -133,7 +133,7 @@ FUNCTION gdImageFromFile( cFile )
LOCAL hFile := {=>}
LOCAL oImage
IF File( cFile )
IF hb_FileExists( cFile )
HB_FNameSplit( cFile, @cPath, @cName, @cExt, @cDrive )
//TraceLog( cFile, cPath, cName, cExt, cDrive )
cExt := Lower( cExt )

View File

@@ -87,13 +87,13 @@
FIELD last, first
MEMVAR GetList
IF ! FILE( "tbnames.dbf" )
IF ! hb_FileExists( "tbnames.dbf" )
MAKE_DBF()
ENDIF
USE TBNames
IF ! FILE( "tbnames.ntx" )
IF ! hb_FileExists( "tbnames.ntx" )
INDEX ON last + first TO TBNAMES
ENDIF

View File

@@ -111,7 +111,7 @@ ENDCLASS
METHOD New() CLASS TIpCgi
local aTemp
local aTemp
local aVar
local lPost
local nCount
@@ -409,7 +409,7 @@ METHOD StartSession( cSID ) CLASS TIpCgi
cFile := ::cSessionSavePath + "SESSIONID_" + cSID
if file( cFile )
if hb_FileExists( cFile )
if ( nH := FOpen( cFile, FO_READ ) ) != -1
nFileSize := FSeek( nH, 0, FS_END )
FSeek( nH, 0, FS_SET )

View File

@@ -176,10 +176,10 @@ METHOD New( oUrl,lTrace, oCredentials) CLASS tIPClientFTP
::nDefaultRcvBuffSize := 65536
if ::ltrace
if !file("ftp.log")
if !hb_FileExists("ftp.log")
::nHandle := fcreate("ftp.log")
else
while file(cFile+hb_NToS(Int(n))+".log")
while hb_FileExists(cFile+hb_NToS(Int(n))+".log")
n++
enddo
::cLogFile:= cFile+hb_NToS(Int(n))+".log"

View File

@@ -94,10 +94,10 @@ METHOD New( oUrl, lTrace, oCredentials ) CLASS tIPClientPOP
::nConnTimeout := 10000
if ::ltrace
if !file("pop3.log")
if !hb_FileExists("pop3.log")
::nHandle := fcreate("pop3.log")
else
while file(cFile+hb_NToS(n)+".log")
while hb_FileExists(cFile+hb_NToS(n)+".log")
n++
enddo
::nHandle := fcreate(cFile+hb_NToS(n)+".log")

View File

@@ -132,7 +132,7 @@ FUNCTION HB_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF
cUser := StrTran( cUser, "@", "&at;" )
IF !( (".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. File(cBody) )
IF !( (".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. hb_FileExists(cBody) )
IF !( Right( cBody, 2 ) == HB_OSNewLine() )
cBody += HB_OsNewLine()
@@ -225,7 +225,7 @@ FUNCTION HB_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF
oAttach := tipMail():new()
oAttach:SetEncoder( "7-bit" )
IF (".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. File(cBody)
IF (".htm" $ Lower( cBody ) .OR. ".html" $ Lower( cBody ) ) .AND. hb_FileExists(cBody)
cMimeText := "text/html ; charset=ISO-8859-1"
oAttach:hHeaders[ "Content-Type" ] := cMimeText
cBodyTemp := cBody

View File

@@ -232,7 +232,7 @@ RETURN ::root:toString()
// reads HTML file and parses it into tree of objects
METHOD readFile( cFileName ) CLASS THtmlDocument
IF ! File( cFileName )
IF ! hb_FileExists( cFileName )
RETURN .F.
ENDIF
::changed := .T.

View File

@@ -290,7 +290,7 @@ METHOD xbpMenuBar:placeItem( xCaption, bAction, nStyle, nAttrb, nMode, nPos )
cCaption := substr( cCaption, 1, n-1 )
ENDIF
oAction:setText( cCaption )
IF file( cIcon )
IF hb_FileExists( cIcon )
oAction:setIcon( cIcon )
ENDIF
IF !empty( cKey )

View File

@@ -186,7 +186,7 @@ METHOD XbpPushButton:setCaption( xCaption, cDll )
IF hb_isChar( xCaption )
::caption := xCaption
IF file( xCaption )
IF hb_FileExists( xCaption )
::oWidget:setIcon( xCaption )
ELSE
::oWidget:setText( xCaption )

View File

@@ -249,7 +249,7 @@ METHOD XbpToolbar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS
oBtn:oAction := QAction():new( QT_PTROF( ::oWidget ) )
oBtn:oAction:setText( cCaption )
IF valtype( xImage ) == "C" .and. file( xImage )
IF valtype( xImage ) == "C" .and. hb_FileExists( xImage )
oBtn:oAction:setIcon( xImage )
ENDIF

View File

@@ -175,25 +175,25 @@ STATIC FUNCTION ADO_CREATE( nWA, aOpenInfo )
DO CASE
CASE Lower( Right( cDataBase, 4 ) ) == ".mdb"
IF ! File( cDataBase )
IF ! hb_FileExists( cDataBase )
oCatalog:Create( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + cDataBase )
ENDIF
oConnection:Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + cDataBase )
CASE Lower( Right( cDataBase, 4 ) ) == ".xls"
IF ! File( cDataBase )
IF ! hb_FileExists( cDataBase )
oCatalog:Create( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + cDataBase + ";Extended Properties='Excel 8.0;HDR=YES';Persist Security Info=False" )
ENDIF
oConnection:Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + cDataBase + ";Extended Properties='Excel 8.0;HDR=YES';Persist Security Info=False")
CASE Lower( Right( cDataBase, 3 ) ) == ".db"
IF ! File( cDataBase )
IF ! hb_FileExists( cDataBase )
oCatalog:Create( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + cDataBase + ";Extended Properties='Paradox 3.x';" )
ENDIF
oConnection:Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + cDataBase + ";Extended Properties='Paradox 3.x';" )
CASE Lower( Right( cDataBase, 4 ) ) == ".fdb"
IF ! File( cDataBase )
IF ! hb_FileExists( cDataBase )
oCatalog:Create( "Driver=Firebird/InterBase(r) driver;Uid=" + cUserName + ";Pwd=" + cPassword + ";DbName=" + cDataBase + ";" )
ENDIF
#ifdef __XHARBOUR__

View File

@@ -510,7 +510,7 @@ METHOD Open( cProgName ) CLASS HB_LogFile
RETURN .F.
ENDIF
IF File( ::cFileName )
IF hb_FileExists( ::cFileName )
::nFileHandle := FOpen( ::cFileName, FO_READWRITE )
IF ::nFileHandle > 0
Fseek( ::nFileHandle, 0 ,FS_END )
@@ -559,7 +559,7 @@ METHOD Send( nStyle, cMessage, cProgName, nPrio ) CLASS HB_LogFile
FClose( ::nFileHandle )
IF ::nBackup > 1
IF File( ::cFileName +"." + Padl( ::nBackup-1, 3,"0" ) )
IF hb_FileExists( ::cFileName +"." + Padl( ::nBackup-1, 3,"0" ) )
FErase( ::cFileName +"." + Padl( ::nBackup-1, 3,"0" ) )
ENDIF
FOR nCount := ::nBackup -1 TO 1 STEP -1

View File

@@ -218,7 +218,7 @@ METHOD New( cFile, nMode ) CLASS TStreamFileWriter
::cFile := cFile
IF File( cFile )
IF hb_FileExists( cFile )
DEFAULT nMode TO FO_READWRITE
::Handle := FOpen( cFile, nMode )

View File

@@ -83,11 +83,11 @@ FUNCTION TraceLog( ... )
PRIVATE FileHandle
PRIVATE ProcName, xParam
/* File() and FOpen()/FCreate() make different assumptions rgdg path,
/* hb_FileExists() and FOpen()/FCreate() make different assumptions rgdg path,
so we have to make sure cFile contains path to avoid ambiguity */
cFile := cWithPath( cFile )
IF File( cFile )
IF hb_FileExists( cFile )
FileHandle := FOpen( cFile, 1 )
ELSE
FileHandle := FCreate( cFile )

View File

@@ -179,7 +179,7 @@ FUNCTION NetLock( nType, lReleaseLocks, nSeconds )
xIdentifier := lReleaseLocks
bOperation := { | x | DBAPPEND( x ), !NETERR() }
exit
END
ENDSWITCH
slNetOk := .F.
@@ -286,7 +286,7 @@ FUNCTION NetOpenFiles( aFiles )
FOR EACH xFile IN aFiles
IF !FILE( xFile[ 1 ] )
IF !hb_FileExists( xFile[ 1 ] )
nRet := - 1
EXIT
ENDIF
@@ -294,7 +294,7 @@ FUNCTION NetOpenFiles( aFiles )
IF NetDbUse( xFile[ 1 ], xFile[ 2 ], snNetDelay, "DBFCDX" )
IF VALTYPE( xFile[ 3 ] ) == "A"
FOR EACH cIndex IN xFile[ 3 ]
IF FILE( cIndex )
IF hb_FileExists( cIndex )
ORDLISTADD( cIndex )
ELSE
nRet := - 3
@@ -835,7 +835,7 @@ METHOD OPEN() CLASS HBTable
SELECT( ::Alias )
::Area := SELECT()
IF ::cOrderBag != NIL .and. FILE( ::cPath + ::cOrderFile )
IF ::cOrderBag != NIL .and. hb_FileExists( ::cPath + ::cOrderFile )
SET INDEX TO ( ::cPath + ::cOrderBag )
( ::Alias )->( ORDSETFOCUS( 1 ) )
@@ -927,7 +927,7 @@ METHOD FldInit() CLASS HBTable
oNew:Read()
IF oNew:cOrderBag != NIL .and. FILE( oNew:cPath + oNew:cOrderFile )
IF oNew:cOrderBag != NIL .and. hb_FileExists( oNew:cPath + oNew:cOrderFile )
SET INDEX TO ( oNew:cPath + oNew:cOrderBag )
( oNew:Alias )->( ORDSETFOCUS( 1 ) )
ENDIF
@@ -1289,7 +1289,7 @@ METHOD Reindex() CLASS HBTable
::Isnet := .F.
IF FILE( ::cPath + ::cOrderFile )
IF hb_FileExists( ::cPath + ::cOrderFile )
IF FERASE( ::cPath + ::cOrderFile ) != 0
// --> ALERT(".CDX *NOT* Deleted !!!" )
ENDIF
@@ -1330,7 +1330,7 @@ METHOD FastReindex() CLASS HBTable
::Kill()
::Isnet := .F.
IF FILE( ::cPath + ::cOrderFile )
IF hb_FileExists( ::cPath + ::cOrderFile )
IF FERASE( ::cPath + ::cOrderFile ) != 0
// --> ALERT(".CDX *NOT* Deleted !!!" )
ENDIF