lr_eval_string()返回参数的当前值
lr_save_string()将变量(常量)保存为参数
例如:
Action(){ char *temp="zml"; lr_save_string("name","page"); //将常量保存为参数page lr_output_message(lr_eval_string("{page}")); //获取并输出参数page的当前值(输出:name) lr_save_string(temp,"page"); //将变量保存为参数,temp为变量 lr_output_message(lr_eval_string("{page}"));//(输出:zml) return 0;}
strcmp()比较,区分大小写
stricmp()比较,不区分大小写
strcpy()
strcat()追加
Action(){ int result; char tmp[20]; char string1[] = "abc"; char string2[] = "aBc"; result = strcmp( string1, string2); // Case-sensitive comparison if(result > 0) strcpy(tmp, "大于"); else if(result == 0) strcpy(tmp, "等于"); else strcpy(tmp, "小于"); lr_output_message ("strcmp: String 1 is %s string 2", tmp); result = stricmp(string1, string2 ); // Case-insensitive comparison if( result > 0 ) strcpy( tmp, "大于" ); else if( result < 0 ) strcpy( tmp, "小于" ); else strcpy( tmp, "等于" ); lr_output_message( "stricmp: String 1 is %s string 2", tmp ); lr_output_message ("result is %s", result); strcat(tmp,"哈哈哈哈"); lr_output_message( "tmp is %s ",tmp ); return 0;}
Starting action Action.Action.c(27): strcmp: String 1 is 大于 string 2Action.c(44): stricmp: String 1 is 等于 string 2Action.c(45): result is (null)Action.c(47): tmp is 等于哈哈哈哈