Boolean values: Difference between revisions
Content added Content deleted
(Expanded answer to include examples, and some information about other boolean-like quantities.) |
|||
Line 1,858: | Line 1,858: | ||
set bool (not (= 2 2)) |
set bool (not (= 2 2)) |
||
</lang> |
</lang> |
||
=={{header|VBA}}== |
|||
VBA has a boolean type. As an integer False is 0 and anything else is True. However True converts to -1. Booles are False by default. |
|||
<lang vb>Dim a As Integer |
|||
Dim b As Boolean |
|||
Debug.Print b |
|||
a = b |
|||
Debug.Print a |
|||
b = True |
|||
Debug.Print b |
|||
a = b |
|||
Debug.Print a</lang> |
|||
{{out}} |
|||
Output of above lines:<pre> |
|||
False |
|||
0 |
|||
True |
|||
-1</pre> |
|||
=={{header|Visual Basic}}== |
=={{header|Visual Basic}}== |