Action() { //Loadrunner中的FOR,WHILE,DO 循环语句 int i; int whileloop = 1; //FOR 循环 for (i=1;i<=3;i++) { lr_output_message( "FOR循环次数: %d", i); } /**************************************************/ // WHILE 循环为了实现上面FOR循环相同效果,这里略复杂点,用到了 && 运算 i=1; while ((i <= 3) && (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 <= 3) ; return 0; }