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

Tomas Hajny XHajT03 at hajny.biz
Wed Nov 16 21:47:41 CET 2011


On 16 Nov 11, at 21:53, Bart wrote:
> On 11/16/11, Jonas Maebe <jonas.maebe at elis.ugent.be> 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(pc|);
> end.
> 
> Error 67: String expression expected.  (| indicates the cursor)

Indeed - TP/BP 7.0 gives the same (error) result. Unit strings (which 
might be more appropriate than unit objects included by Bart) doesn't 
change the result either.

Tomas




More information about the fpc-pascal mailing list