@td gives /OV

Kenneth Brody kenbrody at spamcop.net
Fri Apr 14 07:37:59 PDT 2017


On 4/14/2017 9:12 AM, Jose Lerebours via Filepro-list wrote:
> On 04/14/2017 08:54 AM, Robert Repko via Filepro-list wrote:
>> I know what the code is doing I wrote the program, if it returns a
>> negative number I adjust it from there. I do that routine all time on
>> a different server with no errors.  The question is why does @td return
>> /OV
>>
>>
> I do not even recall if filePro will look at mid(@td,"1","2") as numeric
> thus being able to do math reliably. That said, have you tried something
> like:
>
> aa(2,.0)=mid(@td,"1","2"); aa=aa-"6"  ?????

While the result of MID() is not a numeric field, the fact that, in this
case, it will normally contain numbers means that filePro can do math on it.

Consider, for example, that in the statement:

     aa = aa - "6"

The value "6" is not a numeric field, either.

> This will ensure that mid(@td,"1","2") is a true number and should
> filePro change how it handles operations such as what you use, your code
> is in the safe ... no time bombs!!!
>
> We all know /OV means "overflow" ... So, what happens if "04" is not a
> number but a literal string?

The result of "04"-"6" is "-2", which fits perfectly well in a (2,.0) field.

> If you use it all the time and have it spread throughout your code, what
> results are you getting else where?

As he previously mention, @TD itself contained "/OV".  He has since
discovered that PFCMARK was set to 15 and not 25.  Hence, the overflow.

-- 
Kenneth Brody


More information about the Filepro-list mailing list