||
说明:作者只是提纲挈领的总结简单语句,起提示作用。详细语法需参考帮助文档。本人也是现用现学,总结不完善,部分内容也可能来自网络,请围观者指正。
一、if语句
1.单分支:
格式:
1.1 if 条件 then 语句
1.2 if 条件 then begin
语句
endif
2.双分支:
2.1 if 条件 then 语句 else 语句
2.2 if 条件 then begin
语句
endif else begin
语句
endelse ;注意是endelse不是endif
3.多分支:
if 条件 then begin
语句
endif else if 条件 then begin
语句
endif else if 条件 then begin
语句
endif else begin
语句
endelse
二、for语句
Syntax :
FOR variable = init, limit [, Increment] DO statement
or
FOR variable = init, limit [, Increment] DO BEGIN
statements
ENDFOR
三、while
WHILE expression DO statement
or
WHILE expression DO BEGIN
statements
ENDWHILE
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-5-29 19:41
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社