<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Find how many elements filled inside an array</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/dbdbfa439f/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/dbdbfa439f/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/dbdbfa439f/</id><updated>2023-01-10T14:50:21.319000Z</updated><subtitle>Recent posts to Find how many elements filled inside an array</subtitle><entry><title>Find how many elements filled inside an array</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/dbdbfa439f/?limit=25#c319" rel="alternate"/><published>2023-01-10T14:50:21.319000Z</published><updated>2023-01-10T14:50:21.319000Z</updated><author><name>nothinrandom</name><uri>https://forge.codesys.com/u/nothinrandom/</uri></author><id>https://forge.codesys.comfd8cf58e20fb2310b921516e59ec9a972d11bfa9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When you're filling out this array, couldn't you just keep track of the filled index via a separate variable?  This is especially important if you're re-using this array since each transaction might not have the same size.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Find how many elements filled inside an array</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/dbdbfa439f/?limit=25#4e70" rel="alternate"/><published>2022-12-02T10:46:05.536000Z</published><updated>2022-12-02T10:46:05.536000Z</updated><author><name>androidzz</name><uri>https://forge.codesys.com/u/androidzz/</uri></author><id>https://forge.codesys.comaa30c300f04a7422af618e42ef7f23e89de3ad01</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have an array:  aTelemetry: ARRAY&lt;span&gt;[0..65536]&lt;/span&gt; OF BYTE; &lt;br/&gt;
I put data inside this array. the amount of elements filled inside this array can be variable all the time. &lt;/p&gt;
&lt;p&gt;I want to publish this array via mqtt but if i publish the whole array i get alot of blanc data/white spaces as data. So i only want to send SIZEOF(aTelemetry) without empty elements. &lt;br/&gt;
suppose I fill the array with 60000 bytes, then I don't want to include the last 5536 Bytes. &lt;/p&gt;
&lt;p&gt;So the question; is there a function/manner to see how much of the array is filled with written data? &lt;/p&gt;
&lt;p&gt;kind regards&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>