lr_message( "The random type is %s",
lr_eval_string("{randomType}") 作者: xinxue00 时间: 2007-12-21 09:52
代码没有错误啊,不就是统计seatYupetList的总数吗,不知道运行错误提示信息是什么?作者: 板砖 时间: 2007-12-21 10:04
错了作者: xinxue00 时间: 2007-12-21 10:05
楼上的看清楚了,有个atoi 啊,楼主把错误提示信息发一下啊作者: 开着拖拉机上班 时间: 2007-12-21 10:21
我也不知道是否有错
我看的别人的代码,正在学习中!
我只是感觉有错,但是不知道为什么错
我用VS2005打开这段代码的时候,提示第2行有错误.作者: 开着拖拉机上班 时间: 2007-12-21 10:22 标题: 回复 5# 的帖子 aoti()是干什么的???作者: 开着拖拉机上班 时间: 2007-12-21 10:24
给大家发Action的全部代码看看吧!欢迎大家讨论!!!!
Action()
{
int seatPrefCount; //the number of seat pref
int seatTypeCount; //the number of seat type
int flightCount; //the number of flight which we can choose from depart time to arrive city
int returnflightCount; //the number of return flight which we can choose from depart time to arrive city
int i; //use for iteration
char Type[30]; //used to store the random type
char Pref[30]; //used to store the random Pref
char Flight[100]; //used to store the random flight
char returnFlight[100]; //used to store the random returnflight
char strTemp[100]; //Temporary string
char strTmp2[100]; //Temporary string
lr_think_time(6);
//Corrlate the seat pref parameter, and get all seat pref
web_reg_save_param("seatPrefList",
"LB=<input type=\"radio\" name=\"seatPref\" value=\"",
"RB=\"",
"Ord=All",
"RelFrameId=1.2",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
//Corrlate the seat type parameter, and get all seat type
web_reg_save_param("seatTypeList",
"LB=<input type=\"radio\" name=\"seatType\" value=\"",
"RB=\"",
"Ord=All",
"RelFrameId=1.2",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
// This transaction is used to Open Flight Search Page
lr_start_transaction("OpenFlightSearchPage");
lr_message( "The random Pref is %s",
lr_eval_string("{randomPref}") );
//Corrlate the flight, and get all flight list
web_reg_save_param("flightList",
"LB=outboundFlight value=",
"RB=>",
"Ord=All",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
//Corrlate the flight, and get all return flight list
web_reg_save_param("returnflightList",
"LB=name=returnFlight value=",
"RB=>",
"Ord=All",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
// This transaction is used to search the flight
lr_start_transaction("SearchFlight");
lr_message("The Depart city is %s", lr_eval_string("{DepartCity}"));
lr_message("The arrive time is %s", lr_eval_string("{DepartDatae}"));
lr_message("The arrive city is %s", lr_eval_string("{ArriveCity}"));
lr_message("The return time is %s", lr_eval_string("{returnDate}"));
lr_message("The number of passengers is %s", lr_eval_string("{numPassenger}"));
lr_message("The random type is %s",lr_eval_string("{randomType}") );
lr_message("The random Pref is %s",lr_eval_string("{randomPref}") );
memset(strTmp2, 0, 100);
//get the random flight
flightCount=atoi( lr_eval_string("{flightList_count}") );
lr_message("The flight count is %d",flightCount);
for(i=1;i<=flightCount;i++)
{
sprintf(Flight,"{flightList_%d}",i );
memset(strTemp, 0, 100);
strcpy(strTemp, lr_eval_string(Flight));
if (strlen(strTemp) > 20) {
strncpy(strTmp2, strTemp, 18);
sprintf(strTemp, "flightList_%d",i);
lr_save_string(strTmp2,strTemp);
break;
}