- 1、本文档共70页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
lr常用函数整理
对loadrunner中的帮助文档部分常用函数进行整理,类似的放在一起。
可以使用文档结构图方便查看(视图(V)=文档结构图)。
收获:了解了在loadruuner常用的函数,复习了计算机英语。
C Language Functions
字符串操作函数(String Manipulation Functions)
strcat:Concatenates two strings.连接2个字符串
char *strcat(char *to,char *from);
to The string at the end of which the from string is concatenated.被连接的字符串 from The string concatenated to the end of the to string.连接到to所指字符串末尾的字符串 strcpy:Copies one string to another.复制一个字符串到另一个中
char *strcpy( char *dest, const char *source );
dest The destination string into which source is copied.被复制进去的目标字符串 source The string that is copied. 被复制的字符串 注意在Vugen文件中,必须明确声明C函数不返回整数
eg.下面的例子使用strcpy复制“c:\\tmp”字符串到字符数组fullpath中,使用strcat为一个目录名称fullpath追加一个反斜线,然后为fullpath追加文件名称。
char fullpath[1024], * filename = logfile.txt;
????strcpy(fullpath, c:\\tmp);
????strcat(fullpath, \\);
????strcat(fullpath, filename);
????lr_output_message (Full path of file is %s, fullpath);
输出Output:Action.c(9): Full path of file is c:\tmp\logfile.txt
strchr:Returns the pointer to the first occurrence of a character in a string.返回字符串中首次出现指定字符的位置。
char *strchr( const char *string, int c );(不明白这里为什么是int类型的?????)
string The string that is searched.被查找的字符串 c The character that is searched for in the string.在字符串被查找的字符 strrchr:Finds the last occurrence of a character in a string.找出字符串中最后一次出现指定字符的位置。
char *strrchr( const char *string, int c );
string The string that is searched.被查找的字符串 c The character that is searched for in the string. 在字符串被查找的字符 注意在Vugen文件中,必须明确声明C函数不返回整数
eg. 下面的例子使用strchr在string的字符串中查找字符x的首次出现的位置,使用strrchr查找字符x的最后一次出现的位置。
char * string = His Excellency the Duke of Exeter;
?char * first_x, * last_x;
first_x = (char *)strchr(string, x);
lr_output_message (The first occurrence of x: %s, first_x);
last_x = (char *)strrchr(string, x);
lr_output_message (The last occurrence of x: %s, last_x);
输出Output:Action.c(7): The first occurrence of x: xcellency the Duke of ExeterAction.c(10): The last occurrence of x: xeter
strcmp:Compares two s
文档评论(0)