title: How to Exit with a record as result in Delphi?
body: <p>Delphi has an option to exit with a value (Example: Exit(0);), but how do I exit with a value if the return value is a record?</p>
  <pre><code>TIntResult = record
    Value: Integer;
    Error: String;
  end;
  
  function GetCount: TIntResult;
  begin
    if not IsLoggedIn then
      Exit(Value: 0; Error: 'Not logged in'); // I want this
  
    if not IsAdmin then
      Exit(TIntResult(Value: 0; Error: 'Not Admin')); // or this
    ...
  end;
  </code></pre>