[lazarus] String parameters
Florian Klaempfl
Florian.Klaempfl at gmx.de
Sun May 20 05:40:34 EDT 2001
At 02:47 20.05.01 -0500, you wrote:
>Hello:
>
>I've been browsing codetools, I've seen that string parameters are not
>declared as var nor const:
>
>procedure f(s:string);
>
>If you are not going to modify the string in the procedure/function, it
>should be declared as
>
>procedure f(const s:string);
>
>In the first call compiler makes a copy of the string, in the second call it
>is a reference as a var parameter, but doesn't let you modify it . if the
>string is a long string it is a lot of time.
I think it doesn't matter for lazarus, because lazarus is mainly using
ansistrings
and ansistring parameters are only a pointer.
More information about the Lazarus
mailing list