Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate and transform
Message
From
05/03/1998 19:23:03
 
 
To
05/03/1998 19:07:19
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00082848
Message ID:
00082854
Views:
32
>>Hello Everybody!
>>
>>I always get a GPF: Memory couldnot be read Error, if I run the following code: (simplified)
>>
>>use myfile as myfile
>>select numericfield to TempFile from myfile
>>use in myfile
>>mynumericvar=0
>>calculate sum(numericfield) to mynumericvar
>>charVar=transform(mynumericvar,"### ### ###.##") >> GPF occurs at this line
>>
>>If instead of mynumericvar, I use a fix number in transform (like 123456), everything is OK.
>>mynumericvar is a positiv number after the sum. In case of using str() instead of transform() no problem occurs.
>>I tried to store mynumericvar into an other variable, but it didnot solve the problem.
>>
>>Any comment?
>>
>>TIA
>>
>>BB
>
>Have you tried looking at the value of mynumericvar before running TRANSFORM()? It it some strange number?
>
>Ed

Hello Ed!

Thanks for your quick answer!
The number is normal. But I have to modify the program lines I wrote earlier. The field is currency, not numeric. The select destination is table type. (not cursor).
In the last some minutes I read in MS KB, that Calculate sum on currency fields in cursor can cause problems - like my one - at subsequent lines in 5.0.
OK, but in this case it is not cursor, and I use 5.0 with serv pack 3, that means 5.0a.
P.S.: Now I found a works around, MS suggested it:
after calculating,
mynumericvar=val(str(mynumericvar))

BB
BB
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform