190 CHAPTER 7 (Best web design) ITERATIVE PROCESSING Using the
190 CHAPTER 7 ITERATIVE PROCESSING Using the Until keyword, you can set up two different forms of the Do Loop. The following shows the syntax for the first form. Do Until condition Statements Loop Condition is a Boolean expression that must evaluate to True for the loop to stop executing. Statements is a placeholder that represents the code statements you want executed when the loop executes. To see how this form of the Do Loop works, consider the following example. Dim intCounter As Integer = 1 Do Until intCounter > 10 ComboBox1.AddRow Str(intCounter) intCounter = intCounter + 1 Loop This example begins by declaring a variable named intCounter with a data type of integer and an initial value of one. Next, a Do Loop is set up that loads a list of numbers (1 10) into a ComboBox control, using the control s AddRow method. Because the initial value of intCounter is equal to one and is incremented by one on each iteration of the loop, the loop executes ten times before terminating its own execution. Figure 7-2 shows the output produced when this example is executed on a computer running Linux. Figure 7-2. Using a Do Loop to populate a ComboBox, as seen on Linux
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.