title: Delphi dynamic form array and data array management
body: <p>I have to solve next problem:</p>
  
  <p>Form23:</p>
  
  <pre><code>public
   { Public declarations }
   FormsArray : array of TForm24;
  end;
  
  
  Procedure Create_form;
  begin
   SetLength(FormsArray, Length(FormsArray)+1);
   FormsArray[Length(FormsArray)-1] := TForm24.Create(Self);
  end;
  </code></pre>
  
  <p>Form24:</p>
  
  <pre><code>public
  end;
  
  var
   UniqueValue : Array of ShortString;
  
  Procedure Fill_Unique;
  var
   tmp1 : Longint;
  begin
   SetLength(UniqueValue, 256);
   for tmp1 := 0 to Length(UniqueValue)-1 do
   begin
    UniqueValue[tmp1] := IntToStr(tmp1);
   end;
  end;
  
  Procedure OnButtonClick(Sender);
  begin
   Fill_Unique;
  end;
  </code></pre>
  
  <p>When i have one form Form24 and i fill with some values, then it is ok.</p>
  
  <p>When i have two forms Form24 (FormsArray[0] and FormsArray[1]) and i change UniqueValue in one form, then i have that values in two forms.</p>
  
  <p>i.e.</p>
  
  <p>I create FormsArray[0] and FormsArray[1]</p>
  
  <p>When I click button on FormsArray[0]:</p>
  
  <p>FormsArray[0] - UniqueValue[...] = '1,2,3,4,5,6,7,8,9...';</p>
  
  <p>FormsArray[1] - UniqueValue[...] = '1,2,3,4,5,6,7,8,9...';</p>
  
  <p>When I click button on FormsArray[1]:</p>
  
  <p>FormsArray[0] - UniqueValue[...] = '1,2,3,4,5,6,7,8,9...';</p>
  
  <p>FormsArray[1] - UniqueValue[...] = '1,2,3,4,5,6,7,8,9...';</p>
  
  <p>When i change code to:</p>
  
  <p>Form24:</p>
  
  <pre><code>public
   UniqueValue : Array of ShortString;
  end;
  </code></pre>
  
  <p>and I click button on FormsArray[1] then i have:</p>
  
  <p>FormsArray[0] - UniqueValue[...] = '';</p>
  
  <p>FormsArray[1] - UniqueValue[...] = '';</p>
  
  <p>UniqueValue is empty.</p>
  
  <p>I need to have independent arrays in every forms Form24 i have created (different UniqueValue in every forms i create).</p>
  
  <p>How to do this? What i do wrong?</p>
  
  <p>Thanks for any help.</p>
  
  <p><strong>SOLVED !</strong></p>
  
  <p>I got -1 for solution what i write here. Then will be no solution. Search for yourself.</p>