title: delphi: inaccessible value on var parameter
body: <p>I have this example method below</p>
  
  <pre><code>procedure ReadData(var data:TDataSet)
  begin
     if Assigned(data) then
        data.Free;
     data:=TDataSet.Create(nil);
     ....
  end;
  
  .....
  procedure SomethingProcedure()
  var
     dataSet:TDataset;
  begin
     ReadData(dataSet);
  end;
  </code></pre>
  
  <p>if I debugged and I place breakpoint on Assigned checking, data.Free always executed, and I saw on watch list, data always inaccessible value</p>
  
  <p>My point is SomethingProcedure is access for many other procedure, and I want data parameter if it assigned (already created TDataset object), free it first, but if not assigned (not created object), free command doesn't execute, but free statement always executed, either "data" object created or not</p>
  
  <p>How I can check my object already created or not</p>