<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Am Mo., 5. Nov. 2018, 01:00 hat Gennady Agranov <<a href="mailto:gennadyagranov@gmail.com">gennadyagranov@gmail.com</a>> geschrieben:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_-6053674670466396191moz-cite-prefix">On 11/4/2018 5:24 PM, Sven Barth via
fpc-devel wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr">Am So., 4. Nov. 2018, 20:36 hat Gennady
Agranov <<a href="mailto:gennadyagranov@gmail.com" target="_blank" rel="noreferrer">gennadyagranov@gmail.com</a>>
geschrieben:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_-6053674670466396191m_-8615399095145634521moz-cite-prefix">On
11/4/2018 11:24 AM, Sven Barth via fpc-devel wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr">Am So., 4. Nov. 2018, 12:23 hat
Schindler Karl-Michael <<a href="mailto:karl-michael.schindler@web.de" rel="noreferrer noreferrer" target="_blank">karl-michael.schindler@web.de</a>>
geschrieben:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> Am 04.11.2018 um 12:00 schrieb Ben
Grasset <<a href="mailto:operator97@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">operator97@gmail.com</a>>:<br>
> <br>
> From: Ben Grasset <<a href="mailto:operator97@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">operator97@gmail.com</a>><br>
> To: FPC-Devel users discussions <<a href="mailto:fpc-devel@lists.freepascal.org" rel="noreferrer noreferrer noreferrer" target="_blank">fpc-devel@lists.freepascal.org</a>><br>
> Subject: Re: Array assignment operator<br>
> Message-ID: <<a href="mailto:CAL4d7FjPfX-ysT6Z3--fhPR9Pts-N47ksFN6m2pHD7SunzwpJg@mail.gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">CAL4d7FjPfX-ysT6Z3--fhPR9Pts-N47ksFN6m2pHD7SunzwpJg@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
> <br>
> On Sat, Nov 3, 2018 at 4:44 PM Gennady
Agranov <<a href="mailto:gennadyagranov@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">gennadyagranov@gmail.com</a>><br>
> wrote:<br>
> <br>
>> Hi,<br>
>> <br>
>> Leaving aside the reason why the
MiSchi's solution doesn't work the main<br>
>> question is still not answered :)<br>
>> <br>
>> If you have integer dynamic array
"MyArray" is there a way for the<br>
>> following statement to compile and
work correctly:<br>
>> <br>
>> MyArray := 5;<br>
>> <br>
> <br>
> Uh, yes? That's what my example showed.<br>
<br>
In your example the length of the array was
set to the number and the elements of the
array assigned to their index, whereas my
intention is to keep the length of the array
and fill all elements to the same number.<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">The operator always creates a new
array and does not modify the existing one. </div>
<div dir="auto">You'd need to abuse a binary
operator (e.g. >< or even <=) for this. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards, </div>
<div dir="auto">Sven </div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote>
</div>
</div>
</div>
<br>
<fieldset class="m_-6053674670466396191m_-8615399095145634521mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
fpc-devel maillist - <a class="m_-6053674670466396191m_-8615399095145634521moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org" rel="noreferrer noreferrer" target="_blank">fpc-devel@lists.freepascal.org</a>
<a class="m_-6053674670466396191m_-8615399095145634521moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer noreferrer" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<p>I was thinking that type helper might work - e.g.
MyArray.SetValue(5) and with using properties
MyArray.Value := 5</p>
<p>But seems that even simple type helper is not working
anymore?</p>
<p>E.g. I was not able to compile example from <a class="m_-6053674670466396191m_-8615399095145634521moz-txt-link-freetext" href="http://wiki.freepascal.org/Helper_types" rel="noreferrer noreferrer" target="_blank">http://wiki.freepascal.org/Helper_types</a>
:(<br>
</p>
<pre class="m_-6053674670466396191m_-8615399095145634521de1">TTypeHelper <span class="m_-6053674670466396191m_-8615399095145634521sy3">=</span> <span class="m_-6053674670466396191m_-8615399095145634521kw1">type</span> helper <span class="m_-6053674670466396191m_-8615399095145634521kw1">for</span> <span class="m_-6053674670466396191m_-8615399095145634521kw4">Integer</span>
<span class="m_-6053674670466396191m_-8615399095145634521kw1">procedure</span> SetZero<span class="m_-6053674670466396191m_-8615399095145634521sy1">;</span>
<span class="m_-6053674670466396191m_-8615399095145634521kw1">end</span><span class="m_-6053674670466396191m_-8615399095145634521sy1">;</span></pre>
</div>
</blockquote>
</div>
</div>
<div dir="auto">Did you add {$modeswitch typehelpers}? </div>
<div dir="auto"><br>
</div>
<div dir="auto">If so, what is the error you get? </div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards, </div>
<div dir="auto">Sven </div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote>
</div>
</div>
</div>
<br>
<fieldset class="m_-6053674670466396191mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
fpc-devel maillist - <a class="m_-6053674670466396191moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>
<a class="m_-6053674670466396191moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" target="_blank" rel="noreferrer">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<p>My error was caused by the fact that I was using delphi mode -
when I used the mode switch it worked perfectly :) </p></div></blockquote></div></div><div dir="auto">In mode Delphi you need to use "record helper" for primitive types as Delphi does not use "type helper" for that. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>