I\'m working with a bit of old VB6 code that goes thus...
Dim STATUS As Integer
STATUS = -1
If (Not STATUS) Then
\' do something
Else
\' do something else
In VB 6, True
has a numeric value of -1. False
has a numeric value of 0.
The reason for this is because the Boolean
data type is stored as a 16-bit signed integer. Therefore,
-1 evaluates to 16 1s in binary (1111111111111111). False
is 16 0s (0000000000000000). This produces the relationship that has held throughout the evolution of BASIC: True = Not False
.