TIP: Click on subject to list as thread! ANSI
echo: delphi
to: BRYAN SMITH
from: HENK HAMERS
date: 1996-12-26 05:03:00
subject: Scope of Try-Except

Bryan Smith wrote in a message to All:
 BS> The main question is this.  When Form6.ShowModal is
 BS> triggered by clicking the Start button on the main form,
 BS> that basically launches all of the rest of the program.  Am
 BS> I right in thinking that all program-detectable error
 BS> points, no matter what unit they are in, will then be picked
 BS> up by this one EXCEPT in the start button's on-click
 BS> handler, providing they make a call to HaltSay ?  Is Except
 BS> that powerful ?
No it is not. If for instance you do some pointer related things and 
something goes wrong. It will not always trigger the Except procedure. I know 
this from first hand, happened very often to me. It then sometimes triggers 
GPFfaults or a fault in a win-module.This is very difficult to debug. 
  
 BS> The other question is this.  Am I doing it the hard way - is
 BS> there some easier way ?
The way you are using Except is to general. By using your routine you would 
trigger to many faults to one routine. The basic concept for the try Except 
routine is that you for instance in calculation routines don't have to check 
for every line of code you use if an error occurs. By coding the entiry 
program in a try except block seems like you don't trust your program. Try 
using the try except block only on critical code in your program.
Greetz from limboland, Henk 
--- timEd 1.01
---------------
* Origin: Programming PFFF... (2:285/717.28)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.