为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

LR中用C语言比较两个字符串变量

2017-12-01 4页 doc 15KB 11阅读

用户头像

is_995397

暂无简介

举报
LR中用C语言比较两个字符串变量LR中用C语言比较两个字符串变量 LR中用C语言比较两个字符串变量 Zee的早期文档. 一: 以下脚本,定义两个一样的字符数组,对比后,打印出result的值: 1. vuser_init() 2. { 3. int result; 4. char string1[] = "We can see the string:zee"; 5. char string2[] = "We can see the string:zee"; 6. lr_output_message("the string1 is %s.",s...
LR中用C语言比较两个字符串变量
LR中用C语言比较两个字符串变量 LR中用C语言比较两个字符串变量 Zee的早期文档. 一: 以下脚本,定义两个一样的字符数组,对比后,打印出result的值: 1. vuser_init() 2. { 3. int result; 4. char string1[] = "We can see the string:zee"; 5. char string2[] = "We can see the string:zee"; 6. lr_output_message("the string1 is %s.",string1); 7. lr_output_message("the string2 is %s.",string2); 8. result = strcmp(string1,string2); 9. if ( result == 0 ) 10. { 11. lr_output_message("the result is 0."); 12. } 13. else 14. { 15. lr_output_message("the result is not 0."); 16. } 17. return 0; 18. } 复制代码 运行结果: 1. Starting action vuser_init. 2. Web Turbo Replay of LoadRunner 8.1.0 for WINXP; Web build 4788 [MsgId: MMSG-27143] 3. Run-Time Settings file: "C:\Documents and Settings\Zee\Local Settings\Temp\noname26\\default.cfg" [MsgId: MMSG-27141] 4. vuser_init.c(7): the string1 is We can see the string:zee. 5. vuser_init.c(8): the string2 is We can see the string:zee. 6. vuser_init.c(13): the result is 0. 7. Ending action vuser_init. 8. Running Vuser... 复制代码 二: 脚本: 1. vuser_init() 2. { 3. int result; 4. char string1; 5. char string2; 6. lr_save_string( "We can see the string:zee","string1" ); 7. lr_save_string( "We can see the string:zee","string2" ); 8. lr_output_message("the string1 is %s.",lr_eval_string("{string1}")); 9. lr_output_message("the string2 is %s.",lr_eval_string("{string2}")); 10. result = strcmp(lr_eval_string("{string1}"),lr_eval_string("{string1}")); 11. if ( result == 0 ) 12. { 13. lr_output_message("the result is 0."); 14. } 15. else 16. { 17. lr_output_message("the result is not 0."); 18. } 19. return 0; 20. } 复制代码 结果: 1. Starting action vuser_init. 2. Web Turbo Replay of LoadRunner 8.1.0 for WINXP; Web build 4788 [MsgId: MMSG-27143] 3. Run-Time Settings file: "C:\Documents and Settings\Zee\Local Settings\Temp\noname26\\default.cfg" [MsgId: MMSG-27141] 4. vuser_init.c(10): the string1 is We can see the string:zee. 5. vuser_init.c(11): the string2 is We can see the string:zee. 6. vuser_init.c(16): the result is 0. 7. Ending action vuser_init. 8. Running Vuser... 复制代码
/
本文档为【LR中用C语言比较两个字符串变量】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索