Page 1 of 1

Errorhandling inside DCBROWSECOLs

Posted: Fri Apr 09, 2010 5:44 am
by Tom
Hi, Roger.

I found this code in _DCXBROW.PRG:

Code: Select all

METHOD DC_XbpBrowse:forceStable()
LOCAL bErrorBlock := ErrorBlock({|e|_TrapErrors(e)})
BEGIN SEQUENCE
::XbpBrowse:forceStable()
END SEQUENCE
ErrorBlock(bErrorBlock)
RETURN self
This means that the standard error system or the error system of the app is inactive during "ForceStable".

The :ForceStable method is not only called directly (from my code), but implicit several times (in my opinion during browse creation and refresh calls).

Your code (above) leads to the situation that errors inside functions called using the itemmarked-slots, but also code used inside color-codeblocks (!) do not lead to a runtime error. Wrong color-codeblocks create wrong browse layouts (missing cells, missing rows, no navigation), but no errors (I can create a sample if you need one). This makes debugging difficult in those cases. Errors inside itemmarked-codeblocks sometimes call the DC-error system, but not the runtime error system of the app.

Is this something you left inside from earlier days?

Tom

Re: Errorhandling inside DCBROWSECOLs

Posted: Fri Apr 09, 2010 7:03 am
by rdonnay
Tom -

I don't remember putting that in there.
I must have had a reason at the time.
I think it had something to do with early releases of SL1.

I agree that this should be removed.
I will do it in the next build.

Thanks for catching that.

Roger