Revision history for ProPgControlFlow


Revision [21669]

Last edited on 2016-11-07 05:17:27 by fxm [Formatting]
Additions:







Revision [21205]

Edited on 2016-03-13 12:32:51 by fxm [Formatting]

No Differences

Revision [20630]

Edited on 2016-02-10 16:12:36 by DkLwikki [Update link format]
Additions:
Control flow statements control program execution from one statement to the next; they determine what statements get executed and when, based on some kind of condition. The condition is always some expression that evaluates to true or false. Most control flow statements check for some kind of condition, and direct code flow accordingly, that is, they do or do not execute a block of code (except for the transferring control flow statements and ##[[KeyPgDoloop|DO..LOOP]]##, which has an optional condition). Additionally, all control flow statements can be nested, that is, they can have other control flow statements within the statement block.
Unconditionally and temporarily transfers execution to another point in code, defined by a text label. Execution resumes with the first statement after the label. Execution is then brought back to its original location with the ##[[KeyPgReturn|RETURN]]## keyword. Yes, ##[[KeyPgGosub|GOSUB]]## statements can be nested, that is, multiple ##[[KeyPgGosub|GOSUB]]## statements can be executed before the first corresponding ##[[KeyPgReturn|RETURN]]##, but there must always be a corresponding ##[[KeyPgReturn|RETURN]]## throughout the course of an application.
Executes a block of statements if an expression evaluates to true (the condition). If and only if the expression evaluates to false, another statement block can be executed if yet another expression evaluates to true using the ##[[KeyPgElseif|ELSEIF]]## keyword. If and only if all of those expressions evaluate to false, a statement block can be execute using the ##[[KeyPgElse|ELSE]]## keyword.
Executes one of a number of statement blocks. This branching statement tries to meet a condition of an expression and one of a number of case expressions. The case expressions are checked in the order in which they are given, and the first case expression that is met has its associated statement block executed. Like ##[[KeyPgIfthen|IF..END IF]]##, a default case can be defined when no other case expression meets the condition, and, as with the looping control flow statements, a case's statement block can be prematurely broken out of with the ##[[KeyPgExit|EXIT]]## keyword.
These statements are used for executing a block of statements repeatedly. Within a statement block, the loop can be prematurely re-executed using the ##[[KeyPgContinue|CONTINUE]]## keyword, or broken out of using the ##[[KeyPgExit|EXIT]]## keyword. Whether the loop is terminated by the condition or with the ##[[KeyPgExit|EXIT]]## keyword, execution always begins at the first statement after the block.
Like ##[[KeyPgWhilewend|WHILE..WEND]]##, but more suited to loop a certain number of times. This loop initializes a so-called iterator with an initial value that is checked against a test expression. If the iterator compares less than or equal to the test expression (the condition), the block of statements is executed and the iterator gets incremented. The loop can also be setup so that the iterator gets decremented after every loop, in which case it is compared greater than or equal to the test expression. Iterators can be numeric data types like ##[[KeyPgInteger|INTEGER]]## or ##[[KeyPgSingle|DOUBLE]]##, or user-defined types. User-defined types must implement ##[[KeyPgOpFor|operator for]]##.
Deletions:
Control flow statements control program execution from one statement to the next; they determine what statements get executed and when, based on some kind of condition. The condition is always some expression that evaluates to true or false. Most control flow statements check for some kind of condition, and direct code flow accordingly, that is, they do or do not execute a block of code (except for the transferring control flow statements and ##[[KeyPgDoloop DO..LOOP]]##, which has an optional condition). Additionally, all control flow statements can be nested, that is, they can have other control flow statements within the statement block.
Unconditionally and temporarily transfers execution to another point in code, defined by a text label. Execution resumes with the first statement after the label. Execution is then brought back to its original location with the ##[[KeyPgReturn RETURN]]## keyword. Yes, ##[[KeyPgGosub GOSUB]]## statements can be nested, that is, multiple ##[[KeyPgGosub GOSUB]]## statements can be executed before the first corresponding ##[[KeyPgReturn RETURN]]##, but there must always be a corresponding ##[[KeyPgReturn RETURN]]## throughout the course of an application.
Executes a block of statements if an expression evaluates to true (the condition). If and only if the expression evaluates to false, another statement block can be executed if yet another expression evaluates to true using the ##[[KeyPgElseif ELSEIF]]## keyword. If and only if all of those expressions evaluate to false, a statement block can be execute using the ##[[KeyPgElse ELSE]]## keyword.
Executes one of a number of statement blocks. This branching statement tries to meet a condition of an expression and one of a number of case expressions. The case expressions are checked in the order in which they are given, and the first case expression that is met has its associated statement block executed. Like ##[[KeyPgIfthen IF..END IF]]##, a default case can be defined when no other case expression meets the condition, and, as with the looping control flow statements, a case's statement block can be prematurely broken out of with the ##[[KeyPgExit EXIT]]## keyword.
These statements are used for executing a block of statements repeatedly. Within a statement block, the loop can be prematurely re-executed using the ##[[KeyPgContinue CONTINUE]]## keyword, or broken out of using the ##[[KeyPgExit EXIT]]## keyword. Whether the loop is terminated by the condition or with the ##[[KeyPgExit EXIT]]## keyword, execution always begins at the first statement after the block.
Like ##[[KeyPgWhilewend WHILE..WEND]]##, but more suited to loop a certain number of times. This loop initializes a so-called iterator with an initial value that is checked against a test expression. If the iterator compares less than or equal to the test expression (the condition), the block of statements is executed and the iterator gets incremented. The loop can also be setup so that the iterator gets decremented after every loop, in which case it is compared greater than or equal to the test expression. Iterators can be numeric data types like ##[[KeyPgInteger INTEGER]]## or ##[[KeyPgSingle DOUBLE]]##, or user-defined types. User-defined types must implement ##[[KeyPgOpFor operator for]]##.


Revision [13272]

The oldest known version of this page was created on 2008-04-26 15:04:42 by JeffMarshall [Update link format]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode