Database Object

Database Object

Postby Wanderson » Wed Sep 22, 2010 4: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.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Database Object

Postby James Bott » Wed Sep 22, 2010 4:29 pm

Wanderson,

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

Code: Select all  Expand view
for i=1 to oCadCli:reccount
   oCadCli1:aBuffer[i]:= oCadCli:aBuffer[i]
next

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Database Object

Postby Wanderson » Wed Sep 22, 2010 4:49 pm

James Bott wrote:Wanderson,

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

Code: Select all  Expand view
for i=1 to oCadCli:reccount
   oCadCli1:aBuffer[i]:= oCadCli:aBuffer[i]
next

Regards,
James


Thank you James! That's all i need :)
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Database Object

Postby James Bott » Wed Sep 29, 2010 3:26 pm

Sorry, I found a bug. oCadCli:reccount should be oCadCli:fcount().

I hope you already discovered this.

James


Code: Select all  Expand view
for i=1 to oCadCli:fcount()
   oCadCli1:aBuffer[i]:= oCadCli:aBuffer[i]
next
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Horizon and 93 guests