Files
harbour-core/harbour/tests/files.prg
Viktor Szakats 4d4bb8e11c 2008-07-28 20:41 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* tests/ainstest.prg
   * tests/array16.prg
   * tests/arrays.prg
   * tests/atest.prg
   * tests/clasinit.prg
   * tests/classch.prg
   * tests/classes.prg
   * tests/dates.prg
   * tests/db_brows.prg
   * tests/ddate.prg
   * tests/debugtst.prg
   * tests/dynobj.prg
   * tests/files.prg
   * tests/gfx.prg
   * tests/inline.prg
   * tests/keywords.prg
   * tests/objects.prg
   * tests/onidle.prg
   * tests/readhrb.prg
   * tests/rtfclass.prg
   * tests/speed.prg
   * tests/switch.prg
   * tests/test_all.prg
   * tests/testbrw.prg
   * tests/testcgi.prg
   * tests/testcls.prg
   * tests/testget.prg
   * tests/testhtml.prg
   * tests/testidle.prg
   * tests/testinit.prg
   * tests/testntx.prg
   * tests/testpers.prg
   * tests/testrdd2.prg
   * tests/teststr.prg
   * tests/tstblock.prg
   * tests/tstmacro.prg
   * tests/videotst.prg
   * tests/vidtest.prg
   * tests/wcecon.prg
     * Cleanups. SVN header, '=' operator usage.
2008-07-28 18:43:42 +00:00

79 lines
1.4 KiB
Plaintext

/*
* $Id$
*/
// This test was written by Jose Gimenez (JFG) <jfgimenez@wanadoo.es>
// <tecnico.sireinsa@ctv.es>
// and is placed into the public domain.
// Number of files to build/open
#define NFILES 1000
// use only *one* at a time
// dejar solo una de las dos lineas siguientes:
#define CON_DBFCDX
//#define CON_ADS
#ifdef CON_ADS
#include "ads.ch"
REQUEST _ADS
#endif
STATIC aCampos := { {"Codigo", "C", 6, 0}, {"Nombre", "C", 35, 0} }
PROCEDURE FILES()
Local n := 0, h:=Array(NFILES)
#ifdef CON_ADS
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
SET SERVER LOCAL
SET FILETYPE TO CDX
SET CHARTYPE TO OEM
SET AXS LOCKING ON
AdsRightsCheck(.F.)
#endif
CLS
AFill( h, 0 )
DO WHILE n < NFILES
n++
@10,0 SAY "Building files.... "+Str( n )
DbCreate( "File" + LTrim( Str( n ) ), aCampos )
USE ( "File" + LTrim( Str( n ) ) ) NEW
#ifdef CON_ADS
INDEX ON CODIGO TAG CODIGO TO ( "File" + LTrim( Str( n ) ) )
#endif
CLOSE DATA
ENDDO
n := 0
DO WHILE n < NFILES
n++
@12,0 SAY "Opening files.... "+Str( n )
USE ( "File" + LTrim( Str( n ) ) ) NEW
#ifdef CON_ADS
SET ORDER TO TAG CODIGO
#endif
ENDDO
CLOSE DATA
n := 0
DO WHILE n < NFILES
n++
@14,0 SAY "Deleting files.... "+Str( n )
FErase ( "File" + LTrim( Str( n ) ) + ".dbf" )
ENDDO
RETURN NIL