I have a huge expression for a textbox in the CONTROL SOURCE
. Sometimes it returns 0
and sometimes -1
, what do these values mean?
views:
67answers:
2
+2
A:
Read here http://msdn.microsoft.com/en-us/library/aa164500%28office.10%29.aspx
The Boolean data type is a special case of an integer data type. The Boolean data type can contain True or False; internally, VBA stores the value of True as -1, and the value of False as 0
Gaby
2010-07-07 17:12:38
+1
A:
VBA uses 0 for False and -1 for True. (But generally a non-Null, non-zero value will be evaluated as True.) So it looks like your expression is returning a Boolean (True/False) value.
HansUp
2010-07-07 17:13:39
who marked this down? this is completely the right answer but gaby answered it correctly first
I__
2010-07-07 17:23:50
That answer came in as I was ready to submit mine. I submitted mine because I wanted you to realize a value doesn't have to be -1 to be evaluated as True. I don't mind the down vote.
HansUp
2010-07-07 17:35:02