Web_reg_save_param: If the Ord parameter value is set to all, the correlated function automatically saves the correlated values that meet the conditions to the parameter array. In this example, if the correlated values return three records, LR stores the values in sor_1, sor_2, and sor_3 respectively. At the same time, LR will also automatically create a sor_count variable to save the total number of records. Here, the sor_count value is equal to 3.
Web_reg_save_param ("param1 ",
"LB = sor \" value = \"",
"RB = \"","Ord = all",
Last );
// Method 1 of the array associated with cyclic output
/For (I = 1; I <= atoi (lr_eval_string ("{param1_count}"); I ++)
{
Sprintf (buffer, "{param1 _ % d}", I); // save each sor value to the Sor string. when defining the buffer, defined as char buffer [100] = {0}
Lr_output_message ("The conut is % s", lr_eval_string (buffer); // you can use the lr_eval_string function to assign a string to the sorvalue variable.
}
Web_reg_save_param ("contactidlast ",
"LB = sor \" value = \"",
"RB = \"","Ord = all",
Last );
// Method 2 of array associated with cyclic output
Testi = atoi (lr_eval_string ("{contactidlast_count}"); // int testi;
For (I = 1; I <= testi)
{
Lr_save_int (testi, "itest ");
Contactidlastl = lr_eval_string ("{contactidlast _ {itest}"); // char * contactidlastl
Lr_output_message ("contactidlast = % s", lr_eval_string (contactidlastl ));
}
Go to LoadRunner-join array of cyclic output