Hello John A Grandy" johnagrandy-at-yahoo-dot-com,
Second one, (myTinyInt == 1)
Moreover, try to diminish this kind of bool variable and make (myTinyInt
== 1) in the place where do u need true/falce logic
it gives u more robust way.
J> Often in dbs , tinyint is used instead of int (because tinyint cols
J> may be indexed , whereas int cols may not).
J>
J> What is the best way to convert integers to booleans ?
J>
J> The following fails:
J>
J> bool myBool;
J> tinyint myTinyInt = 1;
J> myBool = (bool) myTinyInt;
J>
J> If you have restricted your integers are restricted to 0 , 1, then
J> the following works, but is difficult to read:
J>
J> myBool = (myTinyInt == 1);
J>
---
WBR,
Michael Nemtsev :: blog:
http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche