> | > procedure x (const str: string);
> | > begin
> | >   filewrite (filedescriptor,pchar(str+#13#10)^,length(str)+2);
> | > end;
> |
> | I do not think this should work. You can't pass the address of a temp
> | like this.
>
> Yes I had to convert some constants to var's (and initialize them) in one
> procedure..
> and I noticed Thaddy did this too. I assume delphi is a bit less strict in
> that it
> let's you get away with the below... but I'm not sure if it's good to be
> less strict
> in this case.. (poor style?) What do you think..

It is even slow. Splitting it in 2 lines is faster since it removes the
implicit string concattenation

filewrite (filedescriptor,pchar(str)^,length(str));
filewrite (filedescriptor,#13#10,2);



_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to