home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,067 of 2,978   
   L D Blake to All   
   Try Finally behaviour   
   24 Oct 04 19:40:10   
   
   From: not@any.adr   
      
   Hi Gang,   
   Just getting into my long awaited rewrite of the exception handling in Object   
   Pascal (i.e. Delphi7).  I'm not worried about VCL compatibility, I'm more   
   concerned with the plain best way of handling try/except/finally sets.   
      
   I've already got the Try Except the way I like it... Continuable exceptions   
   are handled in the Except block, but non-continuable ones will stop the   
   application, complete with error dialogs on screen.   
      
   Ok... now Try Finally...   
      
   		Try   
   			getmem(p,2048);   
   			CauseException( X );   
   		Finally   
   			freemem(p);			   
   		end;   
      
      
   Presently Delphi bales on this no matter if the exception is continuable (i.e.   
   non-fatal) or not...   
      
   So my question is... if X is a continuable exception...  Should it exit the   
   program or should it allow execution to continue?   
      
   One example that really raised the question for me was the business of playing   
   a wave file as a user prompt... should we bring down an entire application   
   because a buzzer file goes missing?   
      
      
   (Size and complexity aren't at issue... in my tests it takes about the same   
   number of bytes to forward a continuable exception as it does to avoid a   
   non-continuable one... either way code size is about 100 bytes.)   
      
   -----   
   Laura   
      
   http://www.start.ca/users/ldblake   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca