[thelist] Boolean values in different language OSs and clients.

Wade Armstrong wade_lists at runstrong.com
Fri Aug 23 19:02:00 CDT 2002


on 8/23/02 4:45 PM, Thomas Granger - TK - Filter at java_fella at yahoo.com
wrote:

> Another challenge for the order....
>
> In VB or VBS, the word "True" is a key word that means
> -1 the word false actually means 0
To be pedantic, false means 0 and true can take many values, the most common
of which is -1. "True" just means "True," since it's a string. "True" does
not mean true ("True" <> true).

> IF x = "Falso" THEN X = "False" might do the trick..
>
> Any thoughts? Any resources or a point in the right
> direction for script resources?

Aah, here's where pedantry gets you somewhere. In VBScript (which is where I
assume you're running into a problem, since I think you shouldn't have this
problem in VBA), all variables are variants. So when you've set a variable
to true, there's no flag that it's a boolean value; it could just as well be
the value -1.

The answer? When doing comparisons, always cast them explicitly. So try: x =
CBool(x)

Wade




More information about the thelist mailing list