Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY TO...WITH CDX and _TALLY problems (possible VFP5 BU
Message
De
21/08/1998 10:07:44
 
 
À
21/08/1998 10:04:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00128753
Message ID:
00128755
Vues:
31
>Here is an interesting observation I have just recently encountered.
>
>I have a routine that displays the current status of an operation. I use a COPY TO...WITH CDX to copy records needing processing to the user's local machine. I display the number of records copied using the following command:
>
> ? 'Copied '+ALLT(STR(_TALLY))+' record(s) to local'
>
>_TALLY always returns zero (0) when the COPY TO...WITH CDX is issued, no matter how many records are copied. However, when a plain COPY TO (without CDX) is issued _TALLY returns the correct number of records!
>
>Try this:
>
> USE
> COPY NEXT 5 TO
> ? _TALLY
> LOCAL
> COPY NEXT 5 TO WITH CDX
> ? _TALLY
>
>Weird, huh?

I guess the reason is that COPY TO WITH CDX implicitly fires INDEX on newly created table and as it was mentioned on UT recently, INDEX launched with SET TALK OFF sets _TALLY to 0. So, the more reliable way would be check RECCOUNT() for new table.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform