Re: [fpc-pascal] Functions with out parameters

2008-03-10 Thread Jonas Maebe
On 10 Mar 2008, at 14:19, Damien Gerard wrote: If you have this, the showmessage display an empty string and sometimes the app crashes. I had a doubt so I tried this : procedure AnotherMethod; var s, t: UTF8String; begin s := 'Some text'; t := s; Foo(t, s); // Do something with `s` end;

[fpc-pascal] Functions with out parameters

2008-03-10 Thread Damien Gerard
I have the following function : procedure Foo(const AText: UTF8String; out AValue: UTF8String); begin ShowMessage(AText); // AValue := 'A custom value'; end; procedure AnotherMethod; var s: UTF8String; begin s := 'Some text'; Foo(s, s); // Do something with `s` end; If you have this