Action()
{
char picUrl[20];
sprintf(picUrl,"11111111");
lr_output_message("our i is %s",picUrl);
lr_output_message("The max of 1 and 3 is %d",max(1,1));
return 0;
}
int max(int a,int b){
if(a>b){
return a;
}else if(b>a){
return b;
}else{
return 0;
}
}
以前写程序时,不管是什么语言都支持函数。现在在学loadrunner ,不知道loadrunner是否支持自定义函数,于是做了个实验证明了一下,loadrunner也可以自定义函数。在上面的程序中,自定义函数max()放在了Action()外面,这样就可以在Action中调用max()了。