Paradox Community

Items in pnews.paradox-programming

Subject:Re: Action after csv import
Date:Tue, 14 Nov 2017 23:37:07 +0100
From:=?UTF-8?B?Q8O0bWU=?= <>
Le 14/11/2017 à 23:27, Côme a écrit :

> Hi
> You could simply use, in a scan loop for instance, 
> tc.CopyToArray(myArray) to copy the initial data of the record in an 
> array (or a dynarray) and then, in the same scan loop, with a second 
> TCursor write in your destination table from the array.
> If the fields have the same name in the two tables you would use a 
> dynarray (the field name will be the index) [to be honest you don't even 
> need the array in this case simply use tc2.Fieldname = tc1.Fieldname], 
> if not, an array (the index will be the position of the field, 1,2...) 
> and then tc2.Fieldname = myArray[2] for example to copy the second field 
> of tc1 in tc2.Fieldname.
> Another possible way is to run an insert query (in SQL or QBE) but with 
> the TCursor approach you can offer a progress bar for example. You have 
> more control with TCursor.

You can even bypass the array with this syntax : tc2.fieldname = tc1(2)
tc1(2) refer to the second field of tc1)


Copyright © 2004