FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DbCopyStruct
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
DbCopyStruct
Posted: Mon May 20, 2024 03:19 AM

Hi guys,

when I tried to compile with BCC7.7 and Harbour I get unresolved external for dbCopyStruct().

The function is in which lib? For now I use __dbCopyStruct() instead

TIA

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: DbCopyStruct
Posted: Mon May 20, 2024 03:59 AM
Both dbCopyStruct() and __dbCopyStruct() (with the same functionality) are supported only by xHarbour.
Harbour provides __dbCopyStruct() only.

My humbles submission:
It is always a good practice to use COMMAND syntax where available
We will not get into these problems
eg:
Code (fw): Select all Collapse
COPY STRUCTURE TO cnewdbf
Regards



G. N. Rao.

Hyderabad, India
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: DbCopyStruct
Posted: Mon May 20, 2024 05:12 AM
Thanks for the explanation Rao.
I am using dbCopyStruct() because I was sub-classing TDatabase() to add that function.
Code (fw): Select all Collapse
method dbCopyStruct(cDataBase, aFieldList) inline ( ::cAlias )->(__dbCopyStruct(cDataBase, aFieldList))
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DbCopyStruct
Posted: Mon May 20, 2024 12:58 PM
Code (fw): Select all Collapse
// C:\FHW\SAMPLES\DBSTRUCT.PRG

#include "FiveWin.ch"

// Require: RDD.LIB

FUNCTION Main()

   /*
   // Create a new file that contain part of the original structure
   LOCAL aList

   USE TEST

   aList := { "STATE" }

   // dbCopyStruct( "ONLYNAME.dbf",  aList ) // xHarbour only

   __dbCopyStruct( "ONLYNAME.dbf",  aList )  // Harbour / xHarbour
   */

   // .and.

   // Open a database,  then copy its structure to a new file,
   // Open the new file and list all its records
   USE Test

   // dbCopyXStruct( "TestStru" )  // xHarbour Only

   __dbCopyXStruct( "TestStru" )   // xHarbour .AND. Harbour

   USE TestStru

   BROWSE()

RETURN NIL

// FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DbCopyStruct
Posted: Mon May 20, 2024 03:30 PM
Code (fw): Select all Collapse
Harbour:

C:\HBBCC74\src\rdd

03/04/2020  19:58             5.900 dbstrux.prg

xHarbour:

C:\XHBBCC74\source\rdd

25/02/2020  13:20            13.638 dbstrux.prg
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion