Define and use array in asp.net page (VB) : Array « Collections « ASP.NET Tutorial






<%@ Page Language="VB" %>

<script runat="server">
   dim arrColors(5) as String
   
   sub Page_Load(Sender as object, e as eventargs)
      arrColors(0) = "green"
      arrColors(1) = "red"
      arrColors(2) = "yellow"
      arrColors(3) = "blue"
      arrColors(4) = "violet"
      
      Response.Write("The first element is: ")
      Response.Write(arrColors(0) & "")
      
      Response.Write("The third element is: ")
      Response.Write(arrColors(2) & "")
      
      Response.Write("The 5-3 element is: ")
      Response.Write(arrColors(5-3) & "")
   end sub      
</script>

<html><body>

</body></html>








7.1.Array
7.1.1.Define and use array in asp.net page (VB)
7.1.2.Define and use array in asp.net page (C#)
7.1.3.Looking for an object in an array by reference (C#)
7.1.4.Looking for an object in an array by reference (VB)
7.1.5.Searching for a object in an array by reference (C#)
7.1.6.Searching for a object in an array by reference (VB)
7.1.7.Searching for an equivalent object with Array.BinarySearch (C#)
7.1.8.Searching for an equivalent object with Array.BinarySearch (VB)
7.1.9.Sorting arrays of Person (C#)
7.1.10.Sorting arrays of Person (VB)
7.1.11.Array with custom objects
7.1.12.Array binding