title: How to use a list of records
body: <p>I have a record in a method as a local variable. Then I add it to a TList that is a member of the class. Now my question is after the method is finished, is the record is still valid? (or its destroyed and I shouldn't use MyList.List[0]).
  this is a sample code:</p>
  
  <pre><code>TTestClass = class
    MyList: TList&lt;TMyRec&gt;;
    procedure add;
  end;
  
  procedure TTestClass.add;
  var
    ARec: TMyRec;
  begin
    Arec.a:= 100;
    ARec.b:= 'abc';
  
    MyList.add(ARec);
  end;
  </code></pre>