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

 
[delphi语法8]delphi中For语句的使用实例

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

[delphi语法8]delphi中For语句的使用实例


Head photo

Go homepage
Upload pictures
Write articles

[delphi语法8]delphi中For语句的使用实例|方法

For 语句
For 语句内的程序代码会执行一定的次数。它需要一个循环变量来控制循环次数。循环变量的类型可以是整型、布尔型、字符型、枚举型或子界型。结构如下:
for <条件表达式> do
begin
<语句>
end;
下面的例子将显示1~5 的数字:
for I:=1 to 5 do
begin
Writeln(IntToStr(I));
end;
而下面的例子将显示5~1 的数字:
for I:=5 downto 1 do
begin
Writeln(IntToStr(I));
end;





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.