Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread LacaK via fpc-pascal
Please note that you won't be able to catch such an exception with the type from within the application, e.g.: === code begin === try   SomeLibraryFunction; except   on e: TMyObject do Whatever;   else WhateverElse; end; === code end === The above code would go to the first branc

Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2021 um 12:59 schrieb LacaK via fpc-pascal: Am 26.08.2021 um 10:10 schrieb LacaK via fpc-pascal: Thank you for both answers! Please note that you won't be able to catch such an exception with the type from within the application, e.g.: === code begin === try   SomeLibraryFuncti

Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread LacaK via fpc-pascal
Am 26.08.2021 um 10:10 schrieb LacaK via fpc-pascal: Thank you for both answers! Please note that you won't be able to catch such an exception with the type from within the application, e.g.: === code begin === try   SomeLibraryFunction; except   on e: TMyObject do Whatever;   else

Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2021 um 10:10 schrieb LacaK via fpc-pascal: Thank you for both answers! Please note that you won't be able to catch such an exception with the type from within the application, e.g.: === code begin === try   SomeLibraryFunction; except   on e: TMyObject do Whatever;   else    

Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread LacaK via fpc-pascal
Thank you for both answers! L. On Thu, 26 Aug 2021, LacaK via fpc-pascal wrote: Hello, is there way how to raise exception in library without using SysUtils? Raise TMyObject.Create() Where TMyObject does not descend from Exception. Sysutils is needed for the definition of the Exception

Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread Michael Van Canneyt via fpc-pascal
On Thu, 26 Aug 2021, LacaK via fpc-pascal wrote: Hello, is there way how to raise exception in library without using SysUtils? Raise TMyObject.Create() Where TMyObject does not descend from Exception. Sysutils is needed for the definition of the Exception class, and because it installs som

[fpc-pascal] Raise exception in libray which will not halt host application

2021-08-25 Thread LacaK via fpc-pascal
Hello, is there way how to raise exception in library without using SysUtils? Now I call System.RunError() in case unexpected situation occurs in library (DLL), but this exits also application which links library. Is there way how to exit library in a way that application can catch exception (wi