Revision history for KeyPgDoloop


Revision [20908]

Last edited on 2016-03-12 17:02:38 by fxm [Formatting]
Additions:





Revision [20204]

Edited on 2016-02-10 15:59:15 by DkLwikki [Update link format]
Additions:
If an ##[[KeyPgExit|Exit]]## ##**Do**## statement is encountered inside the //##statement block##//, the loop is terminated, and execution resumes immediately following the enclosing ##**Loop**## statement. If a ##[[KeyPgContinue|Continue]]## ##**Do**## statement is encountered, the rest of the //##statement block##// is skipped and execution resumes at the ##**Do**## statement.
Here, an infinite DO loop is used to count the total number of evens. We place the conditional check inside the loop via an ##[[KeyPgIfthen|If...Then]]## statement, which exits the loop if and when //##n > 10##// becomes true:
- In the //[[CompilerOptlang|-lang qb]]// and //[[CompilerOptlang|-lang fblite]]// dialects, variables declared inside a ##**Do**##..##**Loop**## block have a function-wide [[ProPgVariableScope|scope]] as in QB
- In the //[[CompilerOptlang|-lang fb]]// and //[[CompilerOptlang|-lang deprecated]]// dialects, variables declared inside a ##**Do**##..##**Loop**## block are visible only inside the block, and can't be accessed outside it.
- ##[[KeyPgContinue|Continue]]##
- ##[[KeyPgExit|Exit]]##
- ##[[KeyPgFornext|For...Next]]##
- ##[[KeyPgWhilewend|While...Wend]]##
Deletions:
If an ##[[KeyPgExit Exit]]## ##**Do**## statement is encountered inside the //##statement block##//, the loop is terminated, and execution resumes immediately following the enclosing ##**Loop**## statement. If a ##[[KeyPgContinue Continue]]## ##**Do**## statement is encountered, the rest of the //##statement block##// is skipped and execution resumes at the ##**Do**## statement.
Here, an infinite DO loop is used to count the total number of evens. We place the conditional check inside the loop via an ##[[KeyPgIfthen If...Then]]## statement, which exits the loop if and when //##n > 10##// becomes true:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, variables declared inside a ##**Do**##..##**Loop**## block have a function-wide [[ProPgVariableScope scope]] as in QB
- In the //[[CompilerOptlang -lang fb]]// and //[[CompilerOptlang -lang deprecated]]// dialects, variables declared inside a ##**Do**##..##**Loop**## block are visible only inside the block, and can't be accessed outside it.
- ##[[KeyPgContinue Continue]]##
- ##[[KeyPgExit Exit]]##
- ##[[KeyPgFornext For...Next]]##
- ##[[KeyPgWhilewend While...Wend]]##


Revision [17608]

Edited on 2015-04-25 00:17:27 by FxMwikki [Typo and formatting]
Additions:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, variables declared inside a ##**Do**##..##**Loop**## block have a function-wide [[ProPgVariableScope scope]] as in QB
- In the //[[CompilerOptlang -lang fb]]// and //[[CompilerOptlang -lang deprecated]]// dialects, variables declared inside a ##**Do**##..##**Loop**## block are visible only inside the block, and can't be accessed outside it.
Deletions:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, variables declared inside a DO..LOOP block have a function-wide [[ProPgVariableScope scope]] as in QB
- In the //[[CompilerOptlang -lang fb]]// and //[[CompilerOptlang -lang deprecated]]// dialects, variables declared inside a FOR..NEXT block are visible only inside the block, and can't be accessed outside it.


Revision [16246]

Edited on 2012-08-11 19:17:06 by CountingPine [it's -> its]
Additions:
In this example, a ##**Do**## loop is used to count the total number of odd numbers from 1 to 10. It will repeat ##//until//## its ##//n > 10//## condition is met:
Deletions:
In this example, a ##**Do**## loop is used to count the total number of odd numbers from 1 to 10. It will repeat //until// it's //n > 10// condition is met:


Revision [15839]

Edited on 2012-01-25 14:38:50 by CountingPine [Formatting]
Additions:
The ##**Do**## statement executes the statements in the following //##statement block##// until/while the //##condition##//, if any, evaluates to true.
If ##**Until**## is used, the ##**Do**## statement stops repetition of the //##statement block##// when //##condition##// evaluates to true. The ##**While**## keyword has opposite effect, stopping the loop if //condition// evaluates to false. If both //##condition##// and either ##**Until**## or ##**While**## are omitted, the ##**Do**## statement loops indefinitely.
If an ##[[KeyPgExit Exit]]## ##**Do**## statement is encountered inside the //##statement block##//, the loop is terminated, and execution resumes immediately following the enclosing ##**Loop**## statement. If a ##[[KeyPgContinue Continue]]## ##**Do**## statement is encountered, the rest of the //##statement block##// is skipped and execution resumes at the ##**Do**## statement.
In the first syntax, the //##condition##// is checked when the ##**Do**## statement is first encountered, and if the //##condition##// is met, the //##statement block##// will be skipped. In the second syntax, //##condition##// is initially checked //after// the //##statement block##// is executed. This means that the //##statement block##// is always guaranteed to execute //at least// once.
//##condition##// may be any valid expression that evaluates to False (zero) or True (non-zero).
Here, an infinite DO loop is used to count the total number of evens. We place the conditional check inside the loop via an ##[[KeyPgIfthen If...Then]]## statement, which exits the loop if and when //##n > 10##// becomes true:
Deletions:
The ##**Do**## statement executes the statements in the following //statement block// until/while the //condition//, if any, evaluates to true.
If ##**Until**## is used, the ##**Do**## statement stops repetition of the //statement block// when //condition// evaluates to true. The ##**While**## keyword has opposite effect, stopping the loop if //condition// evaluates to false. If both //condition// and either ##**Until**## or ##**While**## are omitted, the ##**Do**## statement loops indefinitely.
If an ##[[KeyPgExit Exit]]## ##**Do**## statement is encountered inside the //statement block//, the loop is terminated, and execution resumes immediately following the enclosing ##**Loop**## statement. If a ##[[KeyPgContinue Continue]]## ##**Do**## statement is encountered, the rest of the //statement block// is skipped and execution resumes at the ##**Do**## statement.
In the first syntax, the //condition// is checked when the ##**Do**## statement is first encountered, and if the //condition// is met, the //statement block// will be skipped. In the second syntax, //condition// is initially checked //after// the //statement block// is executed. This means that the //statement block// is always guaranteed to execute //at least// once.
//condition// may be any valid expression that evaluates to False (zero) or True (non-zero).
Here, an infinite DO loop is used to count the total number of evens. We place the conditional check inside the loop via an ##[[KeyPgIfthen If...Then]]## statement, which exits the loop if and when //n > 10// becomes true:


Revision [12836]

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



sf.net phatcode