Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A great error trapping routine?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00040566
Message ID:
00041931
Views:
39
Marc & Sorin,

I wonder, though, if which datasession caused the error is really part of the problem. Assuming two instances of the same form, and you get an error in one, I would think that it would be simply a matter, of what was done in what form. The problem would exist in both instances.

I also wonder sometimes if we get a little too hung up on what's technically correct and what isn't. Let me give you an example that harkens back to the structured programming days (from which OOP sprang) and FP 2.x.

The paradigm says that a program should have only one exit point. Let's say that you had a screen, and you checked both open and close tables. If, for some reason, the table(s) couldn't be opened, the user could be faced with a series of errors, most of which had nothing to do with the real problem (the table couldn't be opened). What was the solution? Write your own code to open the table in Section 1. Then if the table(s) couldn't be opened, execute the return there. But now you two exit points.

As far as I'm concerned, it's OK. Why? Simply because I had a quantifiable reason for "breaking the rules". I think the same thing applies here. Regardless of what's considered to be "good OOP", if there's a quantifiable reason for not following a particular practice, and no other way around it, then don't.

Along these lines, I'm beginning to wonder when and where to define an object's error method. What consideration have to be taken into account? You certainly don't want every object to have a complete error handler, you end up with "code bloat".

As far as the registering business goes, I think that the error handler could tell what forms were active by accessing the _SCREEN system variable. It (registering) is, however, a reasonable alternative.

George

>Sorin and George,
>
>Thank you for caring! :)
>
>Back in the 2.6 days, when there _was_ only one datasession available, I used to dump a display status into an alternate file. It may not be very elegant, but since it is for my own consumption in maintenance, it is appropriate, and face it, in cases of program errors, disp status gives us plenty of information at a very low development price.
>
>... and George, I think you are right, if we want the same functionality in VFP, we will have to work for it and develop something along the lines of what you suggest. It seems silly though, because datasessions as a concept is related to the database rather than to oop, so why is there no way programatically, (from the menu you can under window/datasession long after the owning objects are dead and burried!) , to access existing datasessions?
>
>Marc
>
>
>
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform