title: Variable might not have been initialized in Delphi function
body: <p>I am building this function that will return whether an ID is returned by the query or not. I am new to Delphi, and I am getting the error</p>
  
  <blockquote>
    <p>Variable emailExistsId may not be initialized.</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>function emailExists (const APersonId: TStandardPK) : Boolean ;
  var
    Email : TPhoneEmail;
    emailExistsId: TStandardPK;
  
  begin
    Email := TPhoneEmail.Create(nil);
    try
      emailExistsId :=  Email.qrySelect.FieldByName('id').AsFloat;
    finally
      if emailExistsId &lt;&gt; 0  then
      Result := TRUE
      else
      Result :=False;
    end;
  end;
  </code></pre>