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] 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] 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] 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] pchar with more than 255 characters

2011-11-15 Thread Jonas Maebe
On 14 Nov 2011, at 22:08, Felipe Monteiro de Carvalho wrote: > On Sun, Nov 13, 2011 at 1:39 AM, Rainer Stratmann > wrote: >> procedure getchars( p : pchar ); >> var l : longint; >> begin >> l := length( p ); >> end; > > You cannot do length in a PChar length(pchar) is translated into strlen(p

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

2011-11-14 Thread Felipe Monteiro de Carvalho
On Sun, Nov 13, 2011 at 1:39 AM, Rainer Stratmann wrote: > procedure getchars( p : pchar ); > var l : longint; > begin >  l := length( p ); > end; You cannot do length in a PChar, it has no length information. I think this code is probably automatically converting the PChar to a Pascal String and

[fpc-pascal] pchar with more than 255 characters

2011-11-12 Thread Rainer Stratmann
procedure getchars( p : pchar ); var l : longint; begin l := length( p ); end; If calling getchars with chars longer than 255 l is always 255. For example: getchars( '12345 ... 255256257258' + '1234567213939873987' + ... ... '12345672