home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic .NET - Read Less - Learn More / Visual_Basic.NET_Read_Less_Learn_More_Richard_Bowman_Visual_2002.iso / Resources / Code / Ch4-WorkWithArrays / Module1.vb < prev   
Text File  |  2001-07-12  |  478b  |  20 lines

  1. Module Module1
  2.     
  3.     Sub Main()
  4.         Dim myArray() As String = {"Joe", "Sam", "Megan"}
  5.         Array.Sort(myArray)
  6.  
  7.         Dim name As String
  8.         For Each name In myArray
  9.             Console.WriteLine(name)
  10.         Next
  11.  
  12.         Dim index As Integer
  13.         index = Array.BinarySearch(myArray, "Megan")
  14.         Console.WriteLine("Item found at position " & index)
  15.         Console.ReadLine()  ' wait for user to press Enter
  16.  
  17.     End Sub
  18.  
  19. End Module
  20.