How do I use the web_reg_save_param method to save multiple parameters?

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.