case MyColor of
Red: X := 1;
Green: X := 2;
Blue: X = 3;
Yellow, Orange, Black: X := 0;
end;
case Selection of
Done: Form1.Close;
Compute: calculateTotal(UnitCost, Quantity);
else
Beep;
end;
Control Loops
Loops allow you to execute a sequence of statements repeatedly, using a control condition or variable to determine
when the execution stops. Delphi has three kinds of control loop: repeat statements, while statements, and for
statements.
You can use the standard
Break
and
Continue
procedures to control the flow of a repeat, while, or for statement.
Break
terminates the statement in which it occurs, while
Continue
begins executing the next iteration of the
sequence.
Dostları ilə paylaş: