FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Database Object
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Database Object
Posted: Wed Sep 22, 2010 04:21 PM

Hi, how i can make a empty object equal a other object? I explain:

oCadCli:Load()

oCadCli1:Blank()

oCadCli have many fields i want do load all fields and datas to oCadCli1.

Thanks in advance.

Wanderson.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Database Object
Posted: Wed Sep 22, 2010 04:29 PM
Wanderson,

Assuming the two DBFs have the same structure you can simply do this:

Code (fw): Select all Collapse
for i=1 to oCadCli:reccount
   oCadCli1:aBuffer[i]:= oCadCli:aBuffer[i]
next

Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Database Object
Posted: Wed Sep 22, 2010 04:49 PM
James Bott wrote:Wanderson,

Assuming the two DBFs have the same structure you can simply do this:

Code (fw): Select all Collapse
for i=1 to oCadCli:reccount
   oCadCli1:aBuffer[i]:= oCadCli:aBuffer[i]
next

Regards,
James


Thank you James! That's all i need :-)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Database Object
Posted: Wed Sep 29, 2010 03:26 PM
Sorry, I found a bug. oCadCli:reccount should be oCadCli:fcount().

I hope you already discovered this.

James


Code (fw): Select all Collapse
for i=1 to oCadCli:fcount()
   oCadCli1:aBuffer[i]:= oCadCli:aBuffer[i]
next
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion