Web hosting faq - 188 CHAPTER 7 ITERATIVE PROCESSING The following
188 CHAPTER 7 ITERATIVE PROCESSING The following list identifies the different types of loops that REALbasic supports: Do…Loop. Creates a loop that iterates until terminated by an Exit statement. For…Next. Creates a loop that iterates a set number of times. For Each. Creates a loop that iterates through every element stored in an array. While Wend. Creates a loop that iterates as long as a specified Boolean condition remains True. Each of these different types of loops is examined further in the following sections. In addition, this chapter also teaches you how to work with a number of new controls as you work your way through the following loop examples. Do Loop The Do Loop is the simplest type of loop supported by REALbasic. It supports a number of different variations. In its simplest form, the Do Loop executes without checking for a predefined condition, using the following syntax. Do Statements Loop Do is a keyword identifying the beginning of the loop. Statements is a placeholder representing code statements you embed inside the loop for repeated execution. Loop is a keyword that identifies the end of the loop. To get a good idea of how to work with this format or the Do Loop, consider the following example. Dim intCounter As Integer = 0 Do intCounter = intCounter + 1 ListBox1.AddRow Str(intCounter) If intCounter = 10 Then Exit End If Loop This example begins by declaring a variable named intCounter with a data type of Integer and an initial value of zero. Next, a Do Loop is set up that loads a list of numbers (1 10) into a ListBox control. The Do Loop increments the value of counter by 1 each time the loop iterates. The ListBox control s AddRowmethod is used to add a number to the ListBox control. Note, the number added is stored in the intCounter variable. This variable has a data type of integer, so it must be converted to a string before it can be added to the ListBox control.
If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.