Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SUM not SUMming?
Message
From
01/11/2006 09:37:21
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01166137
Message ID:
01166147
Views:
13
Hi Sergey,

>Why aren't you using SELECT...INTO ARRAY? It doesn't change record pointer.
>

I guess for two reasons:

1. I have always been in the habit of avoiding arrays as I find variable names much more descriptive.

2. This is running against a buffered cursor with non-committed changes in it so SELECT .. INTO won't work on the buffered data (yes I know there was a switch added recently that fixes that, but I haven't got in the habit of using it). Hmmm... is that my answer, does SUM work on the non-buffered data only? Nah, I would get 67 as the result as I only added 1.

>>I am running this code:
>>
>>
>>SELECT c_NationalityDetails
>>m.lnOldRecNo = RECNO()
>>
>>SUM nad_nonnationals, nad_nationals, nad_nonnationals + nad_nationals TO nSum1, nSum2, nSumTotal
>>
>>WAIT WINDOW TRANSFORM(nSum1) + " + " + TRANSFORM(nSum2) + " = " + TRANSFORM(nSumtotal)
>>
>>
>>I get the following displayed:
>>
>>64 + 4 = 9
>>
>>Does anyone have any idea why this could be happening?
>>
>>I've tried the sample code in the help on SUM and that displays correctly.
>>
>>I am stumped!
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform