CHAPTER 7 ITERATIVE PROCESSING The For Next loop (Personal web server)
Tuesday, June 10th, 2008CHAPTER 7 ITERATIVE PROCESSING The For Next loop is flexible. If you want, you can use the Step keyword to change the value used to increment the counter variable as the following shows. For I As Integer = 1 to 100 Step 10 ProgressBar1.Value = ProgressBar1.Value + 1 Next As you can see, this example increases the value of the ProgressBar control s Value property by 10 (10 percent) on each iteration. If you need to, you can decrement the value of the counter variable, as you see in the following. For this example to work effectively, you must set the ProgressBar control s value property to 100. For I As Integer = 100 DownTo 1 ProgressBar1.Value = ProgressBar1.Value - 1 Next Note Because of the manner is which REALbasic compiles code statements, the For Next, and For Each loops are typically more efficient than the Do Loop. Do Until, and While Wend loops in terms of resources consumed (memory and processor time) by your application. The For Each Loop The For Each loop is designed to automatically process each element stored in a single- dimension array. The syntax for the For Each loop is outlined in the following: For Each element [As DataType] In array statements Next Element is a variable used to represent an item stored in an array; DataType is optional. When used, it specifies the data type of the data stored in the array.
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.