<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">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_-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" target="_blank" rel="noreferrer">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" target="_blank">operator97@gmail.com</a>>:<br>
> <br>
> From: Ben Grasset <<a href="mailto:operator97@gmail.com" rel="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" 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" 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" 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_-8615399095145634521mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
fpc-devel maillist - <a class="m_-8615399095145634521moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>
<a class="m_-8615399095145634521moz-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>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_-8615399095145634521moz-txt-link-freetext" href="http://wiki.freepascal.org/Helper_types" target="_blank" rel="noreferrer">http://wiki.freepascal.org/Helper_types</a> :(<br>
</p>
<pre class="m_-8615399095145634521de1">TTypeHelper <span class="m_-8615399095145634521sy3">=</span> <span class="m_-8615399095145634521kw1">type</span> helper <span class="m_-8615399095145634521kw1">for</span> <span class="m_-8615399095145634521kw4">Integer</span>
<span class="m_-8615399095145634521kw1">procedure</span> SetZero<span class="m_-8615399095145634521sy1">;</span>
<span class="m_-8615399095145634521kw1">end</span><span class="m_-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>