' Visual Basic 2008 9.0 .NET Examples - Searching in Arrays - Arrays : Module Exercise1Solution Sub Main() Dim count As Integer = 3 Dim names() As String = {"Brussels", "Antwerp", "Ghent"} Dim zipCodes() As Integer = {1000, 2000, 9000} ' Console.WriteLine("Zip Code ?") Dim zipCode As String = Console.ReadLine() ' Dim found, exhausted As Boolean Dim index As Integer = -1 Do Until found OrElse exhausted index += 1 found = (zipCodes(index) = zipCode) exhausted = (index = count - 1) Loop ' If found Then Console.WriteLine(names(index)) Else Console.WriteLine("City not found.") End If ' Console.ReadLine() End Sub End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.