<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Array questions</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/91a5888ac0/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/91a5888ac0/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/91a5888ac0/</id><updated>2020-02-27T19:35:39.496000Z</updated><subtitle>Recent posts to Array questions</subtitle><entry><title>Array questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/91a5888ac0/?limit=25#598f" rel="alternate"/><published>2020-02-27T19:35:39.496000Z</published><updated>2020-02-27T19:35:39.496000Z</updated><author><name>maniek765</name><uri>https://forge.codesys.com/u/maniek765/</uri></author><id>https://forge.codesys.comdbad5a7faac9c68f8aef5a012fffd5e2e46bde2c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;EmbeddedSalsa hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Note: Pointers are not allowed in my company.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Why???  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Array questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/91a5888ac0/?limit=25#d012" rel="alternate"/><published>2020-02-27T19:35:35.964000Z</published><updated>2020-02-27T19:35:35.964000Z</updated><author><name>EmbeddedSalsa</name><uri>https://forge.codesys.com/u/embeddedsalsa/</uri></author><id>https://forge.codesys.com41956b216399bf05f77ff2bc5819082b9e299524</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks a lot, Scott!&lt;br/&gt;
I would like ask Codesys (if they read) to implement Const References for that and also implement my 1. point in ST.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Array questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/91a5888ac0/?limit=25#3185" rel="alternate"/><published>2020-02-27T19:35:34.681000Z</published><updated>2020-02-27T19:35:34.681000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com8984cd2708a9f743797abe475f759c42d08a2fd3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; scott_cunningham&lt;/p&gt;
&lt;p&gt;An answer to your second question:&lt;/p&gt;
&lt;p&gt;There are two solutions for passing an array reference without passing the whole array while not using pointers:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;VAR_INPUT&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;History&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;REFERENCE&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="nb"&gt;ARRAY&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;DWORD&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Array questions</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/91a5888ac0/?limit=25#6fbf" rel="alternate"/><published>2020-02-27T19:35:33.393000Z</published><updated>2020-02-27T19:35:33.393000Z</updated><author><name>EmbeddedSalsa</name><uri>https://forge.codesys.com/u/embeddedsalsa/</uri></author><id>https://forge.codesys.com4060bb46043032ac258eff73de115bcdcd6044e3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Dear all,&lt;br/&gt;
1.is it possible to declare an array, with a size taken from initializer.&lt;br/&gt;
In C it is:&lt;br/&gt;
int a[]={1,2,3}&lt;/p&gt;
&lt;p&gt;How I do the same in codesys?&lt;br/&gt;
Please note, I DON'T request run-time dynamic array. I only request to don't declare a size abut take it from amount of initializers, like in C.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;How array are passed in function blocks?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Var input&lt;br/&gt;
invar array &lt;span&gt;[0..5]&lt;/span&gt; of int;&lt;br/&gt;
end var&lt;/p&gt;
&lt;p&gt;What is passed only the "reference" or the copy of the whole array on the stack. If so, how do I only pass array by reference? I want to read from array inside of the block, but don't want to write something back.&lt;/p&gt;
&lt;p&gt;Note: Pointers are not allowed in my company.&lt;br/&gt;
Thanks a lot!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>