DbCopyStruct

Post Reply
hua
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

DbCopyStruct

Post by hua »

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
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: DbCopyStruct

Post by nageswaragunupudi »

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: Select all | Expand

COPY STRUCTURE TO cnewdbf
Regards

G. N. Rao.
Hyderabad, India
hua
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: DbCopyStruct

Post by hua »

Thanks for the explanation Rao.
I am using dbCopyStruct() because I was sub-classing TDatabase() to add that function.

Code: Select all | Expand

method dbCopyStruct(cDataBase, aFieldList) inline ( ::cAlias )->(__dbCopyStruct(cDataBase, aFieldList))
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: DbCopyStruct

Post by karinha »

Code: Select all | Expand

// 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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: DbCopyStruct

Post by karinha »

Code: Select all | Expand

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
Post Reply