title: Best way to check if a Variable is nil?
body: <p>A common condition that all programs should do is to check if variables are assigned or not.</p>
  
  <p>Take the below statements:</p>
  
  <p><strong>(1)</strong></p>
  
  <pre><code>if Assigned(Ptr) then
  begin
    // do something
  end;
  </code></pre>
  
  <p><strong>(2)</strong></p>
  
  <pre><code>if Ptr &lt;&gt; nil then
  begin
    // do something
  end;
  </code></pre>
  
  <p>What is the difference between <code>Assigned(Ptr)</code> and <code>Ptr &lt;&gt; nil</code>?</p>