Revision history for KeyPgWhilewend


Revision [21187]

Last edited on 2016-03-13 11:53:10 by fxm [Formatting]
Additions:





Revision [20600]

Edited on 2016-02-10 16:10:57 by DkLwikki [Update link format]
Additions:
If an ##[[KeyPgExit|Exit]] **While**## statement is encountered inside the //statement block//, the loop is terminated, and execution resumes immediately following the enclosing ##**Wend**## statement. If a ##[[KeyPgContinue|Continue]] **While**## statement is encountered, the rest of the ##//statement block//## is skipped and execution resumes at the ##**While**## statement.
Like all control flow statements, the ##**While**## statement can be nested, that is, it can be used in a statement block of another ##[[KeyPgWhile|While]]## statement.
//**note**: the ##**While**## //keyword// is also used in the ##[[KeyPgDoloop|Do...Loop]]## statement to indicate the type of comparison. Used in this way, the ##**Do**## statement becomes functionally equivalent to the ##**While**## statement, so do not confuse their enclosing keywords ##Loop## and ##**Wend**##, respectively.//
- In the //[[CompilerOptlang|-lang qb]]// and //[[CompilerOptlang|-lang fblite]]// dialects, variables declared inside a ##**While**##..##**Wend**## loop have a function-wide [[ProPgVariableScope|scope]] as in QB
- In the //[[CompilerOptlang|-lang fb]]// and //[[CompilerOptlang|-lang deprecated]]// dialects, variables declared inside a ##**While**##..##**Wend**## block are visible only inside the block, and can't be accessed outside it.
- ##[[KeyPgExit|Exit]]##
- ##[[KeyPgContinue|Continue]]##
- ##[[KeyPgDoloop|Do...Loop]]##
Deletions:
If an ##[[KeyPgExit Exit]] **While**## statement is encountered inside the //statement block//, the loop is terminated, and execution resumes immediately following the enclosing ##**Wend**## statement. If a ##[[KeyPgContinue Continue]] **While**## statement is encountered, the rest of the ##//statement block//## is skipped and execution resumes at the ##**While**## statement.
Like all control flow statements, the ##**While**## statement can be nested, that is, it can be used in a statement block of another ##[[KeyPgWhile While]]## statement.
//**note**: the ##**While**## //keyword// is also used in the ##[[KeyPgDoloop Do...Loop]]## statement to indicate the type of comparison. Used in this way, the ##**Do**## statement becomes functionally equivalent to the ##**While**## statement, so do not confuse their enclosing keywords ##Loop## and ##**Wend**##, respectively.//
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, variables declared inside a ##**While**##..##**Wend**## loop have a function-wide [[ProPgVariableScope scope]] as in QB
- In the //[[CompilerOptlang -lang fb]]// and //[[CompilerOptlang -lang deprecated]]// dialects, variables declared inside a ##**While**##..##**Wend**## block are visible only inside the block, and can't be accessed outside it.
- ##[[KeyPgExit Exit]]##
- ##[[KeyPgContinue Continue]]##
- ##[[KeyPgDoloop Do...Loop]]##


Revision [17607]

Edited on 2015-04-25 00:12:30 by FxMwikki [Formatting]
Additions:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, variables declared inside a ##**While**##..##**Wend**## loop have a function-wide [[ProPgVariableScope scope]] as in QB
Deletions:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, variables declared inside a WHILE..WEND loop have a function-wide [[ProPgVariableScope scope]] as in QB


Revision [16895]

Edited on 2013-07-26 04:11:53 by FxMwikki [Corrected the incoherence on title ("WHILE" -> "WHILE...WEND")]
Additions:
{{fbdoc item="title" value="WHILE...WEND"}}----
Deletions:
{{fbdoc item="title" value="WHILE"}}----


Revision [15965]

Edited on 2012-02-02 13:02:16 by CountingPine [Formatting]
Additions:
The ##**While**## statement will cause the following set of statements in the ##//statement block//## to execute repeatedly if and while the expression //condition// evaluates to true.
If ##//condition//## evaluates to false when the ##**While**## statement is first executed, then the ##//statement block//## is skipped and execution resumes immediately following the enclosing ##**Wend**## statement.
If an ##[[KeyPgExit Exit]] **While**## statement is encountered inside the //statement block//, the loop is terminated, and execution resumes immediately following the enclosing ##**Wend**## statement. If a ##[[KeyPgContinue Continue]] **While**## statement is encountered, the rest of the ##//statement block//## is skipped and execution resumes at the ##**While**## statement.
//**note**: the ##**While**## //keyword// is also used in the ##[[KeyPgDoloop Do...Loop]]## statement to indicate the type of comparison. Used in this way, the ##**Do**## statement becomes functionally equivalent to the ##**While**## statement, so do not confuse their enclosing keywords ##Loop## and ##**Wend**##, respectively.//
In this example, a ##**While**## loop is used to reverse a string by iterating through it backward. The loop stops if index is less than ##0## //(##0## being the first index in the string)//.
Deletions:
The ##**While**## statement will cause the following set of statements in the //statement block// to execute repeatedly if and while the expression //condition// evaluates to true.
If //condition// evaluates to false when the WHILE statement is first executed, then the //statement block// is skipped and execution resumes immediately following the enclosing ##**Wend**## statement.
If an ##[[KeyPgExit Exit]]## ##**While**## statement is encountered inside the //statement block//, the loop is terminated, and execution resumes immediately following the enclosing ##**Wend**## statement. If a ##[[KeyPgContinue Continue]]## ##**While**## statement is encountered, the rest of the //statement block// is skipped and execution resumes at the ##**While**## statement.
//**note**: the ##**While**## //keyword// is also used in the ##[[KeyPgDoloop Do...Loop]]## statement to indicate the type of comparison. Used in this way, the DO statement becomes functionally equivalent to the WHILE statement, so do not confuse their enclosing keywords ##Loop## and ##**Wend**##, respectively.//
In this example, a ##**While**## loop is used to reverse a string by iterating through it backward. The loop stops if index is less than 0 //(0 being the first index in the string)//.


Revision [12775]

The oldest known version of this page was created on 2008-04-01 15:45:03 by JeffMarshall [Formatting]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode