Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric overflow issue
Message
From
03/12/2001 03:41:17
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00588052
Message ID:
00588598
Views:
31
>>>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
>>
>>... for cField>val(replicate('9',fsize('cField')))
>>
>>bye
>
>This wont work if the field has decimals, ie N(10,3)

You're right.

>
>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)
>
Since size and dec must be passed as arguments to the function, this is hardly a general approach. In fact, knowing that information, it would be simpler to hardcode the value in the scope expression (like Caroline suggested).

Strangely, VFP seems to not have a function to give you the precision of a numeric field, or am I missing something?

bye
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform