Hello Lazarus-List,
Can anybody tell me why this code does not raise an exception and
silently kills the program ?
---------------------------------------------------
unit ufrmmain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs
,httpserv;
type
TForm1 = class(TForm)
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
S: TFileStream;
implementation
initialization
{$I ufrmmain.lrs}
S:=TFileStream.Create('NonExistsFilename',fmOpenread);
end.
---------------------------------------------------
But this initialization works as expected:
---------------------------------------------------
initialization
{$I ufrmmain.lrs}
try
S:=TFileStream.Create('NonExistsFilename',fmOpenread);
except
Raise Exception.Create('Message');
end;
end.
---------------------------------------------------
I'm using fpc 2.5.1 SVN and Lazarus SVN 5 days ago. Thank you.
--
Best regards,
JoshyFun
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus