[lazarus] Why is this not working? (PChar conversion)

Michael Van Canneyt michael.vancanneyt at wisa.be
Fri Sep 26 03:23:10 EDT 2003




On Fri, 26 Sep 2003, Tony wrote:

> Working on converting a component from Delphi 5...
>
>
> Given this:
>
>   FComments: String;
>   p : PChar;
>
> This line compiles fine:
>
>   p := PChar(ExtractFilename(FFileSource));
>
> But this line generates an illegal type conversion:
>
>   p := PChar(FComments);
>
> Any ideas?

Is FComments an ansistring or a shortstring, IOW, did you use {$H+} ?

Michael.






More information about the Lazarus mailing list