Vote UpVote

Unexpected Benefit of Inline Variables: Conditional Blocks

The PodCast at Delphi.org – Inline variables is one of the cool new feature coming in 10.3. The obvious huge use case is loop control variables, but I just discovered another great use case while reviewing some code.  procedure DoesSomething; var var1, var2: Integer; begin // use var1 {$IFDEF Something} // use var1 & var2 {$ENDIF Something} end; This is a pattern I see a lot, and it generates a hint on var2 being unused based on the current compiler directive status. [dcc32 Hint] myUnit.pas(123): H2164 Variable 'var2' is declared but never used in 'DoesSomething' Now there ...
Favorite? Off-Topic? Jim McKeeth @ 2018-10-31 01:03


Visits: 411
Votes: 4
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Bruce McGee
Ph. B.
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


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