In Delphi 2009 you can replace the two statements with a new special call to Exit passing to it the return value of the function, in a way resembling the C language return statement. So you can write the code above in a more compact version (also because with a single statement you can avoid the begin/ end):
function FindExitValue (
sl: TStringList; n: Integer): string; var
I: Integer; begi n for I := 0 to sl.Count do if Pos (intToStr (n), sl[l]) > 0 then Exit (sl[l]);
Was this article helpful?
What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.