Re: [fpc-pascal] Exceptions in Library

2015-03-30 Thread steveg
On 30/03/15 16:46, leledumbo wrote: As far as I can tell, exceptions propagate through to the main app - (written with Lazarus in this case). I would like to trap them directly within the library. // excp.pas library excp; {$mode objfpc} uses sysutils; procedure p; begin try raise exc

Re: [fpc-pascal] Exceptions in Library

2015-03-29 Thread leledumbo
> As far as I can tell, exceptions propagate through to the main app - > (written with Lazarus in this case). > I would like to trap them directly within the library. // excp.pas library excp; {$mode objfpc} uses sysutils; procedure p; begin try raise exception.create('an exception')

[fpc-pascal] Exceptions in Library

2015-03-29 Thread steveg
Would anybody be able to enlighten me on enabling exception trapping in Linux libraries ? As far as I can tell, exceptions propagate through to the main app - (written with Lazarus in this case). I would like to trap them directly within the library. Pointers, clues, links, examples (heck, ev

Re: Re[2]: [fpc-pascal] exceptions

2009-05-28 Thread Jonas Maebe
On 28 May 2009, at 23:18, JoshyFun wrote: Hello FPC-Pascal, Thursday, May 28, 2009, 9:58:23 PM, you wrote: RS> Shrinked down example of the program. RS> Rainer [...] RS> procedure memclr( p : pointer ; len : longint ); Aside from the socket problem, can somebody explain me this line: RS> b

Re[2]: [fpc-pascal] exceptions

2009-05-28 Thread JoshyFun
Hello FPC-Pascal, Thursday, May 28, 2009, 9:58:23 PM, you wrote: RS> Shrinked down example of the program. RS> Rainer [...] RS> procedure memclr( p : pointer ; len : longint ); RS> var x : longint; RS> begin RS> for x := 1 to len do begin RS> byte( p^ ) := 0; RS> inc( p ); RS> end; RS> end;

Re: [fpc-pascal] exceptions

2009-05-28 Thread Jonas Maebe
On 28 May 2009, at 21:58, Rainer Stratmann wrote: Shrinked down example of the program. strace shows this: accept(3, {sa_family=AF_INET, sin_port=htons(48134), sin_addr=inet_addr("xxx.xxx.xxx.xxx")}, [16]) = 4 write(1, ".", 1)= 1 select(0, NULL, NULL, NULL, {0, 300

Re: [fpc-pascal] exceptions

2009-05-28 Thread Rainer Stratmann
Shrinked down example of the program. Rainer program serverclient; uses baseunix , sockets, crt; const port_program = 12021; procedure memclr( p : pointer ; len : longint ); var x : longint; begin for x := 1 to len do begin byte( p^ ) := 0; inc( p ); end; end; procedure se

Re: [fpc-pascal] exceptions

2009-05-27 Thread Jonas Maebe
On 27 May 2009, at 19:24, Rainer Stratmann wrote: Am Mittwoch, 27. Mai 2009 11:45 schrieb Vincent Snijders: Rainer Stratmann schreef: Am Dienstag, 26. Mai 2009 22:27 schrieb Jonas Maebe: Well, as I said: it does not raise any exceptions. Would it be possible to catch that exception? With t

Re: [fpc-pascal] exceptions

2009-05-27 Thread Rainer Stratmann
Am Mittwoch, 27. Mai 2009 11:45 schrieb Vincent Snijders: > Rainer Stratmann schreef: > > Am Dienstag, 26. Mai 2009 22:27 schrieb Jonas Maebe: > >> Well, as I said: it does not raise any exceptions. > > > > Would it be possible to catch that exception? > > With the try except block? > > Are other f

Re: [fpc-pascal] exceptions

2009-05-27 Thread Vincent Snijders
Rainer Stratmann schreef: Am Dienstag, 26. Mai 2009 22:27 schrieb Jonas Maebe: Well, as I said: it does not raise any exceptions. Would it be possible to catch that exception? With the try except block? Are other functions existing to catch linux exceptions? No, you cannot catch exception t

Re: [fpc-pascal] exceptions

2009-05-27 Thread Rainer Stratmann
Am Dienstag, 26. Mai 2009 22:27 schrieb Jonas Maebe: > Well, as I said: it does not raise any exceptions. Would it be possible to catch that exception? With the try except block? Are other functions existing to catch linux exceptions? > The socket unit calls through to unix routines (either via l

Re: [fpc-pascal] exceptions

2009-05-26 Thread Jonas Maebe
On 26 May 2009, at 22:18, Rainer Stratmann wrote: Yes, the send function from the socket unit. Well, as I said: it does not raise any exceptions. Situation: Connection is established. Client closes connection Server wants to sent data with send. Program stops with errorcode 13 (I found out

Re: [fpc-pascal] exceptions

2009-05-26 Thread Rainer Stratmann
Yes, the send function from the socket unit. Situation: Connection is established. Client closes connection Server wants to sent data with send. Program stops with errorcode 13 (I found out that this is the linux errorcode for permission denied). The error is reproduceable. I thought that may

Re: [fpc-pascal] exceptions

2009-05-26 Thread Jonas Maebe
On 26 May 2009, at 22:01, Rainer Stratmann wrote: The send function causes sometimes an exception (permission denied). Which send function? The one of the sockets unit? If never raises an exception. It only sets socketerror. If you are not talking about that send function, which one do yo

[fpc-pascal] exceptions

2009-05-26 Thread Rainer Stratmann
The send function causes sometimes an exception (permission denied). try l := send( ... ) except l := 0; end; This does not work. The Program always stops in case of an exception. With exitcode 13 (permission denied). What do I have to do that the program continuous execution also when exce

Re: [fpc-pascal]exceptions

2003-05-30 Thread Adam Naumowicz
Jonas, Thanks for your response. On Fri, 30 May 2003, Jonas Maebe wrote: > > On vrijdag, mei 30, 2003, at 12:47 Europe/Brussels, Adam Naumowicz > wrote: > > > I found it a bit surprising that byte-variable overflow does not raise > > EIntException... > > I'm using FPC 1.0.6 (with -Co on the comm

Re: [fpc-pascal]exceptions

2003-05-30 Thread Jonas Maebe
On vrijdag, mei 30, 2003, at 12:47 Europe/Brussels, Adam Naumowicz wrote: I found it a bit surprising that byte-variable overflow does not raise EIntException... I'm using FPC 1.0.6 (with -Co on the command line). Also use -Cr. An overflow and a range check are semantically exactly the same (you

[fpc-pascal]exceptions

2003-05-30 Thread Adam Naumowicz
Hi, Where can I find detailed information about all the predefined Exception classes and their semantics? I found it a bit surprising that byte-variable overflow does not raise EIntException... I'm using FPC 1.0.6 (with -Co on the command line). Best regards, Adam Naumowicz =