<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Mehrere Array-Elemente zyklisch zuweisen</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/dc3b520784/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/dc3b520784/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/dc3b520784/</id><updated>2020-02-28T00:33:46.616000Z</updated><subtitle>Recent posts to Mehrere Array-Elemente zyklisch zuweisen</subtitle><entry><title>Mehrere Array-Elemente zyklisch zuweisen</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/dc3b520784/?limit=25#22ab" rel="alternate"/><published>2020-02-28T00:33:46.616000Z</published><updated>2020-02-28T00:33:46.616000Z</updated><author><name>Erik Böhm</name><uri>https://forge.codesys.com/u/erik-boehm/</uri></author><id>https://forge.codesys.comcb2f4098236ed75e2a74c503d86b7d37f4eff4ee</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Moin&lt;/p&gt;
&lt;p&gt;Eine extra Syntax für sowas gibts wohl nicht.&lt;br/&gt;
Wenn du unbedingt Zeilen sparen willst, dann nimm einen Pointer.&lt;/p&gt;
&lt;p&gt;Gruß Erik&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Mehrere Array-Elemente zyklisch zuweisen</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/dc3b520784/?limit=25#368c" rel="alternate"/><published>2020-02-28T00:33:44.852000Z</published><updated>2020-02-28T00:33:44.852000Z</updated><author><name>Patmo1</name><uri>https://forge.codesys.com/u/patmo1/</uri></author><id>https://forge.codesys.com87162c39e9567f8145db0632350eac99ec7a92f0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Bei der Deklaration ist folgende Array-Initialisierung möglich:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;int1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;int2&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;int3&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;TestArray&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;int1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="n"&gt;int2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="n"&gt;int3&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Ich möchte nun aber zyklisch die drei Integer in das Array schreiben.&lt;/p&gt;
&lt;p&gt;Folgender Implementierungs-Code geht leider nicht:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;TestArray&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;int1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;int2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;int3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Ich finde keine andere Lösung außer:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;TestArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;int1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;TestArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;int2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;TestArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;int3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Geht das irgendwie auch mit einer Zuweisung wie bei der Initialisierung?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>