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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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. )
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user