<%@ page import="diamondedge.asp.*,diamondedge.util.*,diamondedge.ado.*" %>
<%!
%>
<%
int i = 0;
int nColors = 0;
Variant[] aColors = null;
Variant[] aFixed = (Variant[]) VB.initArray( new Variant[4], Variant.class );
Asp.init( request, response, out );
%>
<%
// Declare a simple fixed size array
// Declare a dynamic (resizable) array
// Assign values to fixed size array
aFixed[0].set( "Fixed" );
aFixed[1].set( "Size" );
aFixed[2].set( "Array" );
// Allocate storage for the array
aColors = (Variant[]) VB.initArray( new Variant[15], Variant.class );
// Store values representing a simple color table
// to each of the elements
// [#FF0000]
aColors[0].set( "RED" );
// [#008000]
aColors[1].set( "GREEN" );
// [#0000FF]
aColors[2].set( "BLUE" );
// [#00FFFF]
aColors[3].set( "AQUA" );
// [#FFFF00]
aColors[4].set( "YELLOW" );
// [#FF00FF]
aColors[5].set( "FUCHSIA" );
// [#808080]
aColors[6].set( "GRAY" );
// [#00FF00]
aColors[7].set( "LIME" );
// [#800000]
aColors[8].set( "MAROON" );
// [#000080]
aColors[9].set( "NAVY" );
// [#808000]
aColors[10].set( "OLIVE" );
// [#800080]
aColors[11].set( "PURPLE" );
// [#C0C0C0]
aColors[12].set( "SILVER" );
// [#008080]
aColors[13].set( "TEAL" );
%>
<HTML>
<HEAD>
<TITLE>Array Sample</TITLE>
</HEAD>
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
<!-- Display Header -->
<FONT SIZE="4" FACE="Arial, Helvetica">
<B>Array Sample</B></FONT><BR>
<HR SIZE="1" COLOR="#000000">
<TABLE CELLPADDING=10 BORDER=1 CELLSPACING=0>
<TR>
<TD BGCOLOR=WHITE>
<FONT SIZE="3" FACE="Arial, Helvetica">
<B>A Resizable Array</B><br>
</FONT>
</TD>
<TD BGCOLOR=WHITE>
<FONT SIZE="3" FACE="Arial, Helvetica">
<B>A Fixed Size (4 element) Array</B><BR>
</FONT>
</TD>
</TR>
<TR>
<TD>
<%
// Calculate Array Size
nColors = (aColors.length-1);
// Print out contents of resizable array into
// table column
for( i = 0; i <= (nColors - 1); i++ )
{
out.print( "<FONT COLOR=" + String.valueOf( (char)(34) ) + aColors[i] + String.valueOf( (char)(34) ) + ">" + aColors[i] + "<br></FONT>" + System.getProperty("line.separator") );
}
%>
</TD>
<TD>
<%
// Calculate Array Size
nColors = (aFixed.length-1);
// Print out contents of fixed array into table
// column
for( i = 0; i <= (nColors - 1); i++ )
{
out.print( aFixed[i] + "<br> " );
}
%>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>