VBScript IsEmptyFunction


VBScript 参考手册Complete VBScript Reference Manual

The IsEmpty function returns a Boolean value indicating whether the specified variable has been initialized. It returns True if the variable has not been initialized; otherwise, it returns False.

Syntax

IsEmpty(expression)

Parameters Description
expression Required. An expression (usually a variable name).

Examples

Examples

<script type="text/vbscript">

Dim x
document.write(IsEmpty(x) & "<br />")
x=10
document.write(IsEmpty(x) & "<br />")
x=Empty
document.write(IsEmpty(x) & "<br />")
x=Null
document.write(IsEmpty(x))

</script>

The output of the above example is:

True
False
True
False

Try it yourself »

VBScript 参考手册Complete VBScript Reference Manual Other Extensions