How do I use the web_reg_save_param method to save multiple parameters?
In the web_reg_save_param method, if "ord = all" is specified in the parameter section, multiple parameters can be saved. For example, "web_reg_save_param (" flight_num "," lB = <input type = \ "checkbox \" name = \"", "RB = \" value = \ "on \"> "," ord = All ", last)", the matching content will be searched based on the actual situation, the results are stored in the flight_num_1, flight_num_2, flight_num_3 ,...... . To use these parameters, you can use arrays.
The following example shows how to save the ticket ID to an array in the ticket booking program, and then generate a parameter name using a loop statement and save it to an array. After obtaining the parameter list, you can perform other operations, such as deleting tickets.
Action ()
{Int I;
Int count;
Char Param [10] [20];
Web_reg_save_param ("flight_num", "lB = <input type = \" checkbox \ "name = \" "," RB = \ "value = \" on \ "> ", "ord = All", last );
Web_url ("com. mercurytours. servlet. iteneraryservlet ",
"Url = http: // localhost/Servlets/COM. mercurytours. servlet. iteneraryservlet ",
"Targetframe = ",
"Resource = 0 ",
"Reccontenttype = text/html ",
"Referer = http: // localhost/Servlets/COM. mercurytours. servlet. reservationservlet ",
"Snapshot = t3.inf ",
"Mode = html ",
Last );
Count = atoi (lr_eval_string ("{flight_num_count }"));
Lr_error_message ("number of tickets already booked: % d", count );
For (I = 1; I <= count; I ++ ){
Sprintf (Param [I], "{flight_num _ % d}", I); // The parameter name is stored in the array.
Lr_error_message (Param [I]);
}
For (I = 1; I <= count; I ++ ){
Lr_error_message (lr_eval_string (Param [I]); // use the Parameter
}
Return 0;
}
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/chenshaoying/archive/2007/08/02/1722160.aspx