title: local variable initialized in delphi?
body: <p>During a review process of an older programm code the following question arised: All local variables in a method are initialized right after begin. Usually local variables are not initialized. But we have a procedure where all variables are initialized to 0. Does anybody has an idea how this could happen?</p>
  
  <p>Example:</p>
  
  <pre><code>type
    TPrices = array[0..10, 0..5] of Integer;
  
  procedure DoSomething();
  var
    mPrices : TPrices;
    mValue  : Integer; 
  begin
    if (mPrices[0,0] = 0) then
      MessageDlg('Zero', mtInformation, [mbOK], 0);
    if (mValue = 0) then
      MessageDlg('Zero Integer', mtInformation, [mbOK], 0);
  end;
  </code></pre>