
The on statement is used to test a condition after the execution of each "go" statement. If the condition is true, a set of specified actions will be taken. An "on" block is a declaration, and is not executable. The format of an "on" block is given below.
<label>: on <expression>
<arbitrary statements>
endon
The Windows version of FHDL permits labels for on statements.
The "on" statement acts as if it were an if statement that followed every "go" statement. When the expression evaluates to true (non zero) the statements between the on and the endon statements are executed. The on conditions are tested before updates due to clock and count statements are performed.
The "deactivate" statement may be used to disable an "on" block. The format of the deactivate statement is given below.
deactivate <on block label>
When a deactivate statement is executed, checking of the "on" block's condition is suspended, and the statements between the "on" and the "endon" statements will not be executed regardless of the value of the expression.
The "activate" statement may be used to negate the effect of a previous "deactivate" statement. Its format is given below.
activate <on block label>
The label of the "on" statement is optional if "activate" and "deactivate" statements are not used.
The initial state of all "on" blocks is "activated". A deactivate statement may be used to deactivate the on block before the first "go" statement. It is also possible to define an "on" block that is initially deactivated by replacing the "on" keyword with the "xon" keyword as illustrated below. An "xon" block may be terminated with either an "endon" statment or an "endxon" statement.
<label>: xon <expression>
<arbitrary statements>
endon