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

Martin lazarus at mfriebe.de
Wed Nov 16 17:06:33 CET 2011


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 possible to make
> strings longer than 255 as it was possible in the previous compiler version.
>

Maybe not an answer to your question, but why do you use length?

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).

So why not use  pos(#0, foo_pchar) ?

Of course this does not answer the question IF or WHY this has changed




More information about the fpc-pascal mailing list