title: How to declare static variables in Delphi 2009?
body: <p>I googled,I binged,I already have seen the other "duplicates" here,but none of them work in Delphi 2009 updated up to update 4.</p>
  
  <p>Like in C#,I want to make a static variable in on line or as short as possible.In the end it works like a global variable,but its sorted.</p>
  
  <p>What's the shortest way to do this in delphi 2009?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I followed some of your answers,but it doesn't work.</p>
  
  <p>type:</p>
  
  <pre><code>type
  TmyClass = class(TObject)
    var staticVar:integer;
  end;
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  var a:integer;
  begin
    TMyClass.staticVar := 5; // Line 31
    a := TMyClass.staticVar; // Line 32
    MessageBox(0,IntToStr(a),'',0);
  end;
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <pre><code>[DCC Error] Unit1.pas(31): E2096 Method identifier expected 
  
  [DCC Error] Unit1.pas(32): E2096 Method identifier expected
  </code></pre>