Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Rainer Stratmann
Am Monday 14 November 2011 22:00:28 schrieb Jonas Maebe: > On 13 Nov 2011, at 14:02, Rainer Stratmann wrote: > > Am Sunday 13 November 2011 02:15:07 schrieb leledumbo: > >> It works when {$LONGSTRINGS ON} or {$H+} directive exists. I think the > >> compiler treats functions receiving array of char

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread michael . vancanneyt
On Wed, 16 Nov 2011, Rainer Stratmann wrote: Am Monday 14 November 2011 22:00:28 schrieb Jonas Maebe: On 13 Nov 2011, at 14:02, Rainer Stratmann wrote: Am Sunday 13 November 2011 02:15:07 schrieb leledumbo: It works when {$LONGSTRINGS ON} or {$H+} directive exists. I think the compiler trea

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Martin
On 16/11/2011 15:55, Rainer Stratmann wrote: -Sh- Is the same as {$h-} or {$longstrings off}. You need -Sh (provided that there's no {$mode fpc/objfpc/tp/macpas} in the source file, since that will disable them again). With {$h+} it works. But when having pchar I wonder why it generally is not p

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Sven Barth
Am 16.11.2011 17:06, schrieb Martin: As mentioned before by someone else: length does read a field from the string, which does not exist in pchar (hence string can contain #0 and pchar can not). Jonas mentioned in another mail in this thread (as an answer to Felipe) that "Length(PChar)" is con

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Martin
On 16/11/2011 16:06, Martin wrote: As mentioned before by someone else: length does read a field from the string, which does not exist in pchar (hence string can contain #0 and pchar can not). Ok, before someone comments on this: pchar can contain #0 but for automatic string conversation t

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Jonas Maebe
On 16 Nov 2011, at 17:06, Martin wrote: So why not use pos(#0, foo_pchar) ? That will convert foo_pchar to a string type (which one probably depends on the state of the {$h} switch) and then call pos() on it. Again: length(pchar) is perfectly correct and will be translated into strlen(

Re: [fpc-pascal] pchar with more than 255 characters

2011-11-16 Thread Felipe Monteiro de Carvalho
On Tue, Nov 15, 2011 at 11:33 AM, Jonas Maebe wrote: > length(pchar) is translated into strlen(pchar) (just like in Delphi). But why is it limited to 255 chars in {$H-} ? (I understood that it is limited like this from the original poster) I don't see anything about this in the docs: http://www

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Sven Barth
Am 16.11.2011 16:55, schrieb Rainer Stratmann: But when having pchar I wonder why it generally is not possible to make strings longer than 255 as it was possible in the previous compiler version. There was never a change regarding this as far as I know. For shortsting I accept strings not lo

Re: [fpc-pascal] pchar with more than 255 characters

2011-11-16 Thread Sven Barth
Am 16.11.2011 17:15, schrieb Felipe Monteiro de Carvalho: On Tue, Nov 15, 2011 at 11:33 AM, Jonas Maebe wrote: length(pchar) is translated into strlen(pchar) (just like in Delphi). But why is it limited to 255 chars in {$H-} ? (I understood that it is limited like this from the original poste

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Jonas Maebe
On 16 Nov 2011, at 17:15, Sven Barth wrote: Am 16.11.2011 16:55, schrieb Rainer Stratmann: But when having pchar I wonder why it generally is not possible to make strings longer than 255 as it was possible in the previous compiler version. There was never a change regarding this as far as

Re: [fpc-pascal] pchar with more than 255 characters

2011-11-16 Thread Jonas Maebe
On 16 Nov 2011, at 17:15, Felipe Monteiro de Carvalho wrote: On Tue, Nov 15, 2011 at 11:33 AM, Jonas Maebe > wrote: length(pchar) is translated into strlen(pchar) (just like in Delphi). But why is it limited to 255 chars in {$H-} ? It is not. (I understood that it is limited like this fro

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Sven Barth
Am 16.11.2011 17:25, schrieb Jonas Maebe: On 16 Nov 2011, at 17:15, Sven Barth wrote: Am 16.11.2011 16:55, schrieb Rainer Stratmann: But when having pchar I wonder why it generally is not possible to make strings longer than 255 as it was possible in the previous compiler version. There was

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Sven Barth
Am 16.11.2011 17:25, schrieb Jonas Maebe: On 16 Nov 2011, at 17:15, Sven Barth wrote: Am 16.11.2011 16:55, schrieb Rainer Stratmann: But when having pchar I wonder why it generally is not possible to make strings longer than 255 as it was possible in the previous compiler version. There was

Re: [fpc-pascal] pchar with more than 255 characters

2011-11-16 Thread Rainer Stratmann
Am Wednesday 16 November 2011 17:15:51 schrieb Felipe Monteiro de Carvalho: > On Tue, Nov 15, 2011 at 11:33 AM, Jonas Maebe wrote: > > length(pchar) is translated into strlen(pchar) (just like in Delphi). > > But why is it limited to 255 chars in {$H-} ? (I understood that it is > limited like th

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Bart
On 11/16/11, Jonas Maebe wrote: > Again: length(pchar) is perfectly correct and will be translated into > strlen(pchar), just like in Delphi (and probably even like in TP). Couldn't resist; Turbo Pascal 6.0: Program Prog; uses objects; var pc: PChar; Len: Integer; begin Len := Length(p

Re: [fpc-pascal] Re: pchar with more than 255 characters

2011-11-16 Thread Tomas Hajny
On 16 Nov 11, at 21:53, Bart wrote: > On 11/16/11, Jonas Maebe wrote: > > > Again: length(pchar) is perfectly correct and will be translated into > > strlen(pchar), just like in Delphi (and probably even like in TP). > > Couldn't resist; > > Turbo Pascal 6.0: > > Program Prog; > > uses object

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

2011-11-16 Thread Stephane Carre
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 ? Thanks for this ! Regards, Stephane Carre On 06

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

2011-11-16 Thread Reinier Olislagers
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/interbase/ibconnection.pp --output=ibconnection.pp W