#include "as_web.h"
int i;
// Set whileloop = 1 for the while loop example to work
int whileloop = 1;
Action()
{
//Example of a loop using a FOR loop
for (i=1;i<=10;i++)
{
lr_output_message( "FOR Loop number %d", i);
}
//Equivalent example but using a WHILE loop
//This can be made more complicated by including other conditions e.g. &&
i=1;
while ((i <= 10) && (whileloop ==1))
{
lr_output_message( "WHILE Loop number %d", i);
i++;
}
//Equivalent example but using a WHILE loop
//This can also be made more complicated by including other conditions e.g. &&
i=1;
do {
lr_output_message( "DO WHILE Loop number %d", i);
i++;
}
while (i <= 10) ;
return 0;
}
The sample Loadrunner script below shows examples of FOR, DO and DO WHILE LOOPs.
最新推荐文章于 2020-02-18 15:40:21 发布