<HTML>
<HEAD>
<TITLE>
Multi_Dim_Array</TITLE><SCRIPT LANGUAGE
="vbscript" RUNAT="Server">'declare a subroutine to display product info
Sub ProductInfo(Index)
'declare variable to be used in this sub
Dim iCtr
' Show product caption
Response.Write "<B>Shipping Data for Product No." & CStr(Index + 1) & "</B><P>"
'we want a line for each data item - use the constants
For iCtr = COUNTRY TO HAZARDS
Response.Write StrShippingData(Index,iCtr) & "<BR>"
Next
End Sub
</SCRIPT>
</HEAD>
<BODY BGCOLOR=
"white"><%
'declare the constants
Const COUNTRY = 0
Const WEIGHT = 1
Const HAZARDS = 2
Dim strShippingData(3,2) ' declare a multidimensional array
'assign values to the array
strShippingData(0,COUNTRY) = "Made in Finland"
strShippingData(1,COUNTRY) = "Made in Malawi"
strShippingData(2,COUNTRY) = "Made in USA"
strShippingData(3,COUNTRY) = "Made in Outer Mongolia"
StrShippingData(0,WEIGHT) = "Weight = 34 Kilos"
StrShippingData(1,WEIGHT) = "Weight = 17 Kilos"
strShippingData(2,WEIGHT) = "Weight = 10 Kilos"
strShippingData(3,WEIGHT) = "Weight = 15 Kilos"
strShippingData(0,HAZARDS) = "No Hazard"
StrShippingData(1,HAZARDS) = "Highly Inflammable"
strShippingData(2,HAZARDS) = "No Hazard"
strShippingData(3,HAZARDS) = "Highly Inflammable"
%>
<FONT FACE=
"ARIAL" SIZE=3><%
Dim iCtr
For iCtr = 0 to 3
%>
<A HREF=
MultiDim.asp?Product=<%=iCtr %> >Product <%=iCtr + 1 %></A><P><%
If Request.QueryString.Count > 0 Then
If CInt (Request.QueryString("Product")) = iCtr Then
ProductInfo CInt(Request.QueryString("Product"))
End If
End If
Response.Write "<P>"
Next
%>
</FONT>
</BODY>
</HTML>