wistaria 发表于 2009-1-15 14:42:26

参数化的问题?【已解决】

使用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 编辑 ]

wistaria 发表于 2009-1-15 15:58:51

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 编辑 ]

wistaria 发表于 2009-1-15 16:09:04

lr_save_string(num,"{NumChange}");

改写为
lr_save_string(num,"NumChange");

trapezia 发表于 2009-1-15 17:12:41

lr_save_string是个很怪异的函数。

ts47284 发表于 2009-1-15 17:27:32

不错呀,顶了呀
页: [1]
查看完整版本: 参数化的问题?【已解决】