General information
Category:
Coding, syntax & commands
Title:
Something to do with bufferring I guess ??
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only