All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
[delphi语法6]delphi中Repeat语句的使用实例

Writer: aaa Article type: Programming skills(编程技巧) Time: 2014/7/19 0:14:15 Browse times: 498 Comment times: 0

[delphi语法6]delphi中Repeat语句的使用实例


Head photo

Go homepage
Upload pictures
Write articles

[delphi语法6]delphi中Repeat语句的使用实例|方法

Repeat 语句
Repeat 语句会重复执行一行或多行语句,直到某一状态为真。语句以Repeat 开始,以Until 结束,
其后跟随被判断的布尔表达式。结构如下:
repeat
<语句>
until <条件表达式>
例如:
I:=0;
repeat
I:=I+1;
Writeln(IntToStr(I));
until I>5;
执行以上的例子时,会显示1~6 的数字。布尔表达式I>5 直到Repeat?Until 程序段结束才会被
计算,也就是Repeat 语句至少要执行一次。





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.