CHAPTER 7 ITERATIVE PROCESSING Note The preceding (Web hosting top)
CHAPTER 7 ITERATIVE PROCESSING Note The preceding example controlled when line breaks occurred in output by referencing an EndOfLine object. EndOfLine provides access to properties representing end-of-line markers on Macintosh, Windows, and Linux. You learn more about REALbasic classes later in Chapter 8. Figure 7-4 shows the output that is produced when this example is executed on a computer running Windows. Note, if the value of intCounter is greater than ten to start with, then the While Wend loop and all the statements contained within it are skipped. Figure 7-4. Using a While Wend loop to populate an EditField control, as seen on Windows The For Next Loop The For…Next loop is designed for situations in which you know exactly how many times a loop must execute. For Next loops use a variable to keep track of loop execution to determine when the loop should cease execution. The value of the loop variable, or counter, can be increased or decreased, as appropriate during loop execution. The following outlines the syntax of the For…Next loop. For counter [As DataType] = start To | DownTo end [Step Value] Statements Next [counter] Counter is a local variable used to control loop execution. DataType is an optional parameter that provides you with the capability to declare the counter will be within the loop. If DataType is omitted, you must remember to declare the counter variable elsewhere within your code statements. Start sets the beginning value of the counter variable. End sets its ending value (for example, the value, which when reached, terminates the loop s execution). Value is an optional keyword. When used, it specifies the value to be used to increment or decrement the value of the counter variable as the loop processes. By default, the counter variable is automatically incremented by one on each iteration of a For Next loop. However, by specifying
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.