Sytze de Boer <[email protected]> wrote:

>I wonder if some of you care to comment.
>
>There's a zillion places in my app where something is updated and an
>example could be
>
>lnOv=10
>lnNv=20
>newvalue=lnOv/lcNv
>replace currentcost with newvalue
>
>No problem sofar
>
>If lnOV=0
>   we end up with numeric overflow
>
>The line "replace currentcost with newvalue" can be all sorts of things
>e.g. replace currentprice with newvalue
>or replace xyears with somethingelse
>
>At the moment I trap error 39 with a message to say a numeric overflow
>occurred, and continue the rest of the routine
>(as opposed to crashing out or whatever)
>
>I think what I'm trying to achieve is to trap error 39 and somewhow
>substitute the line that says
>"replace whateverfield with 0" (or 1)
>
>--
>Regards
>Sytze de Boer
>Kiss Software
>
Using astackinfo() you can get the line of code that failed. (Perhaps 
message(1) does it to.) If the variable you are setting is private you would be 
able to update it with macro substitution.
If it is local, log it, email it, or print it out to know where the problem is. 
Astackinfo() returns the number of rows. You'll get the method, class, and line 
number in the array.

-- 
Tracy Pearson
PowerChurch Software

Sent from my Android phone with K-9 Mail. 

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to