Re: [fpc-pascal] various ways of passing a class instance as a parameter

2011-11-17 Thread Alexander Shishkin
15.11.2011 14:00, Graeme Geldenhuys пишет: This one confused me a bit. I thought the whole object would be read-only, but in fact it is just the AClass instance pointer which cannot be modified. The properties of AClass are still read-write. Perhaps it will be good to add support for const

Re: [fpc-pascal] More fun with dynamic arrays

2011-11-17 Thread Jürgen Hestermann
andrew.benn...@ns.sympatico.ca schrieb: Procedure Init(Out X : DataA ; Const N : Longint) ; 1) I substitute "Var" for "Out". This leads to the warning that X is not initialized. Which is correct. If you define a parameter to be for "out"put only the compiler does exactly this. 2) I sub

[fpc-pascal] More fun with dynamic arrays

2011-11-17 Thread andrew.bennett
This program: Program TestMem ; Const ASize = 1000 ; Type DataA = Array Of Longint ; Var A : DataA ; Procedure Init(Out X : DataA ; Const N : Longint) ; Begin Writeln(Length(X)) ; { Writes: 0 } End ; Begin SetLength(A, ASize) ; Writeln(Length(A)) ; { Writes: 1000 as expected } Init(A, ASiz

Re: [fpc-pascal] parent class as a parameter type

2011-11-17 Thread Sven Barth
On 17.11.2011 19:07, Mattias Gaertner wrote: On Thu, 17 Nov 2011 15:15:46 +0100 Sven Barth wrote: Emagine the following code: procedure Foo(var aList: TStrings); begin aList.Free; aList := TStrings.Create; end; var l: TStringList; begin l := TStringList.Create; Foo(l);

Re: [fpc-pascal] parent class as a parameter type

2011-11-17 Thread Mattias Gaertner
On Thu, 17 Nov 2011 15:15:46 +0100 Sven Barth wrote: > Am 17.11.2011 15:07, schrieb ik: > > On Thu, Nov 17, 2011 at 16:03, Sven Barth > > wrote: > > > > Am 17.11.2011 09:23, schrieb ik: > > > > It's not allowed in Delphi in case of a var/out pa

Re: [fpc-pascal] Setting environment variables on Unix/Linux?

2011-11-17 Thread Reinier Olislagers
On 17-11-2011 13:55, michael.vancann...@wisa.be wrote: > On Thu, 17 Nov 2011, Reinier Olislagers wrote: >> Hi list, >> >> It seems FPC allows one to retrieve environment variables on Linux/Unix >> (GetEnvironmentVariable) but not to set them. >> >> Is that correct? > > Yes. > No. Unix works diffe

Re: [fpc-pascal] parent class as a parameter type

2011-11-17 Thread ik
On Thu, Nov 17, 2011 at 16:15, Sven Barth wrote: > Am 17.11.2011 15:07, schrieb ik: > >> On Thu, Nov 17, 2011 at 16:03, Sven Barth > > >> wrote: >> >>Am 17.11.2011 09:23, schrieb ik: >> >>It's not allowed in Delphi in case of a var/out paramet

Re: [fpc-pascal] parent class as a parameter type

2011-11-17 Thread Sven Barth
Am 17.11.2011 15:07, schrieb ik: On Thu, Nov 17, 2011 at 16:03, Sven Barth mailto:pascaldra...@googlemail.com>> wrote: Am 17.11.2011 09:23, schrieb ik: It's not allowed in Delphi in case of a var/out parameter. It's allowed in both FPC and Delphi in case of a value/c

Re: [fpc-pascal] parent class as a parameter type

2011-11-17 Thread ik
On Thu, Nov 17, 2011 at 16:03, Sven Barth wrote: > Am 17.11.2011 09:23, schrieb ik: > > It's not allowed in Delphi in case of a var/out parameter. It's >>allowed in both FPC and Delphi in case of a value/const parameter. >> >> >> Sorry for the late response, but why does out and var limit

Re: [fpc-pascal] parent class as a parameter type

2011-11-17 Thread Sven Barth
Am 17.11.2011 09:23, schrieb ik: It's not allowed in Delphi in case of a var/out parameter. It's allowed in both FPC and Delphi in case of a value/const parameter. Sorry for the late response, but why does out and var limit this issue ? I understand that it does, but not the reason for

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread Graeme Geldenhuys
On 17 November 2011 14:46, wrote: > It only generates empty tags. If you say 'update' then it generates a new > file with empty tags for elements for which no tag was found. I'm not referring to the update action of makeskel, I meant the first time you run makeskel, it generates empty tags - as

Re: [fpc-pascal] Setting environment variables on Unix/Linux?

2011-11-17 Thread michael . vancanneyt
On Thu, 17 Nov 2011, Reinier Olislagers wrote: Hi list, It seems FPC allows one to retrieve environment variables on Linux/Unix (GetEnvironmentVariable) but not to set them. Is that correct? Yes. Some digging: Setting environment variables on Unix with gnu libc: http://www.gnu.org/s/lib

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread michael . vancanneyt
On Thu, 17 Nov 2011, Graeme Geldenhuys wrote: On 17 November 2011 11:45, wrote: I'm not sure why you recommend leaving makeskel ? I use it always for the initial file ? Given the proper parameters, it creates a very usable initial file ? Maybe fpdoc has improved in those areas since I fo

[fpc-pascal] Setting environment variables on Unix/Linux?

2011-11-17 Thread Reinier Olislagers
Hi list, It seems FPC allows one to retrieve environment variables on Linux/Unix (GetEnvironmentVariable) but not to set them. Is that correct? Some digging: Setting environment variables on Unix with gnu libc: http://www.gnu.org/s/libc/manual/html_node/Environment-Access.html#Environment-Access

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread Graeme Geldenhuys
On 17 November 2011 12:23, Reinier Olislagers wrote: > Thanks, I know, but does that include the internal (private) ones? That > would seem a bit restrictive... No, as far as I know that restriction only applies to Public and Published visibility. -- Regards,   - Graeme -

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread Reinier Olislagers
On 17-11-2011 10:06, michael.vancann...@wisa.be wrote: > On Thu, 17 Nov 2011, Reinier Olislagers wrote: >> I want to document >> packages/fcl-db/src/sqldb/interbase/ibconnection.pp >> What do I enter as package? fcl-sqldb? How do I find out? (And if so, >> can that be documented for amateurs like

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread Graeme Geldenhuys
On 17 November 2011 11:45, wrote: > > I'm not sure why you recommend leaving makeskel ? I use it always for the > initial file ? Given the proper parameters, it > creates a very usable initial file ? Maybe fpdoc has improved in those areas since I found the issues with makeskel generated xml fil

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread michael . vancanneyt
On Thu, 17 Nov 2011, Graeme Geldenhuys wrote: On 17 November 2011 11:06, wrote: Apart from that, is this the right command to start? You can drop the '--update', if it is the first time. and the output option should be  --output=ibconnection.xml, not  --output=ibconnection.pp I would e

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread Graeme Geldenhuys
On 17 November 2011 11:06, wrote: >> Apart from that, is this the right command to start? > > You can drop the '--update', if it is the first time. > and the output option should be >  --output=ibconnection.xml, not >  --output=ibconnection.pp I would even go as far as to say Leave Makeskel

Re: [fpc-pascal] Makeskel & how to add Firebird connection documentation?

2011-11-17 Thread michael . vancanneyt
On Thu, 17 Nov 2011, Reinier Olislagers wrote: Hi list, I want to document packages/fcl-db/src/sqldb/interbase/ibconnection.pp So I run this to get started: makeskel --disable-private --emit-class-separator --update --package=fcl-sqldb --input=/home/reinier/fpc271/packages/fcl-db/src/sqldb/i

Re: [fpc-pascal] parent class as a parameter type

2011-11-17 Thread ik
On Mon, Nov 14, 2011 at 23:03, Jonas Maebe wrote: > > On 13 Nov 2011, at 17:56, Graeme Geldenhuys wrote: > > > On 12/11/2011, ik wrote: > >> > >> procedure foo(AClass : TStrings); > >> foo(MyStringList); // Will return an error that TStrings is expected ... > >> > >> I can not use TStringList as

Re: [fpc-pascal] JSON - RTTI streaming.

2011-11-17 Thread michael . vancanneyt
On Wed, 16 Nov 2011, Stephane Carre wrote: Hello Michael, In the current stable release (fpc 2.4.4) the unit tests for fpjsonrtti fail to compile because unit testcomps is missing. I believe this is the unit with the test classes used for the destreamer tests. Where can I find this unit ?