WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE
IsArray function returns a Boolean value that indicates whether
a specified variable is an array. If the variable is an array,
it returns True, otherwise, it returns False. The IsArray function
checks for the existence of the string passed in the array collection.
Returns True if the string value or exists and False if it does not
exist. The notation used to refer to an element of an array consists
of the variable name followed by parentheses containing an index number
indicating the desired element. In the example, the first statement
creates a variable named A. The second statement assigns an array
to variable A. The last statement assigns the value contained in the
second array element to another variable. The Array function is
used to create a static one-dimension array. You cannot declare
a dynamic array using the Array function.
Note :- The first element in an array is always labeled zero,
for example, myarray(0). The List argument is a listing of values
that will become the elements of the array
The Syntax of the IsArray function is :-
Example#1 :-
Code :-
dim a(5)
a(0)="Saturday"
a(1)="Sunday"
a(2)="Monday"
a(3)="Tuesday"
a(4)="Wednesday"
document.write(IsArray(a))
Output :-
True |
Example#2 :-
Code :-
dim a
a="Saturday"
document.write(IsArray(a))
Output :-
False |
It can also be explained like this :-
Example#3 :-
Code :-
<% myarray = array("A", "B", "C",
"D") %>
<% =myarray(0) %>
<% =myarray(1) %>
<% =myarray(2) %>
<% =myarray(3) %>
Output :-
A
B
C
D |
Example#4 :-
Code :-
<% myarray = array(111, 222, 333, 444, 555) %>
<% =myarray(0) %>
<% =myarray(1) %>
<% =myarray(2) %>
<% =myarray(3) %>
<% =myarray(4) %>
Output :-
111
222
333
444
555
|
|