Heinz,
It really is a boolean. What you're seeing is an artifact of using MsgBox
for output display. MsgBox coerces certain data types to localized strings.
If you're worried about localization issues, I would avoid using MsgBox
unless really needed for actual _choices_ to be made. Instead, use
WScript.Echo.
If you do need to use MsgBox - or InputBox, it has the same issues - for
getting feedback from a user, coerce the value to an integer before
displaying it. The value will then be rendered as a number.
Demo code:
dim x: x = True
' The following shows the type name, vartype, and normal representation of
x:
' Boolean 11 -1
WScript.Echo "from WScript.Echo:", TypeName(x), VarType(x), x
' The following shows the localized string value for x:
MsgBox x
' which is equivalent to this:
WScript.Echo CStr(x)
' Since MsgBox is mangling it, no boolean coercion will help, no matter how
ridiculous:
MsgBox CBool(CBool(CBool(CBool(x))))
' This, however, does work: just turn it into an integer
MsgBox CInt(x)
' Note the same issues happen with InputBox:
InputBox "This is x as converted by InputBox automatically: " & x
InputBox "This is x pre-coerced to integer: " & CInt(x)
"Heinz" <no@xxxxxx> wrote in message
news:eyE5izO5JHA.1432@xxxxxx
> Hi,
>
> I have found that on different languages the boolean value may differ (not
> the value itself - but its string representation...)
>
> For example the "IPEnabled" boolean value (see
> http://msdn.microsoft.com/en-us/libr...17(VS.85).aspx ) :
>
> On an english Windows installation the boolean value for "IPenabled" will
> be given as a string : "true" / "false"
> On a french Windows it will be "vrai" / "faux" ... and on a German Windows
> "wahr" / "falsch" .... etc.
>
> Is there a way to get a boolean value language independent (from the WMI
> classes), so for example -1 / 0 instead of language dependent strings
> ?
>
> Thank you
>
>
>
>
>