Vote UpVote

New Tip: TBooleanHelper.ToString and TUseBoolStrs enumeration

Marco's Tech Blog – Among the native type record helpers that were introduced in the Delphi RTL a few years back, there is one for the Boolean data type. It has a few methods you can apply to a Boolean variable, including ToString. This is the class helper definition: If you call ToString on a Boolean variable you get 0 or -1 depending on the value. In other words, True.ToString produces -1. The ToString method has also a second parameter, UseBoolStrs, to let the method return a string with the text False or True.  However, if you call True.ToString(True) you still get -1. What's up? As ...
Favorite? Off-Topic? marcocantu @ 2019-10-07 18:07


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

Visits by Source

User Actions

Users who voted for this posting

Michał Rajewicz
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)