From fd09814dc7a531f6a77ef7dc40119ee33d8882a3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 4 Nov 2012 14:15:33 +0000 Subject: [PATCH] 2012-11-04 15:12 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbhttpd/tests/eshop.prg * contrib/hbnf/tests/tbwhile.prg * contrib/xhb/ttable.prg * tests/testcdx.prg * tests/testrdd2.prg ! use HB_DBEXISTS()/HB_DBDROP() instead of HB_FILEEXISTS() and FERASE() for RDD files. --- harbour/ChangeLog | 9 +++++++++ harbour/contrib/hbhttpd/tests/eshop.prg | 18 +++++++++--------- harbour/contrib/hbnf/tests/tbwhile.prg | 4 ++-- harbour/contrib/xhb/ttable.prg | 16 ++++++++-------- harbour/tests/testcdx.prg | 2 +- harbour/tests/testrdd2.prg | 6 +++--- 6 files changed, 32 insertions(+), 23 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 02facf4e64..b64af351e1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-04 15:12 UTC+0100 Viktor Szakats (harbour syenar.net) + * contrib/hbhttpd/tests/eshop.prg + * contrib/hbnf/tests/tbwhile.prg + * contrib/xhb/ttable.prg + * tests/testcdx.prg + * tests/testrdd2.prg + ! use HB_DBEXISTS()/HB_DBDROP() instead of HB_FILEEXISTS() + and FERASE() for RDD files. + 2012-11-04 14:52 UTC+0100 Viktor Szakats (harbour syenar.net) * ChangeLog * minor updated to prev entries diff --git a/harbour/contrib/hbhttpd/tests/eshop.prg b/harbour/contrib/hbhttpd/tests/eshop.prg index 1b978c9a42..6ff18ffcc4 100644 --- a/harbour/contrib/hbhttpd/tests/eshop.prg +++ b/harbour/contrib/hbhttpd/tests/eshop.prg @@ -47,8 +47,8 @@ PROCEDURE Main() SET CENTURY ON - IF ! hb_FileExists( "users.dbf" ) - FErase( "users.cdx" ) + IF ! hb_dbExists( "users.dbf" ) + hb_dbDrop( "users.cdx" ) dbCreate( "users", { { "USER", "C", 16, 0 }, { "PASSWORD", "C", 16, 0 }, { "NAME", "C", 50, 0 } }, , .T., "user" ) dbAppend() FIELD->USER := "demo" @@ -56,29 +56,29 @@ PROCEDURE Main() FIELD->NAME := "Demo" ordCreate( "users", "user", "USER" ) dbCloseArea() - ELSEIF ! hb_FileExists( "users.cdx" ) + ELSEIF ! hb_dbExists( "users.cdx" ) dbUseArea( .T., , "users", , .F., .F. ) ordCreate( "users", "user", "USER" ) dbCloseArea() ENDIF - IF ! hb_FileExists( "carts.dbf" ) - FErase( "carts.cdx" ) + IF ! hb_dbExists( "carts.dbf" ) + hb_dbDrop( "carts.cdx" ) dbCreate( "carts", { { "USER", "C", 16, 0 }, { "CODE", "C", 16, 0 }, { "AMOUNT", "N", 6, 0 }, { "TOTAL", "N", 9, 2 } }, , .T., "cart" ) ordCreate( "carts", "user", "USER+CODE" ) dbCloseArea() - ELSEIF ! hb_FileExists( "carts.cdx" ) + ELSEIF ! hb_dbExists( "carts.cdx" ) dbUseArea( .T., , "carts", , .F., .F. ) ordCreate( "carts", "user", "USER+CODE" ) dbCloseArea() ENDIF - IF ! hb_FileExists( "items.dbf" ) - FErase( "items.cdx" ) + IF ! hb_dbExists( "items.dbf" ) + hb_dbDrop( "items.cdx" ) dbCreate( "items", { { "CODE", "C", 16, 0 }, { "TITLE", "C", 80, 0 }, { "PRICE", "N", 9, 2 } }, , .T., "items" ) ordCreate( "items", "code", "CODE" ) dbCloseArea() - ELSEIF ! hb_FileExists( "item.cdx" ) + ELSEIF ! hb_dbExists( "item.cdx" ) dbUseArea( .T., , "items", , .F., .F. ) ordCreate( "items", "code", "CODE" ) dbCloseArea() diff --git a/harbour/contrib/hbnf/tests/tbwhile.prg b/harbour/contrib/hbnf/tests/tbwhile.prg index 7140dc3a12..3c0cd12275 100644 --- a/harbour/contrib/hbnf/tests/tbwhile.prg +++ b/harbour/contrib/hbnf/tests/tbwhile.prg @@ -23,13 +23,13 @@ PROCEDURE Main() FIELD last, first - IF ! hb_FileExists( "tbnames.dbf" ) + IF ! hb_dbExists( "tbnames.dbf" ) MAKE_DBF() ENDIF USE TBNames - IF ! hb_FileExists( "tbnames.ntx" ) + IF ! hb_dbExists( "tbnames.ntx" ) INDEX ON last + first TO TBNAMES ENDIF diff --git a/harbour/contrib/xhb/ttable.prg b/harbour/contrib/xhb/ttable.prg index 4bedf68f6f..525527640f 100644 --- a/harbour/contrib/xhb/ttable.prg +++ b/harbour/contrib/xhb/ttable.prg @@ -277,7 +277,7 @@ FUNCTION NetOpenFiles( aFiles ) FOR EACH xFile IN aFiles - IF ! hb_FileExists( xFile[ 1 ] ) + IF ! hb_dbExists( xFile[ 1 ] ) nRet := -1 EXIT ENDIF @@ -285,7 +285,7 @@ FUNCTION NetOpenFiles( aFiles ) IF NetDbUse( xFile[ 1 ], xFile[ 2 ], s_nNetDelay, "DBFCDX" ) IF HB_ISARRAY( xFile[ 3 ] ) FOR EACH cIndex IN xFile[ 3 ] - IF hb_FileExists( cIndex ) + IF hb_dbExists( cIndex ) ordListAdd( cIndex ) ELSE nRet := -3 @@ -822,7 +822,7 @@ METHOD OPEN() CLASS HBTable SELECT( ::Alias ) ::Area := Select() - IF ::cOrderBag != NIL .AND. hb_FileExists( ::cPath + ::cOrderFile ) + IF ::cOrderBag != NIL .AND. hb_dbExists( ::cPath + ::cOrderFile ) SET INDEX TO ( ::cPath + ::cOrderBag ) ( ::Alias )->( ordSetFocus( 1 ) ) @@ -913,7 +913,7 @@ METHOD FldInit() CLASS HBTable oNew:Read() - IF oNew:cOrderBag != NIL .AND. hb_FileExists( oNew:cPath + oNew:cOrderFile ) + IF oNew:cOrderBag != NIL .AND. hb_dbExists( oNew:cPath + oNew:cOrderFile ) SET INDEX TO ( oNew:cPath + oNew:cOrderBag ) ( oNew:Alias )->( ordSetFocus( 1 ) ) ENDIF @@ -1267,8 +1267,8 @@ METHOD REINDEX() CLASS HBTable ::Isnet := .F. - IF hb_FileExists( ::cPath + ::cOrderFile ) - IF FErase( ::cPath + ::cOrderFile ) != 0 + IF hb_dbExists( ::cPath + ::cOrderFile ) + IF ! hb_dbDrop( ::cPath + ::cOrderFile ) // --> ALERT(".cdx *NOT* Deleted !!!" ) ENDIF ENDIF @@ -1306,8 +1306,8 @@ METHOD FastReindex() CLASS HBTable ::Kill() ::Isnet := .F. - IF hb_FileExists( ::cPath + ::cOrderFile ) - IF FErase( ::cPath + ::cOrderFile ) != 0 + IF hb_dbExists( ::cPath + ::cOrderFile ) + IF ! hb_dbDrop( ::cPath + ::cOrderFile ) // --> ALERT(".cdx *NOT* Deleted !!!" ) ENDIF ENDIF diff --git a/harbour/tests/testcdx.prg b/harbour/tests/testcdx.prg index fef2def786..eff5eb97e3 100644 --- a/harbour/tests/testcdx.prg +++ b/harbour/tests/testcdx.prg @@ -43,7 +43,7 @@ PROCEDURE Main() // Inkey( 0 ) ENDDO - FErase( "testcdx.cdx" ) + hb_dbDrop( "testcdx.cdx" ) Select( "TESTCDX" ) ordCreate( "testcdx", "Character", "CHARACTER", FIELD->CHARACTER, .F. ) diff --git a/harbour/tests/testrdd2.prg b/harbour/tests/testrdd2.prg index 45cf8f635c..b7a7b9232e 100644 --- a/harbour/tests/testrdd2.prg +++ b/harbour/tests/testrdd2.prg @@ -96,9 +96,9 @@ PROCEDURE Main( cRDDType, cAdsMode ) ENDCASE // Delete test_?.* since may be changing RDD flavors (avoid conflicts) - AEval( Directory( "test_?.*" ), {| a | FErase( a[ F_NAME ] ) } ) + AEval( Directory( "test_?.*" ), {| a | hb_dbDrop( a[ F_NAME ] ) } ) - IF hb_FileExists( "test_2.dbf" ) + IF hb_dbExists( "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 ! hb_FileExists( "test_2.dbf" ) + IF ! hb_dbExists( "test_2.dbf" ) NotifyUser( "Failed to create test_2.dbf" ) ENDIF