18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> <strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong><br />

IsEmpty<br />

Description Returns a Boolean value indicating whether a variable has been initialized.<br />

Usage boolVal = IsEmpty(expression)<br />

Arguments expression<br />

The expression argument can be any valid expression. However, because IsEmpty is used<br />

to determine if individual variables are initialized, the expression argument is most often a<br />

single variable name.<br />

Return A Boolean value<br />

Remarks IsEmpty returns True if the variable is uninitialized, or is explicitly set to Empty; otherwise, it<br />

returns False. False is always returned if expression contains more than one variable. If two or<br />

more variables are concatenated in expression and one of them is set to Empty, the IsEmpty<br />

function will return False since the expression is not empty.<br />

See Also IsArray, IsDate, IsNull, IsNumeric, IsObject, VarType<br />

Example The following examples uses the IsEmpty function to determine whether a variable has been<br />

initialized:<br />

Dim MyVar, MyCheck<br />

MyCheck = IsEmpty(MyVar) ' Returns True.<br />

MyVar = Null ' Assign Null.<br />

MyCheck = IsEmpty(MyVar) ' Returns False.<br />

MyVar = Empty ' Assign Empty.<br />

MyCheck = IsEmpty(MyVar) ' Returns True.<br />

IsNull<br />

Description Returns a Boolean value that indicates whether an expression contains no valid data (Null).<br />

Usage boolVal = IsNull(expression)<br />

Arguments expression<br />

The expression argument can be any valid expression.<br />

Return A Boolean value<br />

Remarks IsNull returns True if expression evaluates to Null, that is, it contains no valid data; otherwise,<br />

IsNull returns False. The Null value indicates that the variable contains no valid data. Null is not<br />

the same as Empty, which indicates that a variable has not yet been initialized. It is also not the<br />

same as a zero-length string (""), which is sometimes referred to as a null string.<br />

You should always use the IsNull function when checking <strong>for</strong> Null values since using the normal<br />

operators will return False even if one variable is Null. For example, expressions that you might<br />

expect to evaluate to True under some circumstances, such as If Var = Null and If Var Null,<br />

are always False. This is because any expression containing a Null is itself Null, and there<strong>for</strong>e,<br />

False.<br />

See Also IsArray, IsDate, IsEmpty, IsNumeric, IsObject, VarType<br />

Example The following example uses the IsNull function to determine whether a variable contains a Null:<br />

Dim MyVar, MyCheck<br />

MyCheck = IsNull(MyVar) ' Returns False.<br />

MyVar = Null ' Assign Null.<br />

MyCheck = IsNull(MyVar) ' Returns True.<br />

MyVar = Empty ' Assign Empty.<br />

MyCheck = IsNull(MyVar) ' Returns False.<br />

<strong>InduSoft</strong>, Ltd. 143

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!