title: Enums vs Const vs Class Const in Delphi programming
body: <p>I have an integer field in a ClientDataSet and I need to compare to some values, something like this:</p>
  
  <p>I can use const</p>
  
  <pre><code>const
    mvValue1 = 1;
    mvValue2 = 2;
  
  if ClientDataSet_Field.AsInteger = mvValue1 then
  </code></pre>
  
  <p>or enums</p>
  
  <pre><code>TMyValues = (mvValue1 = 1, mvValue2 = 2);
  
  if ClientDataSet_Field.AsInteger = Integer(mvValue1) then
  </code></pre>
  
  <p>or class const</p>
  
  <pre><code>TMyValue = class
  const
     Value1 = 1;
     Value2 = 2;
  end;
  
  if ClientDataSet_Field.AsInteger = TMyValues.Value1 then
  </code></pre>
  
  <p>I like the class const approach but it seems that is not the delphi way, So I want to know what do you think</p>