All variables are of type Variant in scripting, so you
can't actually create a boolean (notice informational
comment at end of DIM statement). It can only be
subtyped - and then only by typecasting using an
equivalence statement, as in ...
bVariable = False ' now its a variant, subtype boolean
If you're having troubles with a type mismatch from a roll-
your-own control, it can only be fixed by revising your
control to return only variants.
Tom Lavedas
===========
"Richard Pidcock" <richard...@eds.com> wrote in message
news:0cd301c35cf9$e3b52ee0$a501...@phx.gbl...
> How do I dimension a Boolean variable in a VB Script?
All VBS variables are variants, and there are no initial type declarations.
When used in a Boolean operation, the initial Empty assignment will be
coerced to False (either dual-state or long integer numeric 0). Subtypes
are created when assigned. You can assign dual-state booleans directly,
using the True or False functions, comparisons, etc. The vbTrue and vbFalse
constants are actually long integer subtype numeric booleans, set to 0
or -1. If you need to insure that you have a boolean dual-state variable
for other assignments, use CBool.
Joe Earnest
--
jcf
"Richard Pidcock" <richard...@eds.com> wrote in message
news:0cd301c35cf9$e3b52ee0$a501...@phx.gbl...