Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Something to do with bufferring I guess ??
Message
From
31/03/1997 14:52:28
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Something to do with bufferring I guess ??
Miscellaneous
Thread ID:
00026292
Message ID:
00026292
Views:
80
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)
Next
Reply
Map
View

Click here to load this message in the networking platform