%@ LANGUAGE = JScript %> <% //Declare a simple fixed-size array. aFixed = new Array(4); //Declare a dynamic (resizable) array. aColors = new Array(); //Assign values to fixed-size array. aFixed[0] = "Fixed"; aFixed[1] = "Size"; aFixed[2] = "Array"; aFixed[3] = "Session ID: " + Session.SessionID; //Store values representing a simple color table //to each of the elements. aColors[0] = "RED"; aColors[1] = "GREEN"; aColors[2] = "BLUE"; aColors[3] = "AQUA"; aColors[4] = "YELLOW"; aColors[5] = "FUCHSIA"; aColors[6] = "GRAY"; aColors[7] = "LIME"; aColors[8] = "MAROON"; aColors[9] = "NAVY"; aColors[10] = "OLIVE"; aColors[11] = "PURPLE"; aColors[12] = "SILVER"; aColors[13] = "TEAL"; %>
A Resizable Array |
A Fixed Size (4 element) Array |
<%
//Get Array Size.
intColors = aColors.length;
//Print out contents of resizable array
//into table column.
for(i = 0; i < intColors; i++)
{
Response.Write("" + aColors[i] + " "); } %> |
<%
//Get Array Size.
intColors = aFixed.length;
//Print out contents of fixed array into
//table column.
for(i = 0; i < intColors; i++)
{
Response.Write(aFixed[i] + " "); } %> |