* contrib/gtwvg/class.prg
* contrib/gtwvg/paint.prg
* contrib/gtwvg/parthdlr.prg
* contrib/gtwvg/statbar.prg
* contrib/gtwvg/tests/_dyndlgs.prg
* contrib/gtwvg/tests/_modal.prg
* contrib/gtwvg/tests/_tbrowse.prg
* contrib/gtwvg/tests/_utils.prg
* contrib/gtwvg/tests/_wvtcls.prg
* contrib/gtwvg/tests/_xbp.prg
* contrib/gtwvg/tests/demowvg.prg
* contrib/gtwvg/tests/demowvg1.prg
* contrib/gtwvg/tests/demoxbp.prg
* contrib/gtwvg/toolbar.prg
* contrib/gtwvg/wnd.prg
* contrib/hbamf/issues.txt
* contrib/hbamf/readme.txt
* contrib/hbblink/hbblink.ch
* contrib/hbct/ct.ch
* contrib/hbct/ctcom.ch
* contrib/hbct/ctrand.prg
* contrib/hbct/cttime.prg
* contrib/hbct/doc/en/addascii.txt
* contrib/hbct/doc/en/ctmath2.txt
* contrib/hbct/doc/en/ctstr.txt
* contrib/hbct/doc/en/dattime2.txt
* contrib/hbct/doc/en/finan.txt
* contrib/hbct/doc/en/ftoc.txt
* contrib/hbct/doc/en/misc1.txt
* contrib/hbct/doc/en/trig.txt
* contrib/hbct/fcopy.prg
* contrib/hbct/getinfo.prg
* contrib/hbct/getinput.prg
* contrib/hbct/getsecrt.prg
* contrib/hbct/keysave.prg
* contrib/hbct/keysec.prg
* contrib/hbct/keytime.prg
* contrib/hbct/readme.txt
* contrib/hbct/screen3.prg
* contrib/hbct/scrmark.prg
* contrib/hbct/showtime.prg
* contrib/hbct/tempfile.prg
* contrib/hbformat/utils/hbformat.prg
* contrib/hbfship/isdb.prg
* contrib/hbgd/gdimage.prg
* contrib/hbgd/tests/gdtestcl.prg
* contrib/hbgd/tests/test_out.prg
* contrib/hbgd/tests/tostring.prg
* contrib/hbgt/doc/en/hbgt.txt
* contrib/hbgt/tests/test.prg
* contrib/hbhpdf/tests/harupdf.prg
* contrib/hbhttpd/tests/carts.dbf
* contrib/hbhttpd/tests/items.dbf
* contrib/hbhttpd/tests/users.dbf
* contrib/hbmisc/doc/en/dates2.txt
* contrib/hbmisc/fcomma.prg
* contrib/hbmisc/stringp.prg
* contrib/hbmisc/tests/testhbf.prg
* contrib/hbmisc/udpds.prg
* contrib/hbmxml/tests/custom.prg
* contrib/hbmysql/diff-en.txt
* contrib/hbmysql/diff-es.txt
* contrib/hbmysql/tmysql.prg
* contrib/hbnetio/netiomt.prg
* contrib/hbnetio/utils/hbnetio/netiomgm.hb
* contrib/hbnf/adapter.prg
* contrib/hbnf/aredit.prg
* contrib/hbnf/clrsel.prg
* contrib/hbnf/default.prg
* contrib/hbnf/dispmsg.prg
* contrib/hbnf/floptst.prg
* contrib/hbnf/ftint86.ch
* contrib/hbnf/ftmenuto.ch
* contrib/hbnf/lastday.prg
* contrib/hbnf/linked.prg
* contrib/hbnf/menuto.prg
* contrib/hbnf/metaph.prg
* contrib/hbnf/nwsem.prg
* contrib/hbnf/ontick.prg
* contrib/hbnf/pegs.prg
* contrib/hbnf/popadder.prg
* contrib/hbnf/savesets.prg
* contrib/hbnf/sinkey.prg
* contrib/hbnf/tbwhile.prg
* contrib/hbnf/tempfile.prg
* contrib/hbnf/vidcur.prg
* contrib/hbnf/video2.prg
* contrib/hbnf/woy.prg
* contrib/hbodbc/tests/testodbc.prg
* contrib/hbodbc/todbc.prg
* contrib/hbpgsql/postgres.ch
* contrib/hbtip/encoder.prg
* contrib/hbtip/thtml.prg
* contrib/hbtpathy/tests/testtp.prg
* contrib/hbwin/tests/dlg.prg
* contrib/hbwin/tests/olesrv1.prg
* contrib/hbwin/tests/olesrv3.prg
* contrib/hbwin/tests/olesrv4.prg
* contrib/hbwin/tests/oletst4.prg
* contrib/hbwin/tests/testprn.prg
* contrib/hbwin/win_tbmp.prg
* contrib/hbxpp/browdbx.prg
* contrib/hbxpp/runshell.prg
* contrib/hbxpp/tthreadx.prg
* contrib/hbxpp/typefilx.prg
* contrib/hbxpp/xppop.prg
* contrib/rddads/doc/en/adsfuncs.txt
* contrib/rddads/doc/en/readme.txt
* contrib/rddads/tests/datad.prg
* contrib/rddsql/readme.txt
* contrib/xhb/cstruct.prg
* contrib/xhb/dirrec.prg
* contrib/xhb/diskhb.prg
* contrib/xhb/hbcompat.ch
* contrib/xhb/hbcomprs.prg
* contrib/xhb/hterrsys.prg
* contrib/xhb/htjlist.prg
* contrib/xhb/htmutil.prg
* contrib/xhb/stream.prg
* contrib/xhb/tcgi.prg
* contrib/xhb/thtm.prg
* contrib/xhb/ttable.prg
* contrib/xhb/txml.prg
* contrib/xhb/xcstr.prg
* contrib/xhb/xhberr.prg
* contrib/xhb/xhbmemo.prg
* contrib/xhb/xhbtedit.prg
* contrib/xhb/xhbver.prg
* doc/cmpopt.txt
* extras/gfspell/spell.ng
* extras/gfspell/spell.prg
* extras/gfspell/words.dbf
* extras/gtwvw/docs/funclist.txt
* extras/gtwvw/docs/whatsnew.txt
* extras/gtwvw/tests/_wvwmous.prg
* extras/gtwvw/tests/cbtest6.prg
* extras/gtwvw/tests/drawimg.prg
* extras/gtwvw/tests/ebtest7.prg
* extras/gtwvw/tests/inpfocus.prg
* extras/gtwvw/tests/maximize.prg
* extras/gtwvw/tests/prog0.prg
* extras/gtwvw/tests/prog1.prg
* extras/gtwvw/tests/prog2.prg
* extras/gtwvw/tests/wvwtest9.prg
* extras/gtwvw/wvt2wvw.ch
* extras/guestbk/guestbk.prg
* extras/hbdoc/tmplates.prg
* extras/hbvpdf/core.prg
* extras/httpsrv/cgifunc.prg
* extras/httpsrv/cookie.prg
* extras/httpsrv/session.prg
* extras/httpsrv/uhttpd.prg
* extras/rddado/adordd.ch
* extras/rddado/adordd.prg
* include/set.ch
* src/debug/debugger.prg
* src/rdd/dbfuncs.prg
* src/rdd/dbjoin.prg
* src/rdd/dblist.prg
* src/rdd/dbsort.prg
* src/rdd/dbstrux.prg
* src/rdd/dbstruxu.prg
* src/rdd/dbtotal.prg
* src/rdd/dbupdat.prg
* src/rdd/hbsix/sxcompat.prg
* src/rdd/hbsix/sxini.prg
* src/rdd/hbsix/sxtrig.prg
* src/rdd/usrrdd/rdds/arrayrdd.prg
* src/rdd/usrrdd/rdds/logrdd.prg
* src/rdd/usrrdd/rdds/rlcdx.prg
* src/rtl/achoice.prg
* src/rtl/adir.prg
* src/rtl/alert.prg
* src/rtl/altd.prg
* src/rtl/browdb.prg
* src/rtl/dbedit.prg
* src/rtl/devoutp.prg
* src/rtl/dircmd.prg
* src/rtl/hbi18n2.prg
* src/rtl/input.prg
* src/rtl/libname.prg
* src/rtl/listbox.prg
* src/rtl/memvarbl.prg
* src/rtl/radiobhb.prg
* src/rtl/readkey.prg
* src/rtl/readvar.prg
* src/rtl/setfunc.prg
* src/rtl/setta.prg
* src/rtl/tbrowse.prg
* src/rtl/teditor.prg
* src/rtl/text.prg
* src/rtl/tget.prg
* src/rtl/tgetlist.prg
* src/rtl/tobject.prg
* src/rtl/typefile.prg
* src/rtl/valtoexp.prg
* src/rtl/wait.prg
* src/vm/harbinit.prg
* tests/ac_test.prg
* tests/ac_test2.prg
* tests/adirtest.prg
* tests/aliaslck.prg
* tests/bldtest/bldtest.c
* tests/clsnv.prg
* tests/codebl.prg
* tests/debugtst.prg
* tests/devtest.prg
* tests/disptest.prg
* tests/gtcolors.prg
* tests/gtkeys.prg
* tests/gtwin.prg
* tests/gtxfnt.prg
* tests/inkeytst.prg
* tests/linecont.prg
* tests/mathtest.prg
* tests/memvar.prg
* tests/newrdd.prg
* tests/output.prg
* tests/readhrb.prg
* tests/seconds.prg
* tests/set_test.prg
* tests/tb1.prg
* tests/testdyn.prg
* tests/testdyn1.prg
* tests/testhrb.prg
* tests/testhtml.prg
* tests/testidle.prg
* tests/testpre.prg
* tests/testrdd2.prg
* tests/testsha1.prg
* tests/teststr.prg
* tests/ticktime.prg
* tests/transtst.prg
* tests/tstcolor.prg
* tests/tstdbi.prg
* tests/tstmacro.prg
* tests/uc16_gen.prg
* tests/usrrdd/exarr.prg
* tests/usrrdd/exlog.prg
* tests/utf8at.prg
* tests/version.prg
* tests/videotst.prg
* tests/vidtest.prg
* tests/wvtext.prg
* utils/hbmk2/hbmk2.prg
* utils/hbtest/hbtest.prg
* utils/hbtest/rt_class.prg
* utils/hbtest/rt_date.prg
* utils/hbtest/rt_hvm.prg
* utils/hbtest/rt_hvma.prg
* utils/hbtest/rt_math.prg
* utils/hbtest/rt_misc.prg
* utils/hbtest/rt_mt.prg
* utils/hbtest/rt_str.prg
* utils/hbtest/rt_stra.prg
* utils/hbtest/rt_trans.prg
* run case fixer script on all non-C file
except some certain files, which I routinely
skip when formatting.
* minor manual cleanups along the way
406 lines
9.6 KiB
Plaintext
406 lines
9.6 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
#include "directry.ch"
|
|
#include "ord.ch"
|
|
|
|
#define MAX_TEST_RECS 100
|
|
#define INDEX_KEY_CHAR CHAR + Str( NUM ) + DToS( DATE )
|
|
#define INDEX_KEY_NUM NUM
|
|
#define INDEX_KEY_DATE DATE
|
|
#define INDEX_KEY_LOG LOG
|
|
|
|
#ifdef WITH_ADS
|
|
#include "ads.ch"
|
|
|
|
EXTERNAL _ADS
|
|
#endif
|
|
|
|
EXTERNAL DBFNTX
|
|
EXTERNAL DBFCDX
|
|
|
|
PROCEDURE Main( cRDDType, cAdsMode )
|
|
|
|
LOCAL cRDD := "", aStruct, xTemp, bMemoText
|
|
|
|
FIELD CHAR, NUM, DATE, LOG
|
|
|
|
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 " + ;
|
|
"used. Not by good programmers though, but I've seen " + ;
|
|
"stuff like this used for Copyright messages and other " + ;
|
|
"long text. What is the point to all of this you'd say. " + ;
|
|
"Well I am coming to the point right now, the constant " + ;
|
|
"string is limited to 256 characters and this string is " + ;
|
|
"a lot bigger. Do you get my drift ? If there is somebody " + ;
|
|
"who has read this line upto the very end: Esto es un " + ;
|
|
"sombrero grande ridiculo." + hb_eol() + "/" + hb_eol() + "[;-)" + hb_eol() + "\" }
|
|
|
|
DO CASE
|
|
|
|
CASE Empty( cRDDType )
|
|
|
|
NotifyUser( "Usage: TESTRDD2 RDDTYPE [ADSMODE]" + hb_eol() + ;
|
|
hb_eol() + ;
|
|
"RDDTYPE = DBFNTX, DBFCDX, ADSCDX, ADSNTX or ADSADT" + hb_eol() + ;
|
|
hb_eol() + ;
|
|
"ADSMODE = LOCAL or SERVER (only applies to ADSCDX, ADSNTX and ADSADT)" + hb_eol() + ;
|
|
"(If specify SERVER, must be run from a drive suported by ADS server)", .T. )
|
|
|
|
#ifdef WITH_ADS
|
|
|
|
CASE Left( cRDDType := Upper( AllTrim( cRDDType ) ), 3 ) == "ADS"
|
|
|
|
rddRegister( "ADS", 1 )
|
|
rddSetDefault( "ADS" )
|
|
|
|
IF Empty( cADSMode )
|
|
NotifyUser( "Missing ADS mode" )
|
|
ENDIF
|
|
|
|
cADSMode := Upper( AllTrim( cADSMode ) )
|
|
|
|
DO CASE
|
|
CASE cADSMode == "LOCAL" ; AdsSetServerType( ADS_LOCAL_SERVER )
|
|
CASE cADSMode == "SERVER" ; AdsSetServerType( ADS_REMOTE_SERVER )
|
|
OTHERWISE ; NotifyUser( "Bad ADS mode" )
|
|
ENDCASE
|
|
|
|
DO CASE
|
|
CASE cRDDType == "ADSNTX" ; AdsSetFileType( ADS_NTX ) ; cRDD := "ADSNTX"
|
|
CASE cRDDType == "ADSADT" ; AdsSetFileType( ADS_ADT ) ; cRDD := "ADSADT"
|
|
CASE cRDDType == "ADSCDX" ; AdsSetFileType( ADS_CDX ) ; cRDD := "ADSCDX"
|
|
OTHERWISE ; NotifyUser( "Bad ADS flavor" )
|
|
ENDCASE
|
|
|
|
AdsLocking( .T. )
|
|
AdsRightsCheck( .T. )
|
|
|
|
AdsSetDefault( "" )
|
|
AdsSetSearchPath( "" )
|
|
|
|
#endif
|
|
|
|
CASE cRDDType == "DBFCDX" .OR. ;
|
|
cRDDType == "DBFNTX"
|
|
|
|
rddSetDefault( cRDD := cRDDType )
|
|
|
|
OTHERWISE
|
|
|
|
NotifyUser( "Bad DBF flavor" )
|
|
|
|
ENDCASE
|
|
|
|
// Delete test_?.* since may be changing RDD flavors (avoid conflicts)
|
|
AEval( Directory( "test_?.*" ), {| a | hb_dbDrop( a[ F_NAME ] ) } )
|
|
|
|
IF hb_dbExists( "test_2.dbf" )
|
|
NotifyUser( "Cannot delete test_2.dbf" )
|
|
ENDIF
|
|
|
|
// TEST: dbCreate()
|
|
|
|
dbCreate( "test_2.dbf", aStruct := { ;
|
|
{ "CHAR", "C", 30, 0 }, ;
|
|
{ "NUM", "N", 15, 3 }, ;
|
|
{ "DATE", "D", 8, 0 }, ;
|
|
{ "LOG", "L", 1, 0 }, ;
|
|
{ "MEMO", "M", 10, 0 } } )
|
|
|
|
IF ! hb_dbExists( "test_2.dbf" )
|
|
NotifyUser( "Failed to create test_2.dbf" )
|
|
ENDIF
|
|
|
|
// TEST: dbUseArea()/USE
|
|
|
|
USE test_2.dbf NEW SHARED ALIAS mytest
|
|
|
|
IF ! Alias() == "MYTEST"
|
|
NotifyUser( "Failed to open test_2.dbf" )
|
|
ENDIF
|
|
|
|
// TEST: rddName()
|
|
|
|
IF ! rddName() == cRDD
|
|
NotifyUser( "Failed to set RDD to " + cRDD )
|
|
ENDIF
|
|
|
|
// TEST: dbStruct()
|
|
|
|
IF ! CompareArray( aStruct, dbStruct() )
|
|
NotifyUser( "Resulting table structure is not what we asked for" )
|
|
ENDIF
|
|
|
|
// TEST: Header()
|
|
|
|
IF ! Header() == 194
|
|
NotifyUser( "Header() returned wrong size (" + hb_ntos( Header() ) + " bytes)" )
|
|
ENDIF
|
|
|
|
// Add a mix of data to table
|
|
|
|
DO WHILE LastRec() < MAX_TEST_RECS
|
|
|
|
// TEST: dbAppend()/APPEND BLANK
|
|
|
|
APPEND BLANK
|
|
|
|
// TEST: REPLACE
|
|
|
|
REPLACE CHAR WITH Chr( Asc( "A" ) + Val( SubStr( hb_ntos( RecNo() ), 2, 1 ) ) ) + ;
|
|
" RECORD " + hb_ntos( RecNo() )
|
|
|
|
// TEST: Direct field assigment
|
|
|
|
MYTEST->NUM := ( iif( RecNo() % 2 > 0, - 1, 1 ) * RecNo() ) + ( RecNo() / 1000 )
|
|
MYTEST->DATE := Date() + Int( FIELD->NUM )
|
|
MYTEST->LOG := ( FIELD->NUM < 0 )
|
|
MYTEST->MEMO := Eval( bMemoText )
|
|
|
|
ENDDO
|
|
|
|
// TEST: LastRec()
|
|
|
|
IF ! LastRec() == MAX_TEST_RECS
|
|
NotifyUser( "DbAppend and/or LastRec failed" )
|
|
ENDIF
|
|
|
|
// TEST: DbGoBotom()/GO BOTTOM
|
|
|
|
GO BOTTOM
|
|
|
|
IF ! RecNo() == MAX_TEST_RECS
|
|
NotifyUser( "DbGoBottom failed" )
|
|
ENDIF
|
|
|
|
// TEST: dbGoTop()/GO TOP
|
|
|
|
GO TOP
|
|
|
|
IF ! RecNo() == 1
|
|
NotifyUser( "DbGoTop failed" )
|
|
ENDIF
|
|
|
|
// Now check each and every record for accuracy
|
|
|
|
DO WHILE ! Eof()
|
|
|
|
// TEST: Field access
|
|
|
|
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. ;
|
|
! FIELD->MEMO == Eval( bMemoText )
|
|
|
|
NotifyUser( "Data in table is incorrect" )
|
|
|
|
ENDIF
|
|
|
|
SKIP
|
|
|
|
ENDDO
|
|
|
|
// TEST: Index creation
|
|
|
|
INDEX ON INDEX_KEY_CHAR TO test_c.idx
|
|
INDEX ON INDEX_KEY_NUM TO test_n.idx ADDITIVE
|
|
INDEX ON INDEX_KEY_DATE TO test_d.idx ADDITIVE
|
|
INDEX ON INDEX_KEY_LOG TO test_l.idx ADDITIVE
|
|
|
|
// TEST: IndexOrd()
|
|
|
|
IF ! IndexOrd() == 4
|
|
NotifyUser( "Bad IndexOrd()" )
|
|
ENDIF
|
|
|
|
// TEST: DBOI_KEYCOUNT
|
|
|
|
SET ORDER TO 1
|
|
IF ! dbOrderInfo( DBOI_KEYCOUNT ) == MAX_TEST_RECS
|
|
NotifyUser( "Bad DBOI_KEYCOUNT/1" )
|
|
ENDIF
|
|
|
|
SET ORDER TO 2
|
|
IF ! dbOrderInfo( DBOI_KEYCOUNT ) == MAX_TEST_RECS
|
|
NotifyUser( "Bad DBOI_KEYCOUNT/2" )
|
|
ENDIF
|
|
|
|
SET ORDER TO 3
|
|
IF ! dbOrderInfo( DBOI_KEYCOUNT ) == MAX_TEST_RECS
|
|
NotifyUser( "Bad DBOI_KEYCOUNT/3" )
|
|
ENDIF
|
|
|
|
SET ORDER TO 4
|
|
IF ! dbOrderInfo( DBOI_KEYCOUNT ) == MAX_TEST_RECS
|
|
NotifyUser( "Bad DBOI_KEYCOUNT/4" )
|
|
ENDIF
|
|
|
|
// TEST: Character index
|
|
SET ORDER TO 1
|
|
GO TOP
|
|
IF ! dbOrderInfo( DBOI_KEYVAL ) == INDEX_KEY_CHAR
|
|
NotifyUser( "Bad DBOI_KEYVAL (CHAR)" )
|
|
ENDIF
|
|
|
|
// TEST: Positive index key
|
|
SET ORDER TO 2
|
|
LOCATE for FIELD->NUM > 0
|
|
IF ! dbOrderInfo( DBOI_KEYVAL ) == INDEX_KEY_NUM
|
|
NotifyUser( "Bad DBOI_KEYVAL (NUM)" )
|
|
ENDIF
|
|
|
|
// TEST: Negative index key
|
|
SET ORDER TO 2
|
|
LOCATE for FIELD->NUM < 0
|
|
IF ! dbOrderInfo( DBOI_KEYVAL ) == INDEX_KEY_NUM
|
|
NotifyUser( "Bad DBOI_KEYVAL (NUM)" )
|
|
ENDIF
|
|
|
|
// TEST: Date index
|
|
SET ORDER TO 3
|
|
GO BOTTOM
|
|
IF ! dbOrderInfo( DBOI_KEYVAL ) == INDEX_KEY_DATE
|
|
NotifyUser( "Bad DBOI_KEYVAL (DATE)" )
|
|
ENDIF
|
|
|
|
// TEST: Logical index
|
|
SET ORDER TO 4
|
|
GO TOP
|
|
IF ! dbOrderInfo( DBOI_KEYVAL ) == INDEX_KEY_LOG
|
|
NotifyUser( "Bad DBOI_KEYVAL (LOG/1)" )
|
|
ENDIF
|
|
GO BOTTOM
|
|
IF ! dbOrderInfo( DBOI_KEYVAL ) == INDEX_KEY_LOG
|
|
NotifyUser( "Bad DBOI_KEYVAL (LOG/2)" )
|
|
ENDIF
|
|
|
|
// TEST: EXACT with a locate
|
|
|
|
SET ORDER TO 0
|
|
|
|
SET EXACT ON
|
|
LOCATE for FIELD->CHAR = "J RECORD"
|
|
IF ! Eof()
|
|
NotifyUser( "LOCATE with EXACT ON failed" )
|
|
ENDIF
|
|
|
|
SET EXACT OFF
|
|
LOCATE for FIELD->CHAR = "J RECORD"
|
|
IF Eof()
|
|
NotifyUser( "LOCATE with EXACT OFF failed" )
|
|
ENDIF
|
|
|
|
// TEST: EXACT with an index (also tests COUNT)
|
|
|
|
SET EXACT ON
|
|
SET ORDER TO 0
|
|
COUNT FOR RTrim( FIELD->CHAR ) = "A RECORD 1" TO xTemp // Get proper count
|
|
INDEX ON CHAR TO test_e.idx FOR RTrim( FIELD->CHAR ) = "A RECORD 1" ADDITIVE
|
|
IF ! dbOrderInfo( DBOI_KEYCOUNT ) == xTemp
|
|
NotifyUser( "Bad conditional index count with EXACT ON" )
|
|
ENDIF
|
|
|
|
SET EXACT OFF
|
|
SET ORDER TO 0
|
|
COUNT FOR RTrim( FIELD->CHAR ) = "A RECORD 1" TO xTemp // Get proper count
|
|
INDEX ON CHAR TO test_e.idx FOR RTrim( FIELD->CHAR ) = "A RECORD 1" ADDITIVE
|
|
IF ! dbOrderInfo( DBOI_KEYCOUNT ) == xTemp
|
|
NotifyUser( "Bad conditional index count with EXACT OFF" )
|
|
ENDIF
|
|
|
|
//
|
|
//
|
|
// *********************************************
|
|
// P U T M O R E R D D T E S T S H E R E
|
|
// *********************************************
|
|
//
|
|
//
|
|
//
|
|
|
|
// TEST: dbCloseArea()
|
|
|
|
MYTEST->( dbCloseArea() )
|
|
|
|
IF Select( "MYTEST" ) > 0
|
|
NotifyUser( "Failed to close table" )
|
|
ENDIF
|
|
|
|
NotifyUser( "Test PASSED! :-)", .T. )
|
|
|
|
RETURN
|
|
|
|
PROCEDURE ErrorSys()
|
|
|
|
ErrorBlock( {| e | MyError( e ) } )
|
|
|
|
RETURN
|
|
|
|
STATIC PROCEDURE MyError( e )
|
|
|
|
LOCAL i := 1 /* Start are "real" error */
|
|
LOCAL cErr
|
|
|
|
cErr := "Runtime error" + hb_eol() + ;
|
|
hb_eol() + ;
|
|
"Gencode: " + hb_ntos( e:GenCode ) + hb_eol() + ;
|
|
"Desc: " + e:Description + + 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 ) ) + "(" + hb_ntos( ProcLine( i ) ) + ")" + hb_eol()
|
|
ENDDO
|
|
|
|
NotifyUser( cErr ) // Calls quit
|
|
|
|
RETURN
|
|
|
|
STATIC FUNCTION CompareArray( a1, a2 )
|
|
|
|
LOCAL i, j
|
|
|
|
IF ! Len( a1 ) == Len( a2 )
|
|
RETURN .F.
|
|
ENDIF
|
|
|
|
FOR i := 1 TO Len( a1 )
|
|
|
|
FOR j := 1 TO Len( a1[ i ] )
|
|
|
|
IF ! a1[ i, j ] == a2[ i, j ]
|
|
RETURN .F.
|
|
ENDIF
|
|
|
|
NEXT
|
|
|
|
NEXT
|
|
|
|
RETURN .T.
|
|
|
|
STATIC PROCEDURE NotifyUser( cErr, lNotError )
|
|
|
|
HB_SYMBOL_UNUSED( lNotError )
|
|
|
|
? cErr
|
|
|
|
dbCloseAll()
|
|
|
|
hb_dbDrop( "test_2" )
|
|
hb_dbDrop( "test_e.idx" )
|
|
hb_dbDrop( "test_c.idx" )
|
|
hb_dbDrop( "test_n.idx" )
|
|
hb_dbDrop( "test_d.idx" )
|
|
hb_dbDrop( "test_l.idx" )
|
|
|
|
QUIT
|
|
|
|
RETURN
|