On Fri, 20 Oct 2006, Alex Smirnov wrote:

> *Hello, colleagues.*
> 
> I have cerated a library (a clone of GLScene lib). It works both in Win32 and
> Linux/GTK. So, inside of the code I have some testing - for example, I try to
> open a file and if it is not exist - I should raise an Exception.
> 
> So - this is the question. I have such a code:
> 
> /if Not FileExists(FFileName) then Begin Raise Exception.Create('File
> '+FFileName+' is not found'); Exit; End;/
> 
> The problem is that this exception window will not be visible. Program will
> not stop on it and will break with "Access violation exception". I can only
> see an exception window if I try to debug my program.
> 
> So - what is wrong? This behavior is quite different from Delphi and Sibyl -
> they both will stop the program on such exception, showing the window with my
> massage.  

The message is shown on the console. The SysUtils unit is cross platform,
so it does not 'know' how to display a dialog box, even on Windows.

If you run your program on the console (command-prompt) 
(and it is compiled on as a console app, the default) then you will
see the message printed on the console.

Inside the IDE, the debugger catches the exception and shows the window.

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to