1
vote
Vote UpVote

Exit Stage Left

TPersistent.com – The Exit procedure has been around as long as Goto in Object Pascal.  Goto is considered an antiquated command, but what about about Exit?  When should it be used if at all? I have often seen guard code at the beginning of a method that performs an Exit if the parameters passed are not appropriate or indicate the method does not need to act on the parameters passed.  This might happen in a method like this: procedure TSomeForm.CheckHaveID(const AID: string); begin if AID EmptyStr then Exit; ...other code to populate AID if necessary... end; In this case the first few lines are a ...
Favorite? Off-Topic? Larry Hengen @ 2020-05-08 21:02

Statistics

Visits: 232
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Michał Rajewicz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)