Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Something to do with bufferring I guess ??
Message
De
31/03/1997 14:52:28
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Something to do with bufferring I guess ??
Divers
Thread ID:
00026292
Message ID:
00026292
Vues:
78
Does someone know why the 2 following methods to calculate MyTotal don't give me the same value.

I think I mist something with buffering but I'm not
100% sure.

Thank's

...
...some calculations here
...SELECT TABLE1
...REPLACE FIELD1 WITH NewValue

*method 1
lnMyTotal=0
SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1;
WHERE FIELD3=myId INTO CURSOR TEMP1
CALCULATE SUM(FIELD1) FOR (FIELD1>0 AND FIELD2>0) TO MyTotal
WAIT WINDOW '1 : ' + STR(lnMyTotal)

*method 2
lnMyTotal=0
SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1;
WHERE FIELD3=myId INTO CURSOR TEMP1
SCAN FOR FIELD1>0 AND FIELD2>0
lnMyTotal = lnMyTotal + FIELD1
ENDSCAN
WAIT WINDOW '2 : ' + STR(lnMyTotal)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform