Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing application after an error
Message
From
09/08/2005 10:12:57
 
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01039447
Message ID:
01039538
Views:
15
>>>Hi everybody,
>>>
>>>When an error occurs in the application, the error message is displayed, but then there is quite often a situation, where application could not be gracefully closed and VFP errors are displayed and the user has to kill the application, because there is no other way out. The most typical problem is unclosed transaction. Should the application be smart enough to rollback all open transactions in Cleanup code?
>>
>>Yes. I consider the operation of manual killing as a bug.
>>
>>>
>>>Did you find this problem as well? How did you solve it?
>>>
>>
>>Catch every error exit path, and fix it.
>>
>>>Thanks in advance.
>
>Hi Fabio,
>
>Do you advocate to write bug-free code (if this is possible at all) or improve the Cleanup routine and add code to rollback in all opened DS?

Hi Naomi,
of course.

A decent application has to have a complete control of the bugs:
- a structure of hierarchical traps
- the principal trap has to be immune from the bugs and owes
to capture every predictable or unpredictable bug
- every transaction has to have a specific trap
- every interaction has to have a specific trap
- other levels are desirable
- every predictable error has to be listed
for gravity in basic to the effects that it provokes
- in the case the trap of level N can contain the effects to local level
it is enough that it interrupt the local sequence and return to the preceding state
- in the case doesn't succeed or doesn't know whether to resolve it besides returning to the state, precedent has to pass the error to the trap N-1.
In practice, a program is well done if the system of traps succeeds
to survive or to check (eventually committing suicide itself) to every possible sequence of code, also casual, so that the output is Always correct
(better any outputs that the possibility of a wrong output)

Unfortunately the traps of VFP use the traps of C++ that use the traps of the OS that it uses the traps of the CPU, and therefore to write traps without bugs in VFP is an illusion.

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform