Learn the judgment functions we use frequently when using ASP

Source: Internet
Author: User
Tags date array contains empty expression range valid
Function

<1>isarray function
Returns a Boolean value that indicates whether a variable is an array.

Grammar
IsArray (varname)
The varname parameter can be any variable.

Description
If the variable is an array, the IsArray function returns TRUE, otherwise the function returns FALSE. Using the IsArray function works well when a variable contains an array.

<2>isdate function
Returns a Boolean value that indicates whether an expression can be converted to a date.

Grammar
IsDate (expression)
The expression parameter can be any date expression or string expression that can be recognized as a date and time.

Description
The IsDate function returns True if the expression is a date or can be legitimately converted to a valid date, otherwise the function returns FALSE. Valid date range in Microsoft Windows operating system A.D. January 1, 100 to A.D. December 31, 9999; The legal date range varies depending on the operating system.

<3>isempty function
Returns a Boolean value that indicates whether the variable has been initialized.

Grammar
IsEmpty (expression)
The expression parameter can be any expression. However, because IsEmpty is used to determine whether a variable has been initialized, the expression argument is often a variable name.

Description
If the variable is uninitialized or explicitly set to Empty, the function isempty returns True; otherwise, the function returns FALSE. If expression contains more than one variable, the total returns FALSE.

<4>isnull function
Returns a Boolean value that indicates whether the expression does not contain any valid data (Null).

Grammar
IsNull (expression)
The expression parameter can be any expression.

Description
If expression is Null, IsNull returns True, that is, the expression does not contain valid data, or the IsNull returns FALSE. If expression is composed of multiple variables, Null in any constituent variable of the expression will return True for the entire expression.
A Null value indicates that the variable does not contain valid data. Null differs from Empty, which indicates that the variable was uninitialized. Null is also different from a 0-length string (""), and a 0-length string often refers to an empty string.

Focus on using the IsNull function to determine whether an expression contains a Null value. In some cases, you want the expression to be value True, such as Ifvar=null and Ifvar<>null, but they are usually always False. This is because any expression containing a null itself is null, so the expression evaluates to False.

<5>isnumeric function
Returns a Boolean value that indicates whether the expression's value is a number.

Grammar
IsNumeric (expression)
The expression parameter can be any expression.

Description
If the entire expression is recognized as a number, the IsNumeric function returns True; otherwise, the function returns FALSE.
If expression is a date expression, the IsNumeric function returns FALSE.

<6>isobject function
Returns a Boolean value that indicates whether the expression refers to a valid Automation object.

Grammar
IsObject (expression)
The expression parameter can be any expression.

Description
IsObject returns True If expression is an object subtype variable or user-defined object, otherwise the function returns FALSE.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.