0
votes
Vote UpVote

D'oh! Those Negative Boolean AND Bitwise Expressions :(

About Delphi Programming – in D'Oh Moments :: Again, never mind years of programming! A "D'oh" moment for me is when I do an obvious coding error but I am not able to see it even in the debugger. Consider the following section of code: var sl : TStringList; begin sl := TStringList.Create; try if (NOT sl.Count > 0) then ShowMessage('String list is empty'); finally FreeAndNil(sl); end; end; Would you expect to see the message "String list is empty"? I would. We have only created the string list and just after creating, it should be empty (i.e. the Count property should not be greater than zero). ...
Favorite? Off-Topic? 2011-10-21 07:48

Statistics

Visits: 721
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

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)