title: Delphi Reference Parameter / Default parameter
body: <p>Let's say I have an object which I would like to copy.</p>
  
  <pre><code>interface
  
  type
    TPerson = Class(TObject)
    public
      first_name: string;
      last_name: string;
      address: string;
    public
      constructor Create;
      procedure CopyTo(var s1, s2, s3: string);
    ...
  
  implementation
  
  ...
  
  procedure TPerson.CopyTo(var s1, s2, s3: string)
  begin
    s1 := first_name;
    s2 := last_name;
    s3 := address;
  end;
  
  end.
  </code></pre>
  
  <p>Then I can use my class like this :</p>
  
  <pre><code>...
  var
    name1, name2, address: string;
  begin
    person := TPerson.Create;
    person.first_name = 'John';
    person.last_name = 'Doe';
    person.address = '10 Downing Street';
    person.CopyTo(name1, name2, address);
  end;
  </code></pre>
  
  <p>But if I am not interested in copying the address, I would like to be able to use it like this</p>
  
  <pre><code>...
  var
    name1, name2: string;
  begin
    person := TPerson.Create;
    person.first_name = 'John';
    person.last_name = 'Doe';
    person.address = '10 Downing Street';
    person.CopyTo(name1, name2);
  
    // Some bad legacy code that has a lot more unstructured fields
  end;
  </code></pre>
  
  <p>I was thinking of writing an overload <code>CopyTo(var s1, s2: string)</code> or using as many buffer variables as number of string I want to forget ?</p>
  
  <p>Is there a more elegant way ?</p>
  
  <p>Thanks.</p>