Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric overflow issue
Message
From
03/12/2001 17:25:08
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00588052
Message ID:
00588980
Views:
23
>>[snip]
>>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?
>>

>AFIELDS gives some info, and there are a few more that I cant think of off the top of my head.

Yes, you're right about AFIELDS(), although what I would expect, as I said before, was something like the companion function of FSIZE(): if we have a function that gives the size of a field why don't we have a function that reports the field's precision?

>But by passing the Size and Dec you can use this for more then just a field of an opened database. Making it a general approach.
>If I was doing something with checking for overflows, I would no doubt do an AFIELDS()
>then Loop through that, take the size and precision, pass it into the above code, and then replace for myField > maxVal, though it isnt the best way to do the replacement either, replace for locks the entire table if im not mistaken.

There will be allways place for robustness and optimization, I guess...

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

Click here to load this message in the networking platform