参数化的问题?【已解决】
使用socket协议Action:
lr_save_string(num,"{Numchanged}"); //修改参数值, Numchanged原值= 8001 num = \x1a\xa8
lrs_send("socket1", "buf0", LrsLastArg);//Numchanged是"buf0"中的参数,修改参数值在send之前
Replay log:
Action.c(31): Notify: Parameter Substitution: parameter "Numchanged" ="8001"
Action.c(39): Notify: Saving Parameter "{Numchanged} = \x1a\xa8" //提示参数修改成功
可是send出去的数据参数还是8001,未修改!为何?
[ 本帖最后由 wistaria 于 2009-1-15 16:08 编辑 ] Action()
{
char num;
memset(num);
StringTocompressAscii(num,sizeof(num) - 1,lr_eval_string("{NumChange}"),strlen(lr_eval_string("{NumChange}")));//自己写的DLL封装函数,
lr_save_string(num,"{NumChange}");
lr_output_message ("NumChange is %s",lr_eval_string("{NumChange}"));
lrs_send("socket1", "buf0", LrsLastArg);
lr_output_message ("NumChange is %s",lr_eval_string("{NumChange}"));
return 0;
}
replay log:
Action.c(29): Notify: Parameter Substitution: parameter "NumChange" ="8001"\
Action.c(43): Notify: Parameter Substitution: parameter "NumChange" ="8001"
Action.c(33): Notify: Saving Parameter "{NumChange} = \x1a\xa8"
Action.c(41): NumChange is 8001
Action.c(43): lrs_send(socket1, buf0)
Action.c(43): Notify: Parameter Substitution: parameter "NumChange" ="8001"
Action.c(45): Notify: Parameter Substitution: parameter "NumChange" ="8001"
Action.c(45): NumChange is 8001
[ 本帖最后由 wistaria 于 2009-1-15 16:00 编辑 ] lr_save_string(num,"{NumChange}");
改写为
lr_save_string(num,"NumChange"); lr_save_string是个很怪异的函数。 不错呀,顶了呀
页:
[1]