I thought I was going nuts

Try this
myerror=ASTACKINFO(xerror)
?xerror(6)

Please agree with me, it chops off the last character



On Thu, Aug 11, 2011 at 2:13 PM, Sytze de Boer <[email protected]> wrote:
> That's the type of answer I was hoping for
> Tracey, thank you, I'm going to check this out.
>
> S
>
>
> On Thu, Aug 11, 2011 at 2:08 PM, Tracy Pearson <[email protected]> wrote:
>> 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.
>>
[excessive quoting removed by server]

_______________________________________________
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/CAG1nNy_V=4ctcjd1t-_nibgtquguljrfdm0m+2v5f0gowm0...@mail.gmail.com
** 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