Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric overflow issue
Message
 
To
30/11/2001 12:05:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00588052
Message ID:
00588568
Views:
30
>>I am trying to do a [replace all] for cField = ***** (Numeric overflow) but I get a error cause ***** has no quotes and isn't a number
>>
>>Yes it is a numeric field and has overflow that looks like ****
>
>Hi, Stephen
>
>... for cField>val(replicate('9',fsize('cField')))
>
>bye

This wont work if the field has decimals, ie N(10,3)
Have to write a function to determine max value to do it with a replace like that.

Something like this should work.
PROCEDURE maxval
LPARAMETERS size, dec
LOCAL cNum
cNum = REPLICATE('9', dec)
cNum = "." + m.cNum
cNum = REPLICATE('9', m.Size - (m.dec + 1)) + m.cNum
RETURN VAL(m.cNum)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform