Monday, December 29, 2008

HOW TO CREATE ARRAY? WHAT IS REDIM?

How to Create Array in ASP?
<%
Dim arr(3)
Dim arr() 'without mentioning number of elements
%>
What is REDIM?

<%

Dim arr()

Now you want to insert a record

ReDim arr(0)

arr(0)="raja"

Now you know there is one more record
ReDim arr(1)

' this will create two elements.

' but the value in arr(0) will be lost

 


ReDim Preserve arr(1)

' this will create two elements.

' the value in arr(0) will be preserved

arr(1)="roja"

%>

No comments:

Post a Comment

Followers