title: Delphi - Calling procedure with optional VAR parameters?
body: <p>Delphi 2010 - I have a routine which takes a string and processes it.  There are 3 different types of processing, and I may need any combination, including all 3 ways of processing.  I am trying to determine how to call my routine, but everything I try is causing issues.  What I want to do is call the procedure something like this...</p>
  
  <pre><code>StringProcess(StartString1, VarProcess1, VarProcess2, VarProcess3);
  </code></pre>
  
  <p>but it could just as easily be this is I only want 2 of the processes</p>
  
  <pre><code>StringProcess(StartString1, '', VarProcess2, VarProcess3);
  </code></pre>
  
  <p>The procedure definition is something like</p>
  
  <pre><code>procedure StringProcess(StartString: string; var S1:String; var S2:string; var S3:string);
  </code></pre>
  
  <p>So in summary... How do I define my procedure to return between 1 and 3 VAR variables?  Delphi is wanting me to always pass 3 variables, and I just have to ignore the one if I don't need it. Is there a way to pass "non-existant" VAR parameters, and just ignore them as needed?</p>
  
  <p>Thanks</p>