lr_output_message("upfilename=%s",lr_eval_string("{upfilename}"));打印显示Action.c(112): upfilename={upfilename}
时间: 2024-02-20 14:57:31 浏览: 20
根据你提供的信息,可能是因为在 LR 脚本中找不到名为 "upfilename" 的参数。请确保在使用 lr_eval_string 函数调用参数时,参数名拼写正确且与 web_reg_save_param_ex 函数中的参数名一致。
此外,你可以在脚本中添加 lr_error_message 函数,以便在运行时获取更多的调试信息。例如:
```
lr_error_message("upfilename parameter not found");
lr_output_message("upfilename=%s", lr_eval_string("{upfilename}"));
```
这样可以在未找到参数时输出错误信息,以帮助你进一步排查问题。
相关问题
web_reg_save_param_ex( "ParamName=upfilename", "LB=<span class=\"left\">申请日期:", "RB=</span>", SEARCH_FILTERS, LAST); lr_error_message("upfilename parameter not found"); lr_output_message("upfilename=%s",lr_eval_string("{upfilename}"));
根据你提供的信息,可能是因为在 LR 脚本中没有找到名为 "upfilename" 的参数,导致无法输出参数值。
请检查 web_reg_save_param_ex 函数中的提取规则是否正确,特别是左右边界是否与实际页面中的文本一致。如果提取规则正确,可以在运行时添加 lr_debug_message 函数输出调试信息,以帮助你进一步排查问题。例如:
```
web_reg_save_param_ex("ParamName=upfilename", "LB=<span class=\"left\">申请日期:", "RB=</span>", SEARCH_FILTERS, LAST);
if(!lr_param_exists("upfilename")) {
lr_error_message("upfilename parameter not found");
lr_exit(LR_EXIT_ITERATION_AND_CONTINUE, LR_AUTO);
}
lr_debug_message("upfilename parameter value: %s", lr_eval_string("{upfilename}"));
```
这样既可以在未找到参数时输出错误信息,又可以在找到参数时输出参数值。
web_reg_save_param_ex( "ParamName=upfilename", "LB=<span class="left">申请日期:", "RB=</span>", SEARCH_FILTERS, LAST); if(!lr_param_exists("upfilename")) { lr_error_message("upfilename parameter not found"); lr_exit(LR_EXIT_ITERATION_AND_CONTINUE, LR_AUTO); } lr_debug_message("upfilename parameter value: %s", lr_eval_string("{upfilename}"));报错如何解决
根据你提供的信息,lr_debug_message 函数中的格式字符串可能存在问题。请检查格式字符串中的占位符是否正确,例如 %s 表示输出字符串类型的参数,%d 表示输出整数类型的参数。在你提供的代码中,双引号中的字符串中包含了左右引号,需要使用转义符对其进行转义,例如:
```
web_reg_save_param_ex("ParamName=upfilename", "LB=<span class=\"left\">申请日期:", "RB=</span>", SEARCH_FILTERS, LAST);
if(!lr_param_exists("upfilename")) {
lr_error_message("upfilename parameter not found");
lr_exit(LR_EXIT_ITERATION_AND_CONTINUE, LR_AUTO);
}
lr_debug_message("upfilename parameter value: %s", lr_eval_string("{upfilename}"));
```
在修改后的代码中,使用了转义符对双引号进行了转义,避免了语法错误。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![cs](https://img-home.csdnimg.cn/images/20210720083646.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![application/x-zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)