An Active Server Pages Tutorial, Part 2

We conclude our tutorial on working with ASP by looking at Boolean functions, sessions and cookies, text files, and accessing databases.

provided by: 
Originally published at Internet.com


Review Part 1

Session 6

Boolean Functions in VBScript and Their Application in ASP

Function Description VBScript ASP IsArray Determines whether a variable is an array or not.
Dim x(10) document.write(IsArray(x)) Returns true Dim x document.write(IsArray(x)) Returns false

<% Dim x(10) Response.write(IsArray(x)) Returns true Dim x document.write(IsArray(x)) Returns false %> IsDate

Determines whether a variable is a valid date or not. Dim x
x = "12/10/00"
document.write(IsDate(x))
Returns true
x = "555"
document.write(IsDate(x))
Returns false

<%
Dim x
x = "12/10/00"
Response.write(IsDate(x))
Returns true
x = "555"
document.write(IsDate(x))
Returns false
%>

IsEmpty Determines whether a variable has been initialized. Variables are empty when you declare them or explicitly set them to empty <%
Dim x
document.write(IsEmpty(x)) Returns true
x = "12/15/00"
document.write(IsEmpty(x)) Returns false
x = Empty
document.write(IsEmpty(x)) Returns true
%>

<%
Dim x
Response.write(IsEmpty(x)) Returns true
x = "12/15/00"
Response.write(IsEmpty(x)) Returns false
x = Empty
Response.write(IsEmpty(x)) Returns true
%>

IsNull

Determines whether a variable is null or not Dim x
document.write(IsNull(x)) Returns false
x = Empty
document.write(IsNull(x)) Returns false
x = Null
document.write(IsNull(x)) Returns true <%
Dim x
Response.write(IsNull(x)) Returns false
x = Empty
Response.write(IsNull(x)) Returns false
x = Null
Response.write(IsNull(x)) Returns true
%>

IsNumeric Returns true if the variable can be evaluated as a number

Dim x, y
x = 20
document.write(IsNumeric(x)) Returns true
y= "Hello"
document.write(IsNumeric(x)) Returns false <%
Dim x, y
x = 20
Response.write(IsNumeric(x)) Returns true
y= "Hello"
Response.write(IsNumeric(x)) Returns false
%>

Author: Anand Narayanaswamy

Read article at Internet.com site
Related Articles
Regional Articles
- An Active Server Pages Tutorial, Part 2 Alabama
- An Active Server Pages Tutorial, Part 2 Alaska
- An Active Server Pages Tutorial, Part 2 Arizona
- An Active Server Pages Tutorial, Part 2 Arkansas
- An Active Server Pages Tutorial, Part 2 California
- An Active Server Pages Tutorial, Part 2 Colorado
- An Active Server Pages Tutorial, Part 2 Connecticut
- An Active Server Pages Tutorial, Part 2 DC
- An Active Server Pages Tutorial, Part 2 Delaware
- An Active Server Pages Tutorial, Part 2 Florida
- An Active Server Pages Tutorial, Part 2 Georgia
- An Active Server Pages Tutorial, Part 2 Hawaii
- An Active Server Pages Tutorial, Part 2 Idaho
- An Active Server Pages Tutorial, Part 2 Illinois
- An Active Server Pages Tutorial, Part 2 Indiana
- An Active Server Pages Tutorial, Part 2 Iowa
- An Active Server Pages Tutorial, Part 2 Kansas
- An Active Server Pages Tutorial, Part 2 Kentucky
- An Active Server Pages Tutorial, Part 2 Louisiana
- An Active Server Pages Tutorial, Part 2 Maine
- An Active Server Pages Tutorial, Part 2 Maryland
- An Active Server Pages Tutorial, Part 2 Massachusetts
- An Active Server Pages Tutorial, Part 2 Michigan
- An Active Server Pages Tutorial, Part 2 Minnesota
- An Active Server Pages Tutorial, Part 2 Mississippi
- An Active Server Pages Tutorial, Part 2 Missouri
- An Active Server Pages Tutorial, Part 2 Montana
- An Active Server Pages Tutorial, Part 2 Nebraska
- An Active Server Pages Tutorial, Part 2 Nevada
- An Active Server Pages Tutorial, Part 2 New Hampshire
- An Active Server Pages Tutorial, Part 2 New Jersey
- An Active Server Pages Tutorial, Part 2 New Mexico
- An Active Server Pages Tutorial, Part 2 New York
- An Active Server Pages Tutorial, Part 2 North Carolina
- An Active Server Pages Tutorial, Part 2 North Dakota
- An Active Server Pages Tutorial, Part 2 Ohio
- An Active Server Pages Tutorial, Part 2 Oklahoma
- An Active Server Pages Tutorial, Part 2 Oregon
- An Active Server Pages Tutorial, Part 2 Pennsylvania
- An Active Server Pages Tutorial, Part 2 Rhode Island
- An Active Server Pages Tutorial, Part 2 South Carolina
- An Active Server Pages Tutorial, Part 2 South Dakota
- An Active Server Pages Tutorial, Part 2 Tennessee
- An Active Server Pages Tutorial, Part 2 Texas
- An Active Server Pages Tutorial, Part 2 Utah
- An Active Server Pages Tutorial, Part 2 Vermont
- An Active Server Pages Tutorial, Part 2 Virginia
- An Active Server Pages Tutorial, Part 2 Washington
- An Active Server Pages Tutorial, Part 2 West Virginia
- An Active Server Pages Tutorial, Part 2 Wisconsin
- An Active Server Pages Tutorial, Part 2 Wyoming
Related Articles

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML