51Testing软件测试论坛

标题: 如何实现WR的重复执行? [打印本页]

作者: 镭镭    时间: 2006-9-1 10:04
标题: 如何实现WR的重复执行?
重复的步骤能不能用FOR或者while语句循环?sdlkfj8
作者: xiaofang1004    时间: 2006-9-1 10:11
可以写循环语句
作者: 镭镭    时间: 2006-9-1 10:24
WR的循环语句的格式是怎样的?
作者: xiaofang1004    时间: 2006-9-1 11:08
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.
作者: 小李美刀    时间: 2006-9-1 19:04
循环语句嘛, 在所有的语言里都是大同小异的, WR 用的是C LIKE LANGUAGE, 所以WR 的循环语句和C 是一样的.
作者: wenlaqing    时间: 2006-9-1 23:33
是阿,楼上的说得很对,tsl语法上很接近C的。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2