|
- Action()
- {
- //extern char * strtok(char * string, const char * delimiters );
- char *token = NULL;
- char *str1;
- int i=1;
- int j,l;
- int IsAdd = 0;
- char *newshuzu[] = {0};
- char *shuzu[100];
- web_service_call( "StepName=GetAVHInfo_102",
- "SOAPMethod=BenefitService|BenefitServiceSoap|GetAVHInfo",
- "ResponseParam=response",
- "Service=BenefitService",
- "ExpectedResponse=SoapResult",
- "Snapshot=t1284458955.inf",
- BEGIN_ARGUMENTS,
- "UserName=1",
- "TakeoffDate=2010-12-20",
- "FromCity=ctu",
- "ToCity=kwe",
- END_ARGUMENTS,
- BEGIN_RESULT,
- "GetAVHInfoResult=Param_GetAVHInfoResult",
- END_RESULT,
- LAST);
- lr_save_string(lr_eval_string("{Param_GetAVHInfoResult}"),"tempStr");
- str1 = lr_eval_string("{tempStr}");
- token = (char*)strtok(str1,",");
- lr_error_message("%s",lr_eval_string("{Param_GetAVHInfoResult}"));
- while(token!=NULL)
- {
- if(strlen(token)==3)
- {
- //lr_output_message("%s\n",token);
- shuzu[i] = token;
- i++;
- }
- token=(char*)strtok(NULL,",");
-
- }
- [color=Red]for (j=1;j<i;j++)
- {
- l=0;
- for (;l<=j;l++)
- {
- if (shuzu[l]==shuzu[j]))
- {
- IsAdd=1;
- break;
- }
- }
- if (IsAdd == 0) {
- newshuzu[j] = shuzu[j];
-
- }
- lr_output_message("%s", newshuzu);
- }[/color]
- }
复制代码 红色标识的代码是我用来比较数据组是不是有重复的值,如果有的话,就把重复的却掉,可我不明白为什么,我返回的值都是为空呢?而且会输出13次
按理来说,只应该会返回4个,因为服务器返回的值就为“CTU,KWE,733,CTU,KWE,733,CTU,KWE,733,CTU,KWE,738”
谁可以帮我看看吖,我弄了大半上午了,都没个结果。。 |
|