Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric overflow issue
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00588052
Message ID:
00588964
Views:
43
>>>Chris and Antonio,
>>>
>>>Testing for myField = 1/0 returns true on a field with a numeric overflow condition. So this should be a good general solution, or you could SCAN/ENDSCAN and check the condition on each record if necessary:
>>>
>>>REPLACE myField with 0 for myField = 1/0
>>>
>>>>
>>>>AFIELDS gives some info, and there are a few more that I cant think of off the top of my head.
>>>>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.
>>>>
>>
>>I can not get that condition to be true.
>>I overflowed a field,
>>
>>
>>?FSize("Num")   => 5
>>REPLACE Num WITH 99999999999
>>? Num            => *******
>>? Num = 1/0      => .F.
>>
>
>Try:
>
>
>? "*" $ TRANSFORM (Num)
>
>
> Jay

Yup that appears to work,
How much of a performance hit is TRANSFORM though?
Im not really sure
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform