Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Henry Vermaak
On Wed, Sep 18, 2013 at 03:57:36PM +0200, Marco van de Voort wrote: > In our previous episode, Henry Vermaak said: > > > > Should be doable, as well. AFAIK, mse (for Linux) uses signals > > > > on that behalf. We might want to steal some ideas there. > > > > > > While there is sigalarm, but can yo

Re: [fpc-pascal] FPCUnit test + raise E;

2013-09-18 Thread Marcos Douglas
On Tue, Sep 17, 2013 at 2:41 PM, Sven Barth wrote: > On 17.09.2013 17:27, Marcos Douglas wrote: >> >> On Tue, Sep 17, 2013 at 12:18 PM, Marcos Douglas wrote: Another thing you could try (just for testing): change your exception handler procedure to a function that returns bool and

Re: [fpc-pascal] FPC 2.6.2 for DOS/Go32V2 FP.EXE cannot run a second time

2013-09-18 Thread Lubomír Čabla
I am running pure DOS 7 from Windows 98 US, no drivers, no TSR programs. Just COMMAND.COM, no AUTOEXEC.BAT and CONFIG.SYS. Run CWSDPMI -p -x DPMI stays in memory, start FP.EXE - again SIGSEGV. But I found an interesting thing. When I run FP.EXE from FPC 1.0.11 (it started always O.K.), nothing

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 05:03 PM, Sven Barth wrote: TThread.Queue is a rather new addition. Delphi 2009 if I'm correct. So that's definitely not "very early". OK, at least four years ;-) . I have "Turbo Delphi". Here it is implemented but not to be found in the help. -Michael _

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > forced to "by hand" use Windows messages to schedule asynchronous Main > > Thread events. > > TThread.Queue is a rather new addition. Delphi 2009 if I'm correct. So > that's definitely not "very early". D2006 afaik. __

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Sven Barth
On 18.09.2013 13:33, Michael Schnell wrote: On 09/18/2013 01:19 PM, Mattias Gaertner wrote: Some users asked about messages from/to other applications for nogui LCL applications on Windows. OK. In fact to me it has been a completely silly concept of Borland's that in early Delphi versions TTh

[fpc-pascal] StrUtils.RomanToInt oddities

2013-09-18 Thread Bart
Hi, RomanToInt acceps rather ludicrous values: RomanToInt('MDCLXVIVXLDM') = 2209 RomanToInt('M') = 1002 //calculated as 3 + (1000-1) Both examples represent invalid roman numbers by any standard. Also I do not think Roman numerals can be negative... Feature or bug? Bart __

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Marco van de Voort
In our previous episode, Henry Vermaak said: > > > Should be doable, as well. AFAIK, mse (for Linux) uses signals on that > > > behalf. We might want to steal some ideas there. > > > > While there is sigalarm, but can you have multiple independent timers in an > > application that way? > > I thi

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Van Canneyt
On Wed, 18 Sep 2013, Michael Schnell wrote: On 09/18/2013 01:26 PM, Marco van de Voort wrote: While there is sigalarm, but can you have multiple independent timers in an application that way? I don't know. We would need to ask mse. mse inverts the problem. The timer implementation relies

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Henry Vermaak
On Wed, Sep 18, 2013 at 01:26:46PM +0200, Marco van de Voort wrote: > In our previous episode, Michael Schnell said: > > > The fptimer unit implements a timer with a thread, but this forces the > > > use of threads on your application which is not always desirable. > > > > Should be doable, as we

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 01:26 PM, Marco van de Voort wrote: While there is sigalarm, but can you have multiple independent timers in an application that way? I don't know. We would need to ask mse. -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepasc

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 01:19 PM, Mattias Gaertner wrote: Some users asked about messages from/to other applications for nogui LCL applications on Windows. OK. In fact to me it has been a completely silly concept of Borland's that in early Delphi versions TThread.Queue was not documented (or in very e

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Marco van de Voort
In our previous episode, Michael Schnell said: > > The fptimer unit implements a timer with a thread, but this forces the > > use of threads on your application which is not always desirable. > > Should be doable, as well. AFAIK, mse (for Linux) uses signals on that > behalf. We might want to st

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Mattias Gaertner
On Wed, 18 Sep 2013 10:55:34 +0200 Michael Schnell wrote: > On 09/18/2013 10:38 AM, Mattias Gaertner wrote: > > On Wed, 18 Sep 2013 10:25:43 +0200 > > Michael Schnell wrote: > > > >> What non-GUI events - additionally to the events I mentioned - would be > >> needed for "the whole event system

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 12:05 PM, Luca Olivetti wrote: Perhaps if you spent your time actually using fpc instead of hunting for non-problems ... As already pointed out, I have no intention to do a Project of such kind myself. I am just trying to construct a toolbox to help my colleagues to port their D

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Luca Olivetti
Al 18/09/13 09:32, En/na Michael Schnell ha escrit: > It is really frustrating to see, that this now seems to solves the issue > I am hunting for since some five years. Perhaps if you spent your time actually using fpc instead of hunting for non-problems you'd have realized that this worked five

Re: [fpc-pascal] Error linking with C code

2013-09-18 Thread Xiangrong Fang
> I think you should try to pass the name of the folder where libthost is to > the linker. > -FL/path/to/libthost > > Michael. > > This does not work, same error message. I also tried to copy libthost.so to current dir, but leave thostmduserapi.so in ../libthost, same result. Regards, Xiangrong

Re: [fpc-pascal] Error linking with C code

2013-09-18 Thread Michael Van Canneyt
On Wed, 18 Sep 2013, Xiangrong Fang wrote: where is thostmduserapi.so ? Michael. This file is under libthost folder, I copied it to pasintf folder then use fpc to compile demo.pas. I think you should try to pass the name of the folder where libthost is to the linker. -FL/path/to/libtho

Re: [fpc-pascal] Error linking with C code

2013-09-18 Thread Xiangrong Fang
> > > where is thostmduserapi.so ? > > Michael. This file is under libthost folder, I copied it to pasintf folder then use fpc to compile demo.pas. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/

Re: [fpc-pascal] Error linking with C code

2013-09-18 Thread Michael Van Canneyt
On Wed, 18 Sep 2013, Xiangrong Fang wrote: Hi All, I am writing pascal wrapper for a C library called "CTP", which is used in future trading.  My project is here: https://github.com/xrfang/CTPas Compiling the interface file along is successful. While linking, fpc complains: ./thostmdusera

[fpc-pascal] Error linking with C code

2013-09-18 Thread Xiangrong Fang
Hi All, I am writing pascal wrapper for a C library called "CTP", which is used in future trading. My project is here: https://github.com/xrfang/CTPas Compiling the interface file along is successful. While linking, fpc complains: ./thostmduserapi.so, needed by ./libthost.so, not found (try us

Re: [fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-18 Thread Sven Barth
On 18.09.2013 10:51, Dennis Poon wrote: Sven, I am still using fpc 2.6.2. May I know whether the generics bugs for 2.6.2 are catchable at compiler times or I only get to find out at run time? I'm currently not aware of any runtime bugs so all should be noticable by the compiler complaining ab

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 10:38 AM, Mattias Gaertner wrote: On Wed, 18 Sep 2013 10:25:43 +0200 Michael Schnell wrote: What non-GUI events - additionally to the events I mentioned - would be needed for "the whole event system of the LCL" ? For example PostMessage can send messages to other applications

Re: [fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-18 Thread Dennis Poon
Sven, I am still using fpc 2.6.2. May I know whether the generics bugs for 2.6.2 are catchable at compiler times or I only get to find out at run time? Dennis Sven Barth wrote: On 17.09.2013 17:39, Dennis Poon wrote: Sven, Thanks a lot. It worked. Generics, advanced record, customized ope

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Mattias Gaertner
On Wed, 18 Sep 2013 10:25:43 +0200 Michael Schnell wrote: > On 09/18/2013 10:05 AM, Mattias Gaertner wrote: > > On Wed, 18 Sep 2013 09:32:54 +0200 > > Michael Schnell wrote: > > > >> [...] > >> Instead I was told that I should look at the LCL > >> source code and that "in Windows, the Event qu

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 10:20 AM, Michael Van Canneyt wrote: The fptimer unit implements a timer with a thread, but this forces the use of threads on your application which is not always desirable. Should be doable, as well. AFAIK, mse (for Linux) uses signals on that behalf. We might want to steal so

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 10:09 AM, Sven Barth wrote: I would not use Sleep as you need to be able to cancel the timer A decent point ... -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 10:05 AM, Mattias Gaertner wrote: On Wed, 18 Sep 2013 09:32:54 +0200 Michael Schnell wrote: [...] Instead I was told that I should look at the LCL source code and that "in Windows, the Event queuing mechanism is done by Windows itself and in Linux it is done by a queue in the

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Van Canneyt
On Wed, 18 Sep 2013, Sven Barth wrote: On 18.09.2013 09:32, Michael Schnell wrote: - TTimer is implemented including defining the timeout constant for calls to CheckSynchronize() as the greatest common denominator of the "Time" property of all enabled TTimer instances in the project (i.e. a

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Sven Barth
On 18.09.2013 10:00, Michael Schnell wrote: On 09/18/2013 09:53 AM, Sven Barth wrote: I wouldn't use the timeout constant for this. If you have two timers of which the greatest common denominator is 1, but nevertheless rather large (e.g. two primes) then you'd loop unnecessarily (I know this is

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Mattias Gaertner
On Wed, 18 Sep 2013 09:32:54 +0200 Michael Schnell wrote: >[...] > It is really frustrating to see, that this now seems to solves the issue > I am hunting for since some five years. Has it ever come to your mind that "hunting" might not be sufficient to create code? > Over the time, there had

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
On 09/18/2013 09:53 AM, Sven Barth wrote: I wouldn't use the timeout constant for this. If you have two timers of which the greatest common denominator is 1, but nevertheless rather large (e.g. two primes) then you'd loop unnecessarily (I know this is a constructed example, but nevertheless o

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Sven Barth
On 18.09.2013 09:32, Michael Schnell wrote: - TTimer is implemented including defining the timeout constant for calls to CheckSynchronize() as the greatest common denominator of the "Time" property of all enabled TTimer instances in the project (i.e. a simple timer that accumulates delays impos

Re: [fpc-pascal] lnet for TCP daemon

2013-09-18 Thread Michael Schnell
Conclusion: Thus we could draft a "living noGUI" TCustomApplication sibling (aka "LCL WidgetType"), that allows for firing MainThread Events triggered from (a newly implemented) TTimer, TThread.Queue(), TThread.Synchronize(), TApplication.QueueAsyncCall() and the legacy windowish PostMessage(