summaryrefslogtreecommitdiff
path: root/src/examples/xb_ex_v3_create_dbf.cpp
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2023-08-14 21:07:48 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2023-08-14 21:07:48 +0200
commitd850e78baf62d1f472a3a296f407c127c64cec88 (patch)
tree39725643b44c91ea25809766cf95cd0b1173e880 /src/examples/xb_ex_v3_create_dbf.cpp
parent15f88452d39eee5a89551a89ef2b93df5168ba2f (diff)
parentc894a7cdd8686ea695602a23a511a3f1b0d047be (diff)
Update upstream source from tag 'upstream/4.1.4'
Update to upstream version '4.1.4' with Debian dir 403f575aa88344456029245280a05149f0173f2e
Diffstat (limited to 'src/examples/xb_ex_v3_create_dbf.cpp')
-rwxr-xr-xsrc/examples/xb_ex_v3_create_dbf.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/examples/xb_ex_v3_create_dbf.cpp b/src/examples/xb_ex_v3_create_dbf.cpp
index ecfcd72..d6f7047 100755
--- a/src/examples/xb_ex_v3_create_dbf.cpp
+++ b/src/examples/xb_ex_v3_create_dbf.cpp
@@ -2,7 +2,7 @@
XBase64 Software Library
-Copyright (c) 1997,2003,2014,2022 Gary A Kunkel
+Copyright (c) 1997,2003,2014,2022,2023 Gary A Kunkel
The xb64 software library is covered under the terms of the GPL Version 3, 2007 license.
@@ -47,19 +47,19 @@ int main()
// Create Dbase3 NDX style indices if support compiled in
-#ifdef XB_NDX_SUPPORT
+ #ifdef XB_NDX_SUPPORT
xbIxNdx MyIndex1( MyDbfFile ); /* class for index 1 */
xbIxNdx MyIndex2( MyDbfFile ); /* class for index 2 */
xbIxNdx MyIndex3( MyDbfFile ); /* class for index 3 */
-#endif
+ #endif
-// fixme
-// Create Clipper NTX style indices if support compiled in - bring this back to life in a future release
-#ifdef XB_INDEX_NTX
+ // fixme
+ // Create Clipper NTX style indices if support compiled in - bring this back to life in a future release
+ #ifdef XB_INDEX_NTX
xbNtx MyIndex4( &MyDbfFile ); /* class for index 4 */
xbNtx MyIndex5( &MyDbfFile ); /* class for index 5 */
-#endif
+ #endif
xbInt16 rc;
@@ -68,7 +68,7 @@ int main()
else
{
-#ifdef XB_NDX_SUPPORT
+ #ifdef XB_NDX_SUPPORT
xbIx *pIx;
void *pTag;
@@ -83,6 +83,7 @@ int main()
if(( rc = MyDbfFile->CreateTag ( "NDX", "MYINDEX1.NDX", "LASTNAME", "", 0, 1, XB_OVERLAY, &pIx, &pTag )) != XB_NO_ERROR )
x.DisplayError( rc );
+
/* define a multi-field index "LASTNAME FIRSTNAME" */
if(( rc = MyDbfFile->CreateTag( "NDX", "MYINDEX2.NDX", "LASTNAME+FIRSTNAME", "", 0, 1, XB_OVERLAY, &pIx, &pTag )) != XB_NO_ERROR )
x.DisplayError( rc );
@@ -91,12 +92,19 @@ int main()
if(( rc = MyDbfFile->CreateTag( "NDX", "MYINDEX3.NDX", "ZIPCODE", "", 0, 0, XB_OVERLAY, &pIx, &pTag )) != XB_NO_ERROR )
x.DisplayError( rc );
-#endif
+ std::cout << "Tag Count in MYINDEX3.NDX = " << pIx->GetTagCount() << "\n";
+ xbString sTagName;
+ sTagName = pIx->GetTagName( &pTag );
+ std::cout << "Tag Name in MYINDEX3.NDX = " << sTagName.Str() << "\n";
+
+
+ #endif
}
MyDbfFile->Close(); /* Close database and associated indexes */
+ delete MyDbfFile;
-#endif // XB_DBF3_SUPPORT
+ #endif // XB_DBF3_SUPPORT
return 0;
}