Re: [fpc-pascal] Re: TFileStream and stdin - how to make this work?

2010-10-03 Thread Bernd Kreuss
On 03.10.2010 19:10, Seth Grover wrote: > Could you use THandleStream > (http://www.freepascal.org/docs-html/rtl/classes/thandlestream.html)? > > myInputStream := THandleStream.Create(StdInputHandle); Yea, this looks like what TIOStream internally seems to do. I have now worked around the blockin

Re: [fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Bernd Kreuss
On 03.10.2010 16:16, Honza wrote: > See also sockets: > > http://wiki.lazarus.freepascal.org/Sockets > > and pipes: > > http://www.freepascal.org/docs-html/fcl/pipes/tinputpipestream.html > > The TInputPipeStream has a "property NumBytesAvailable: DWord; [r] > Number of bytes available for rea

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread Martin
On 03/10/2010 21:20, Juha Manninen (gmail) wrote: On Sunday 03 October 2010 19:48:22 C Western wrote: Please report the bug. Yes the result is integer and in 64 bits, this looks like a problem. I think this is an issue I reported back in March, though I can now see I uploaded the wrong patch f

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread Juha Manninen (gmail)
On Sunday 03 October 2010 23:20:05 Juha Manninen (gmail) wrote: > Anyway this is a good example of a valid Lazarus patch that is ignored, > again. :-( Ok, sorry Lazarus guys, I must take this one back. The valid patch was uploaded only today so it was not really ignored. Now there are 2 valid pa

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread Juha Manninen (gmail)
On Sunday 03 October 2010 19:48:22 C Western wrote: > >> Please report the bug. Yes the result is integer and in 64 bits, this > >> looks like a problem. > > > > I think this is an issue I reported back in March, though I can now see > > I uploaded the wrong patch for it > > Sorry - meant to add:

Re: [fpc-pascal] Re: Delphi incompatible conditionals?

2010-10-03 Thread Marco van de Voort
In our previous episode, Mark Daems said: > ... > > Try longint(3) and longint(2). > > > > How should I do that? The place where the file containing the > conditions is included doesn't allow for defining constants as it's > the very first line in the unit code. {$if ... $FPCVERSION>LONGINT(3)

Re: [fpc-pascal] Fwd: Delphi incompatible conditionals?

2010-10-03 Thread Martin
On 01/10/2010 17:33, Mark Daems wrote: Hi, I'm trying to add following conditional code to the top of a unit that should compile in fpc and in delphi: {$IFDEF FPC} {$IFNDEF ver1} {$IF (fpc_version>2) or (fpc_version=2) and (fpc_release>3)} {$info FPC version>= 2.4.0 : Should work}

Re: [fpc-pascal] Re: Delphi incompatible conditionals?

2010-10-03 Thread Felipe Monteiro de Carvalho
One solution would be putting the contents of the fpc specific ifdefs inside a include file. -- Felipe Monteiro de Carvalho ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: Delphi incompatible conditionals?

2010-10-03 Thread Mark Daems
> From: "Juha Manninen (gmail)" > To: "FPC-Pascal users discussions" > Date: Fri, 1 Oct 2010 20:04:18 +0300 > Subject: Re: [fpc-pascal] Fwd: Delphi incompatible conditionals? > On Friday 01 October 2010 19:33:48 Mark Daems wrote: >> ... >> And it's a weird behaviour, because it's all within an {$

[fpc-pascal] Re: TFileStream and stdin - how to make this work?

2010-10-03 Thread Seth Grover
See ./packages/fcl-base/examples/asiotest.pp in the FPC source. Also, google turned up: achenko.narod.ru/stdin2file.pas which seems to be something like what you're looking to do. -SG -- This email is fiction. Any resemblance to actual events or persons living or dead is purely coincidental. Set

[fpc-pascal] Re: TFileStream and stdin - how to make this work?

2010-10-03 Thread Seth Grover
Could you use THandleStream (http://www.freepascal.org/docs-html/rtl/classes/thandlestream.html)? myInputStream := THandleStream.Create(StdInputHandle); ... -SG -- This email is fiction. Any resemblance to actual events or persons living or dead is purely coincidental. Seth Grover sethdgrover[a

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread C Western
On 10/03/2010 05:36 PM, C Western wrote: On 10/03/2010 04:48 PM, José Mejuto wrote: Hello FPC-Pascal, Sunday, October 3, 2010, 9:10:34 AM, you wrote: JMg> Lazarus Debugger code causes one range error which can be fixed with a JMg> typecast. FPC showed the point clearly. Issue #0017537. JMg> TA

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread C Western
On 10/03/2010 04:48 PM, José Mejuto wrote: Hello FPC-Pascal, Sunday, October 3, 2010, 9:10:34 AM, you wrote: JMg> Lazarus Debugger code causes one range error which can be fixed with a JMg> typecast. FPC showed the point clearly. Issue #0017537. JMg> TApplication.HandleException Range check

Re[2]: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread José Mejuto
Hello FPC-Pascal, Sunday, October 3, 2010, 11:41:00 AM, you wrote: GG> On 02/10/2010, Vincent Snijders wrote: >> >> True heap size : 1048576 >> True free heap : 1924768 >> Should be : 1048576 >> >> It just says that heaptr didn't calculate the True free heap size correctly. GG> Either way, this

Re[2]: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread José Mejuto
Hello FPC-Pascal, Sunday, October 3, 2010, 9:10:34 AM, you wrote: JMg> Lazarus Debugger code causes one range error which can be fixed with a JMg> typecast. FPC showed the point clearly. Issue #0017537. JMg> TApplication.HandleException Range check error JMg> Stack trace: JMg> $0115AA

Re: [fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Honza
2010/10/3 Bernd Kreuss : > TIOStream seems to work the same way on linux and windows (I tested only > with wine but it worked) ...and it will block. > > It seems I really have to do the receiving of the data in a separate > thread. > > (I wanted to avoid this because the things that must be done af

Re: [fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Bernd Kreuss
On 03.10.2010 15:21, Andreas Schneider wrote: > You could use TIOStream from the unit iostream. AFAICS that should do > exactly what you want - i.e. opening stdin/out/err as a TStream > descendant. > I don't know however, if that fixes the problem you have with the > stream blocking when nothing is

Re: [fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Andreas Schneider
On Sun, 03 Oct 2010 15:05:10 +0200, Bernd Kreuss wrote: > Hi, > > this might be a stupid question but I find myself again struggling with > file IO and stdin/stdout. I am trying to do the following: > > StdIn := TFileStream.Create('/dev/stdin', fmOpenRead); > > and later on i want to poll whet

Re: [fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Honza
2010/10/3 Bernd Kreuss : > this might be a stupid question but I find myself again struggling with > file IO and stdin/stdout. I am trying to do the following: > > StdIn := TFileStream.Create('/dev/stdin', fmOpenRead); > > and later on i want to poll whether there is something to read. I want > to

[fpc-pascal] TFileStream and stdin - how to make this work?

2010-10-03 Thread Bernd Kreuss
Hi, this might be a stupid question but I find myself again struggling with file IO and stdin/stdout. I am trying to do the following: StdIn := TFileStream.Create('/dev/stdin', fmOpenRead); and later on i want to poll whether there is something to read. I want to try reading binary data that wil

Re: [fpc-pascal] Build scripts for Freepascal and Lazarus compilation from source

2010-10-03 Thread Frank Church
On 3 October 2010 10:48, Honza wrote: > 2010/10/3 Frank Church : > > I have posted an article and some code on some bash scripts I have > developed > > to install FPC and Lazarus from source at > > > http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-f

Re: [fpc-pascal] Build scripts for Freepascal and Lazarus compilation from source

2010-10-03 Thread Honza
2010/10/3 Frank Church : > I have posted an article and some code on some bash scripts I have developed > to install FPC and Lazarus from source at > http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source. > > Any comments and tips are well come.

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread Graeme Geldenhuys
On 02/10/2010, Vincent Snijders wrote: > > True heap size : 1048576 > True free heap : 1924768 > Should be : 1048576 > > It just says that heaptr didn't calculate the True free heap size correctly. Either way, this should then be reported as a bug - though a minor one because unfree'ed count is c

[fpc-pascal] Build scripts for Freepascal and Lazarus compilation from source

2010-10-03 Thread Frank Church
I have posted an article and some code on some bash scripts I have developed to install FPC and Lazarus from source at http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source . Any comments and tips are well come. -- Frank Church =

Re: [fpc-pascal] How to get to Range Check Error location

2010-10-03 Thread Juha Manninen (gmail)
On Saturday 02 October 2010 17:47:27 José Mejuto wrote: > The assembly window in Lazarus is shown when no backtrace line is > available to point the cursor in, so open callstack "View -> Debug -> > Callstack" and you will see that there is no available backtrace, > maybe except the fpc sources with