代码如下:
vuser_init()
{
lr_save_string("11041331","11041372","11041373","11041374","OrderNo");
lr_output_message("%s", lr_eval_string("{OrderNo}"));
return 0;
}
Action()
{
int i=0,j;
char temp[100];
//char OrderNo[100]="11041331","11041372","11041373","11041374";
char *p[20];
char *buf=lr_eval_string("{OrderNo}");
//char *buf=OrderNo;
while((p[i]=(char *)strtok(buf,"",""))!=NULL){
i++;
buf=NULL;
}
buf=NULL;
lr_output_message("总共分割成:%d个字符串", i);
for (j=0; j<i; j++) {
strcat( temp,p[j] );
if(i!=j+1){
strcat( temp,"|" );
}
lr_output_message("%s",p[j]);
}
lr_output_message("最后拼接的OrderNo值:%s",temp);
lr_save_string(temp,"AllOrderNo");
lr_output_message("拼接后的订单号:%s", lr_eval_string("{AllOrderNo}"));
return 0;
}
深圳湖北籍软件测试群 275212937