title: How to set the value of an enum type?
body: <p>I have the following:</p>
  
  <pre><code>TDirection = (dirNorth, dirEast, dirSouth, dirWest);
  TDirections = set of TDirection;
  </code></pre>
  
  <p>In a seperate class I have it declared as a property:</p>
  
  <pre><code>property Directions: TDirections read FDirections write FDirections;
  </code></pre>
  
  <p>What I want is to be able to treat them as if they were Booleans, so for example if <code>dirNorth</code> was True then it would be <code>1</code>, if False it would be <code>0</code>.</p>
  
  <p>I am trying to imagine it as <code>(1,0,0,0)</code></p>
  
  <p>I think to check if a direction is True, I could use:</p>
  
  <pre><code>var
    IsTrue: Boolean;
  begin
    IsTrue := (DirNorth in Directions);
  </code></pre>
  
  <p>Not sure if the above is correct or not, but then my other problem is how to change one of the directions to <code>True</code> or <code>False</code>?</p>
  
  <p>I have now reached one of my confusion states :(</p>
  
  <p>This is the last thing I tried to set the value but I am getting Illegal Expression (in Lazarus).</p>
  
  <pre><code>Directions(TDirection(DirNorth)) := True;
  </code></pre>