Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: kw@e﹐s-system.dot.de Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Why doesn't the error handler catch division by 0? Date: Fri, 06 Mar 2015 08:49:38 +0100 Lines: 40 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net tUC7T3+s5YrYaJRh1f7veAG9U1UCOylfHZL0kcoUj9oKiyP1oQ Cancel-Lock: sha1:hfUpB9slicByljRRXU3g2bDhdt8= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: Xref: csiph.com comp.lang.clipper.visual-objects:7833 Hi Dick, I don't see your problem here, everything works as expected ... Just some questions: bLastHandler := ErrorBlock({|oErr| MyHandler(oErr, TRUE)}) What is this line good for ? What happens if you delete it ? How are n and n2 declared ? Karl Am 06.03.2015 um 00:33 schrieb D.J.W. van Kooten: > > The code below doesn't handle a division by 0 but gives a 'An > unhandled exception error occured in module VO28GUI.DLL or your > application! > > However, an array[0] access is handled by the RECOVER code: > > LOCAL cobOldErrFunc AS USUAL > LOCAL a:={} AS ARRAY > bLastHandler := ErrorBlock({|oErr| MyHandler(oErr, TRUE)}) > cobOldErrFunc := ErrorBlock( {|oErr|_Break(oErr)} ) > BEGIN SEQUENCE > n:=0 > n2:=5/n // This does not go to RECOVER > n2:=a[0] // This does go to recover > RECOVER > MessageBox(SELF:Handle(),String2Psz("Run time error > "),String2Psz(""),MB_OK) > END SEQUENCE > ErrorBlock(cobOldErrFunc) > > > Why wouldn't it handle the division by zero error I was wondering? > > Dick >