From 6615e7fb9d39f8cd721ecce564194ad9b05960dd Mon Sep 17 00:00:00 2001 From: Patrick Mast Date: Sat, 29 Dec 2001 19:48:04 +0000 Subject: [PATCH] 2001-12-28 20:39 UTC+0100 Patrick Mast * contrib/apollo + Added function sx_AppendBlank() + Added function sx_Close() + Added function sx_Commit() + Added function sx_CreateField() + Added function sx_Eof() + Added function sx_GetString() + Added function sx_GoTop() + Added function sx_IndexTag() + Added function sx_RecNo() + Added function sx_Replace() + Added function sx_Skip() + Added function sx_Use() + Added function sx_Zap() * contrib/apollo/test * Added functions in a test application. --- harbour/ChangeLog | 18 +++ harbour/contrib/apollo/apollo.c | 141 +++++++++++++++++++++++- harbour/contrib/apollo/test/apollo.prg | 59 +++++++++- harbour/contrib/apollo/test/bld_b32.bat | 1 + 4 files changed, 213 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d73117a6db..81e4c9c358 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,24 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + * Added added functions in the test application. + +2001-12-30 04:40 UTC+0700 Andi Jahja + * include/hbapi.h + * declaration of exported functions in source/vm/extend.c and + source/vm/arrays.c synchronized ( MSVC requirement ) + +2001-12-29 19:00 UTC-0300 Luiz Rafael Culik + * source/vm/maindllp.c + * All extended function api implemented and started the array api + + include/hbtypes.h + * Header file for maindllp.c. Contain the typedef needed by maindllp.c + * contrib/hbzlib/zipcomp.cpp + * fixed an small error + * utils/hbmake/hbmake.prg + * some enhecements to select library code + * source/vm/extend.c + source/vm/arrays.c * All functions marked as exported 2001-12-28 20:39 UTC+0100 Patrick Mast diff --git a/harbour/contrib/apollo/apollo.c b/harbour/contrib/apollo/apollo.c index cc0befffd2..b7e83ee771 100644 --- a/harbour/contrib/apollo/apollo.c +++ b/harbour/contrib/apollo/apollo.c @@ -50,6 +50,10 @@ * */ +/* -----------------29/12/2001 19:23----------------- + * NOTE: Functions are liste alfabeticly + * --------------------------------------------------*/ + #define HB_OS_WIN_32_USED #define MAX_STR_LEN 255 @@ -57,6 +61,133 @@ #include "sde60.h" +/* -----------------29/12/2001 19:21----------------- + * sx_AppendBlank() + * --------------------------------------------------*/ +HB_FUNC( SX_APPENDBLANK ) +{ + sx_AppendBlank( ); +} + + +/* -----------------29/12/2001 20:13----------------- + * sx_Close() + * --------------------------------------------------*/ +HB_FUNC( SX_CLOSE ) +{ + sx_Close( ) ; +} + + +/* -----------------29/12/2001 19:26----------------- + * sx_Commit() + * --------------------------------------------------*/ +HB_FUNC( SX_COMMIT ) +{ + sx_Commit( ); +} + + +/* -----------------29/12/2001 19:18----------------- + * sx_CreateField() + * --------------------------------------------------*/ +HB_FUNC( SX_CREATEFIELD ) +{ + sx_CreateField( hb_parc( 1 ), /* Field name */ + hb_parc( 2 ), /* Field type */ + hb_parni( 3 ), /* Field lenght */ + hb_parni( 4 ) ); /* Field decimals */ +} + + +/* -----------------29/12/2001 20:13----------------- + * sx_Eof() + * --------------------------------------------------*/ +HB_FUNC( SX_EOF ) +{ + hb_retl( sx_Eof( ) ); +} + + +/* -----------------29/12/2001 20:13----------------- + * sx_GetString() + * --------------------------------------------------*/ +HB_FUNC( SX_GETSTRING ) +{ + char *szString=(char*)sx_GetString( hb_parc( 1 ) ); /* Field name */ + hb_retc(szString); +} + + +/* -----------------29/12/2001 20:13----------------- + * sx_GoTop() + * --------------------------------------------------*/ +HB_FUNC( SX_GOTOP ) +{ + sx_GoTop( ) ; +} + + +/* -----------------29/12/2001 19:59----------------- + * sx_IndexTag() + * --------------------------------------------------*/ +HB_FUNC( SX_INDEXTAG ) +{ + hb_retni( + sx_IndexTag( hb_parc( 1 ), /* Field name */ + hb_parc( 2 ), /* Tag name */ + hb_parc( 3 ), /* Index expression as a string */ + hb_parni( 4 ), /* Option (0=Standard) (1=Unique) (2=Roll-Your-Own) */ + hb_parl( 5 ), /* True for a descend index */ + hb_parc( 6) ) ); /* Condition */ +} + + +/* -----------------29/12/2001 20:13----------------- + * sx_RecNo() + * --------------------------------------------------*/ +HB_FUNC( SX_RECNO ) +{ + hb_retni( sx_RecNo( ) ); +} + + +/* -----------------29/12/2001 19:59----------------- + * sx_Replace() + * --------------------------------------------------*/ +HB_FUNC( SX_REPLACE ) +{ + sx_Replace( hb_parc( 1 ), /* Field name */ + hb_parni( 2 ), /* Data type */ + hb_parc( 3) ); /* Data */ +} + + +/* -----------------29/12/2001 20:13----------------- + * sx_Skip() + * --------------------------------------------------*/ +HB_FUNC( SX_SKIP ) +{ + sx_Skip( hb_parni( 1 ) ); /* Number of records to skip */ +} + + + +/* -----------------29/12/2001 19:17----------------- + * sx_Use() + * --------------------------------------------------*/ +HB_FUNC( SX_USE ) +{ + hb_retni( sx_Use( hb_parc( 1 ), /* Filename */ + hb_parc( 2 ), /* Alias */ + hb_parni( 3 ), /* OpenMode */ + hb_parni( 4) )); /* RDE Type */ +} + + +/* -----------------29/12/2001 19:17----------------- + * sx_Version() + * --------------------------------------------------*/ HB_FUNC( SX_VERSION ) { char *szVersion=(char*)sx_Version(); @@ -65,8 +196,10 @@ HB_FUNC( SX_VERSION ) } -HB_FUNC( SX_CREATEFIELD ) +/* -----------------29/12/2001 19:18----------------- + * sx_Zap() + * --------------------------------------------------*/ +HB_FUNC( SX_ZAP ) { - sx_CreateField( hb_parc( 1 ), hb_parc( 2 ), hb_parni( 3 ), - hb_parni( 4 ) ); -} \ No newline at end of file + sx_Zap( ); +} diff --git a/harbour/contrib/apollo/test/apollo.prg b/harbour/contrib/apollo/test/apollo.prg index fe032c0b12..19204a9437 100644 --- a/harbour/contrib/apollo/test/apollo.prg +++ b/harbour/contrib/apollo/test/apollo.prg @@ -50,8 +50,63 @@ * */ +/* ************************************ */ +/* Data type identifiers for sx_Replace */ +/* ************************************ */ +#define R_INTEGER 1 +#define R_LONG 2 +#define R_DOUBLE 8 +#define R_JULIAN 32 +#define R_LOGICAL 128 +#define R_CHAR 1024 +#define R_DATESTR 1056 +#define R_MEMO 3072 +#define R_BITMAP 4096 +#define R_BLOBFILE 8192 +#define R_BLOBPTR 8193 +#define R_GENERAL 8195 + +#define SDENTX 1 // CA-Clipper compatible DBF-NTX driver +#define SDEFOX 2 // FoxPro compatible DBF-IDX/CDX driver +#define SDENSX 3 // Vista DBF-NSX driver + +#define READWRITE 0 +#define READONLY 1 +#define EXCLUSIVE 2 + Function Main() +LOCAL nAlias,f - Alert( sx_Version() ) + ? "Apollo version " + sx_Version() -return + nAlias:=sx_Use("TEST.DBF","test2",EXCLUSIVE,SDENSX) + sx_Zap() + IF Valtype(nAlias)="N" .AND. nAlias # 0 + ? "OK opening 'TEST.DBF'" + + ? "Adding 1000 records..." + FOR f=1 to 1000 + sx_AppendBlank() + sx_Replace("FIRST", R_CHAR, "Patrick " + Str( f ) ) + sx_Replace("LAST" , R_CHAR, LTrim( Str( f ) ) + " Mast" ) + sx_Replace("NOTES", R_MEMO, "This is record " + LTrim( Str( f ) ) ) + sx_Commit() + NEXT + + ? "Creating Index..." + sx_IndexTag(,"LAST","LAST+FIRST",0) + ? "Created a HiPer-Six index. See 'TEST.NSX'" + + sx_GoTop() + WHILE !sx_Eof() + @ 17,2 SAY "RecNo: "+ LTrim( Str( sx_RecNo() ) ) + @ 18,2 SAY sx_GetString( "LAST" ) + sx_Skip(1) + ENDDO + sx_Close() + + ELSE + ? "ERROR Opening 'TEST.DBF'" + ENDIF + +return \ No newline at end of file diff --git a/harbour/contrib/apollo/test/bld_b32.bat b/harbour/contrib/apollo/test/bld_b32.bat index 73313fa126..7bd51205b3 100644 --- a/harbour/contrib/apollo/test/bld_b32.bat +++ b/harbour/contrib/apollo/test/bld_b32.bat @@ -11,6 +11,7 @@ rem Instead, make a local copy and modify that one, or make a call to rem this batch file from your customized one. [vszakats] rem --------------------------------------------------------------- +cls set HB_ARCHITECTURE=w32 set HB_COMPILER=bcc32