Re: Writing Binary Files with TFileStream



Rick Francken wrote:
Just a hunch that may be completely invalid, but you are putting this in a try..except block, and the exception handling mechanism can use a temporary variable named "e" for an exception instance. Is it possible there is a conflict there?

No. An exception handler only uses E when you tell it to use E. It's not an implicit variable like Result. You can name it whatever you want, but you have to name it yourself if you want to use it. Exception handlers are the one place in Delphi where you can introduce a variable into scope in the middle of executable code.


try
  // ...
except
  on E: EInvalidCast do ;
  on F: EAssert do ;
  on LongExceptionName: Exception do ;
  on ObjectsCanBeThrownToo: TObject do ;
end;

--
Rob
.



Relevant Pages

  • TIP #329: Try/Catch/Finally syntax
    ... exception handling mechanism. ... The *try...catch* syntax presented here is not intended to replace ... TCL_ERROR then each *catch* handler is considered in order until one ...
    (comp.lang.tcl)
  • Re: Arguments *Against* Exception Use
    ... >> The exception handling mechanism was designed to be implemented ... >> if an exception is not thrown. ... Your comment about gcc is a bit vague, ...
    (comp.lang.cpp)
  • Re: Java Exceptions handling Question
    ... >> Is there a catch all exception handling mechanism in Java? ... is one that you were anticipating, but that may not be the case. ...
    (comp.lang.java.programmer)
  • Re: Paged Pool memory
    ... The exception handling mechanism is allocating ... lot of memoryon the stack and ultimately the stack overflows ... So how much stack memory is your exception handler allocating? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Arguments *Against* Exception Use
    ... E. Robert Tisdale wrote: ... > The exception handling mechanism was designed to be implemented ... > if an exception is not thrown. ...
    (comp.lang.cpp)