Do-Whi1e loops do not have a direct correlation in the CFLOOPtag syntax. Rather, they, are a slight variation on the regular Whi1e loop. In many programming languages, While loops are known as Repeat-Unti 1 loops. The main difference between the While and the Whi1e loop is that the condition is moved to the end of the loop:
Translated to plain English, this becomes: “Continue to execute the statement until the express! n is false.” This is subtly different from the defirution of the Whi1e loop but it is an important difference: Because the Do-Wh;1e loop tests the expression at the end of the loop, even if the expression is false when the loop is first encountered, the statement will execute at least once.
Using Break and Continue
Sometimes, it is necessary to prematurely end a loop. This can be done with the Break statement. Used in the statement block of a loop, it causes the loop to end regardless of the . value of the index variable or the condition that normally regulates the flow of the loop. The Conti nue statement1is similar to Break. The Conti nue statement, when used in the statement block of a loop, causes the current iteration of the loop to end at the Continue statement and the loop to move on to its next iteration.
The final script statement to consider is the Sw; ch-Case statement. This corresponds to the use of CFSWITCH and CFCASE. The syntax of the Switch-Case statement is:
commenting Your Code
One-line comments start with two slashes and continue to the end of the line:
// This is a comment
Comments do not need to start at the beginning of the line. Instead, they can start after program code on, the line:
Statement:// This is a comment
This type of one-line comment is useful for placing short descriptions of code on the same line as the code itself. For instance, if you are assigning a value to a new variable, you can use a one-line comment to quickly describe the variable:
One-line comments are also useful for quickly commenting out a single line of code when debugging your scripts.