<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why do all my array values change? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/why-do-all-my-array-values-change/m-p/13513723#M26174</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a Global table with one column that holds array type values.&lt;/P&gt;
&lt;P&gt;When I change the value of either one of the array elements, all the arrays in the table change to the same value...even if I change it manually, I can se it before my eyes. Do you know why?&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2019 20:18:34 GMT</pubDate>
    <dc:creator>enrique.elizaga</dc:creator>
    <dc:date>2019-03-11T20:18:34Z</dc:date>
    <item>
      <title>Why do all my array values change?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-do-all-my-array-values-change/m-p/13513723#M26174</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a Global table with one column that holds array type values.&lt;/P&gt;
&lt;P&gt;When I change the value of either one of the array elements, all the arrays in the table change to the same value...even if I change it manually, I can se it before my eyes. Do you know why?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 20:18:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-do-all-my-array-values-change/m-p/13513723#M26174</guid>
      <dc:creator>enrique.elizaga</dc:creator>
      <dc:date>2019-03-11T20:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why do all my array values change?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-do-all-my-array-values-change/m-p/13513724#M26175</link>
      <description>&lt;P&gt;Straight from the manual:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;By default, Arrays are passed around as shared references. This means if you set one Array variable to another Array variable, you are setting the variable to a reference to the first Array, not a copy of the first Array. Thus, if you change either variable's referenced Array data, and it will change it for both variables.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;FlexScript class reference : array&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/19.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Array.html"&gt;Description of online manual version 19 applies for your version,too.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you need independent copies you use the method “clone”.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 06:17:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-do-all-my-array-values-change/m-p/13513724#M26175</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2019-03-12T06:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why do all my array values change?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-do-all-my-array-values-change/m-p/13513725#M26176</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/461/joerg.v.html" nodeid="461"&gt;@Jörg Vogel&lt;/A&gt; You are right. I made the mistake of copy-pasting cells in the table to "copy format", when really I was copying the array itself. Instead now I am formatting the cell and assigningi it an TABLE[row][col] = ARRAY.clone(). This way it preserves the integrity of each array. &lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 05:48:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-do-all-my-array-values-change/m-p/13513725#M26176</guid>
      <dc:creator>enrique.elizaga</dc:creator>
      <dc:date>2019-03-13T05:48:17Z</dc:date>
    </item>
  </channel>
</rss>

