Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Currency type field question
Message
From
08/07/1999 07:27:52
 
 
To
07/07/1999 15:45:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00238443
Message ID:
00238739
Views:
19
>>>Hello,
>>>
>>>When I use a "Calculate Sum(Invtotal) to X" command, Foxpro makes X a currency field. I am trying to replace a field in a table (defined as N(9,2) and always get 0 in the receiving field. I know why I have zeros, but I don't know HOW to change the type field in X. Anybody have any ideas?
>>>
>>>Any help would be appreciated.
>>>
>>>Barry
>>
>>Can you use the MTON() FUNCTION?
>
>Hi Bill,
>Thanks for responding. I can use the Mton() function in the Command window and it works perfectly. In my program is crashes my system with the infamous message:
>"The program has performed an illegal operation and will be shut down"
>
>
>
>It's straighforward code.
>Calculate SUM(seldetail.total) to X
>After execution X looks like $ 7.4000
>My next instruction is x = mton(X)
>
>and the system crashes. I'm using VFP 5.0. 64MB. Dont' understand it. Any ideas?
>
>Thanks Again,
>
>Barry

There is an MS KB article, Q161053 describing this problem after CALCULATE() functions is used. Their fix is to use STR() followed by VAL() on the calculated amounted. You might try thjis and/or check the article. I seem to recall another bug type problem with using CALCULATE() and currency fields, but not sure on this one. You might want to search MS Kb on this one too.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform