<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 03.11.2019 17:49, Sven Barth via
lazarus wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFMUeB9A+aEFbJ26O8ueM8cZwROPWne1pmnyqMTq6uPdZA0_tA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Ondrej Pokorny via lazarus
<<a href="mailto:lazarus@lists.lazarus-ide.org"
moz-do-not-send="true">lazarus@lists.lazarus-ide.org</a>>
schrieb am So., 3. Nov. 2019, 11:21:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">On
02.11.2019 11:23, Michael Van Canneyt via lazarus wrote:<br>
> TStrings has a property<br>
><br>
> property Values[const Name: string]: string read
GetValue write <br>
> SetValue;<br>
><br>
> The setter is defined as:<br>
><br>
> procedure SetValue(const Name, Value: string);<br>
><br>
> Note that both arguments are 'const'<br>
><br>
> When adding a new property, and pressing 'CTRL-C',
the IDE adds the new<br>
> property, but also insists on adding a new SetValue:<br>
><br>
> procedure SetValue(const Name: string; AValue:
string);<br>
><br>
> Note the missing const on the second parameter.<br>
><br>
> It does this of course not only for TStrings, but for
all such properties.<br>
<br>
The problem is not the const - Lazarus can ignore it. The
problem is <br>
that the parameters are joined - that is what Lazarus
cannot handle.<br>
<br>
Replace<br>
procedure SetValue(const Name, Value: string);<br>
with<br>
procedure SetValue(const Name: string; const Value:
string);<br>
<br>
then Lazarus won't add it every time you do class
completion. I know - <br>
it's not what you currently have in the interface, but the
difference is <br>
just cosmetic. I usually let Lazarus do its job and don't
care that the <br>
parameters are separated.<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">This is not what one wants to hear.</div>
</div>
</blockquote>
<p>Well, I just explained the current state. It doesn't mean it
cannot be improved.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAFMUeB9A+aEFbJ26O8ueM8cZwROPWne1pmnyqMTq6uPdZA0_tA@mail.gmail.com">
<div dir="auto">
<div dir="auto"> Lazarus really likes to mess with existing code
and it's one of the main reasons I'm *not* using class
completion inside the compiler, cause otherwise I can be sure
that the whole remaining class is changed as well -.-</div>
</div>
</blockquote>
<p>To be honest, the compiler code style is very quirky :)</p>
<p>Ondrej<br>
</p>
</body>
</html>