注释
1.{}括号内注释
2.//行注释
3.(* *)符号内注释
with语句
with 对象 do
begin
语句
end;
if语句
1.if…then
2.if…then…else
if语句可以嵌套使用,当if需要跟复合语句时,语句需要用begin和end包括
例如:
if x >= y then
begin
z:=x;
Count := Count+1;
end
else
if Count = Last then
Done := True;
else
Exit;
case语句
case 选择表达式 of
value1: 语句1;
value2: 语句2;
...
valuen: 语句n;
else
语句n+1;
end;
while语句
while 条件表达式 do
循环体;
repeat语句
repeat
循环体
until 条件表达式;
//相当于c/c++的
do{
} while()
for语句
for 循环变量 = 初值 downto 终值 do
循环体;
for 循环变量 = 初值 to 终值 do
循环体;