[lazarus] Patches to Shanes files

Michael A. Hess mhess at miraclec.com
Wed Jul 7 16:20:57 EDT 1999


Payne Thomas E CNIN wrote:
> 
> FYI
> 
> This works with 0.99.12a of win32
> ----------------------
> program test;
> {$mode objpas}
> uses strings;
> var
>   newpchar : Pchar;
>   stringvar : String;
> begin
>   stringvar := '>hello<';
>   newpchar := StrAlloc(Length(StringVar)+1);
>   StrPCopy(newPChar,StringVar);
>   writeln(string(newpchar));
> end.
> ----------------------
> 
> This does not
> ---------------------
> program test;
> {$mode delphi}
> uses strings;
> var
>   newpchar : Pchar;
>   stringvar : String;
> begin
>   stringvar := '>hello<';
>   newpchar := StrAlloc(Length(StringVar)+1);
>   StrPCopy(newPChar,StringVar);
>   writeln(string(newpchar));
> end.
> ---------------------

Interesting. That being the case Shane, declare the variable that you
are sending as a short string and then pass that.

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list