Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN Surprise
Message
De
27/09/2010 12:46:16
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01482888
Message ID:
01482895
Vues:
101
>>Was just surprised when SCAN doesn't start with the first record but the current record. The intent was to examine all records.
>>
>>The code is:
>>
>>
>>* cursor DTemporal is created with SELECT .... INTO CURSOR DTemporal READWRITE
>>INDEX ON xxx TAG xxx
>>...
>>DELETE ALL FOR <condition> IN DTemporal
>>* Several records are added.  Current record is last one added.
>>* The index has no effect on the order, at least as shown by BROWSE
>>
>>...
>>
>>SELECT DTemporal
>>SET DELETED OFF && To see all records
>>* The intent is to examine all records
>>SCAN
>>      IF DELETED()
>>...
>>ENDSCAN
>>
>>
>>The solution in to add GO TOP, of course, but I sincerely expected the SCAN to start with the first record. Instead it started with the current record.
>
>
>
>
>Strange,
>That works for me:
>
>CLEAR
>CREATE CURSOR crsTest (Name C(20))
>FOR lnFor = 1 TO 40
>    INSERT INTO crsTest VALUES ('Name '+TRANSFORM(lnFor))
>NEXT
>DELETE ALL FOR RECNO() < 10
>SET DELETED OFF
>SCAN
>? Name
>ENDSCAN
>
>
>
>Do not forget that you have an active ORDER so maybe your current record is the first in the order?

Not only that, I had related some tables that should not have been. Have not confirmed this was the problem, but I think so.

Thanks,

Alex
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform