51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2693|回复: 5
打印 上一主题 下一主题

如何实现WR的重复执行?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2006-9-1 10:04:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
重复的步骤能不能用FOR或者while语句循环?sdlkfj8
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2006-9-1 10:11:14 | 只看该作者
可以写循环语句
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2006-9-1 10:24:14 | 只看该作者
WR的循环语句的格式是怎样的?
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2006-9-1 11:08:43 | 只看该作者
Example

i = 1;
while (i < 21)
        type (i++);
types the value of i 20 times.
for ( [ expression1 ]; [ expression2 ]; [ expression3 ]; )
        statement

First, expression1 is implemented as the starting condition. While expression2 is true, the statement is executed, and expression3 is evaluated. The loop repeats until expression2 is found to be false. This statement is equivalent to:
expression1                                # state initial condition

while (expression2) {                        # while this is true
        statement                        # perform this statement and
        expression3                        # evaluate this expression
}

Example
The for loop below performs the same function as the while loop above.

for (i=1; i<21; i++)
        type (i);

Note that if expression2 is missing, it is always considered true, so that

for (i=1;;i++)
        type (i);
is an infinite loop.
do
        statement
while ( expression );

The statement is executed and then the expression is evaluated. If the expression is true, then the cycle is repeated. This statement differs from the while and for statements in that the expression is evaluated at the end. Therefore, the loop is always executed at least once.
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2006-9-1 19:04:58 | 只看该作者
循环语句嘛, 在所有的语言里都是大同小异的, WR 用的是C LIKE LANGUAGE, 所以WR 的循环语句和C 是一样的.
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2006-9-1 23:33:54 | 只看该作者
是阿,楼上的说得很对,tsl语法上很接近C的。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-22 04:06 , Processed in 0.076163 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表