How do I use the ”ALL” option to the web_reg_save_parameter function
Question ID: 105419
2
0

I need to retrieve a series of values that are return from a web page. I know I can use the ALL arg to retrieve all of the values that match the function boundaries. How do I actually use these values. For example, I want to pull a random value from the multiple items retrieve using the "ALL" arg.

Marked as spam
Posted by (Questions: 6, Answers: 167)
Asked on May 20, 2014 3:26 pm
41 views
Answers (1)
2
Private answer

**The following code snippets illustrate how to use this function.**

/*
This next URL returns all of the flights that are available from the
airline. Pull all available flights destinations. After the web image call,
Flight should be returned as an array of flights with Flights_count
containing the total flights found
*/

web_reg_save_param(''Flights'', ''LB=

web_url(''Reservations'',
''URL=http://www.southwest.com/cgi-bin/buildItinerary2?hps=nb'',
''TargetFrame='',
''Resource=0'',
''RecContentType=text/html'',
''Referer=http://www.southwest.com/'',
''Snapshot=t2.inf'',
''Mode=HTML'',
LAST);

/*** Get total number of values returned by web_reg_save_param ***/

TotalFlights = atoi(lr_eval_string(''{Flights_count}''));

/* Get a random Out bound flight - On First 213 values have flight data */
/* The first 101 values contain junk; so, we begin 101 entries in it */

sprintf(buffer, ''{Flights_%d}'', GetRandomNum(TotalFlights - 101));
lr_save_string(lr_eval_string(buffer), ''OutFlight'');

//lr_output_message(''OutFlight = %s'',lr_eval_string(''{OutFlight}''));

/* Get a random In bound flight - On First 213 values have flight data */
sprintf(buffer, ''{Flights_%d}'', GetRandomNum(TotalFlights - 101));
lr_save_string(lr_eval_string(buffer), ''InFlight'');

//lr_output_message(''InFlight = %s'',lr_eval_string(''{InFlight}''));

**Now the InFlight and OutFlight varibles contain a random location**

Marked as spam
Posted by (Questions: 6, Answers: 167)
Answered on May 20, 2014 3:27 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top