O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing True and False Evaluation Operators

One way to implement true and false evaluation mechanisms is to provide implicit or explicit conversions into the data type Boolean for your class. But Visual Basic offers a different option for this purpose—the operators IsTrue and IsFalse. The IsTrue and IsFalse operators don’t work in the usual fashion. They can’t be used as names in your programs, such as CType.

Actually they are simply aids for defining operator procedures to specify a certain procedure for an operation which (similar to implicit data conversion) doesn’t really need operators.

For example, our SuperString class can provide a mechanism that specifies that certain string contents return True when evaluated, and all others False ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required