Loadrunner中的FOR,WHILE,DO 循环语句

2011-11-25  付民 

#include "as_web.h"
 
int i;
 
int whileloop = 1;
 
Action()
 
{
 
        //FOR 循环
 
        for (i=1;i<=10;i++)
 
                {
 
                lr_output_message( "FOR循环次数: %d", i);
 
                }
        // WHILE 循环
 
        //为了实现上面FOR循环相同效果,这里略复杂点,用到了 && 运算
 
        i=1;
 
        while ((i <= 10) && (whileloop ==1))
                {
 
                lr_output_message( "WHILE FOR循环次数:%d", i);
 
                i++;
 
                }
 

        //DO WHILE 循环
 
        //为了实现上面FOR循环相同效果,这里略复杂点,用到了 && 运算
        i=1;
 
        do {
 
                        lr_output_message( "DO WHILE 循环次数:%d", i);
 
                i++;
 
                }
        while (i <= 10) ;
 
return 0;
}
987°/9871 人阅读/0 条评论 发表评论

登录 后发表评论