|
Contents | Previous | Next | Subchapters |
| Syntax |
begin statement list end
|
| See Also | if , for , while |
If you enter
if 2 > 1 then begin
x = 1
y = 2
x + y
end
O-Matrix will respond
3
Entering
x = -1
if x < 0 then begin
x
"negative"
end else begin
x
"positive"
end
will result in
-1
negative
Blocks can be used to create an arbitrary number of branches, or
multi-way if-then-else. For example, if in an editor
window you enter.
x = 0
if x < 0 then begin
"negative"
end else if x > 0 then begin
"positive"
end else begin
"zero"
end
and select 'File | Run' from the menu, O-Matrix will respond
zero