//Visual Basic 2010 Lineair Zoeken in Arrays Arrays public class LinearSearch { void Main() { int @base = 2; int count = 10; int upperbound = (count - 1); int[] numbers = new int[0]; int index; this.numbers(index) = ((index + 1) * @base); int number; bool found = false; bool exhausted = false; index = -1; for (; (found || exhausted); ) { this.index += new System.EventHandler(1); found = (this.numbers(index) == number); exhausted = (index == upperbound); } if (found) { Console.Write(((number + " found at index ") + index)); } else { Console.Write((number + " not found")); } if (exhausted) { Console.WriteLine(", search exhausted"); } else { Console.WriteLine(", search not exhausted"); } Console.ReadLine(); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.