Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN ENDSCAN with INSERT statment...
Message
De
30/11/2004 14:17:15
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
30/11/2004 05:07:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
OS:
Windows XP SP1
Divers
Thread ID:
00965286
Message ID:
00965795
Vues:
11
>This code is kind of 'asking for trouble' :)
>U can achieve much cleaner solution, by inserting new records into temporary cursor of the same structure while scaning original table and then simply dump them in after main scan is done.
>
>so code cld look something like this ;
>
>
>SELECT MyTable
>local aStru(1)
>afields(aStru)
>create cursor tmpTable from array aStru
>SELECT MyTable
>go top
>scan
>   .
>   scatter to laArray
>   .
>   do case
>
>     case ...
>     insert into tmpTable from array laArray
>
>     case ...
>
>   endcase
>   .
>endscan
>.
<b>append from dbf("tMyTable")     && need dbf() here</b>
>.
>
>
>
The bolded is the correction.

But if I understand well, the original problem was that the appended records weren't processed at all. That'd be better solved with what Sergey proposed, to save the current record's recno() before inserting, and GoTo it afterwards.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform