Hi,

I am trying to use 'If Not' condition when the variable = 0.

Debug = 0

If Not Debug Then
Wscript.echo "hi"
End If

In this we VBS will step into the condition. Is there a way like in 'c'
language to use if(!Debug) ?

Re: If Not Debug Then by beppolainen

beppolainen
Tue Nov 30 05:29:37 CST 2004

In VBScript, the numeric value 0 is interpreted as False, and all
other values is considered True. Thus, 1 and -1 is True while 0 is
False.

The problem is that you cannot declare a variable that's called Debug
(maybe it's reserved?), but you can create a function called Debug. So
you could do something like:

Function Debug()
Debug = True
End Function

If Not Debug Then
WScript.Echo "Not debug"
End If

Regards,
Johan

"Ronen" <eyasso@hotmail.com> wrote in message news:<uoIAPkq1EHA.1524@TK2MSFTNGP09.phx.gbl>...
> Hi,
>
> I am trying to use 'If Not' condition when the variable = 0.
>
> Debug = 0
>
> If Not Debug Then
> Wscript.echo "hi"
> End If
>
> In this we VBS will step into the condition. Is there a way like in 'c'
> language to use if(!Debug) ?