StringToPChar
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
{this program work fine with fpc 1.0.10.
It is bad on fpc dos 1.9.5 , fpc win32 2.0.0 (only?) }
uses strings;
function StringToPChar(s:string):PChar;
var a:array[0..255{2}] of char;
begin
StrPCopy(A, s);
StringToPChar:=a;
end;
// if you use var a:array[0..2552] of char; than work
var s:string;
p:pchar;
begin
s:='';
while length(s)<240 do s:=s+'1234567890';
p:=strnew(stringtopchar(s));
writeln(s); // this output is ok
writeln(p); // but this is bad
end.
Additional information:
Reporter: Salvatore Licciardi
EMail: turylicciardi at tiscali dot it
Mantis conversion info:
- Mantis ID: 5932
- OS: All