
7 RASExpress Script Language
CommPlete Communications Server 179
str2 = "string";
fdisplay("str1 : %s^J^Mstr2 : %s^J^M", str1, str2);
if !strcmp(str1, str2) then
display("str1 and str2 are same^J^M^J^M");
else
display("str1 and str2 are different^J^M^J^M");
endif
str1 = "string1";
str2 = "string2";
fdisplay("str1 : %s^J^M", str1);
fdisplay("str2 : %s^J^M", str2);
if !strcmp(str1, str2) then
display("str1 and str2 are same^J^M");
else
display("str1 and str2 are different^J^M");
endif
display("Example of strcpy command^J^M");
str = "first string";
str1 = "second string";
fdisplay("str value before strcpy is : ‘%s’^J^M", str);
strcpy(str, str1);
fdisplay("str value after strcpy is : ‘%s’^J^M", str);
display("Example of strfmt command^J^M");
display("constants 120 & 150 will be");
display(" concatenated into a string and shown^J^M");
strfmt(str, "%d %d^J^M", 120, 150);
display(str);
display("^J^MEnd of script, press any key...");
getkey;
display("^J^M");
endproc
TOLOWER tolower(var string buffer);
Converts the string variable to lower case.
Example
/* This script illustrates the tolower command. */
proc main;
string str;
integer len;
display("Example for tolower command^J^M");
display("Enter string to convert : ");
len = 20;
if getstr(str, len) then
fdisplay("^J^MString read is : %s^J^M", str);
tolower(str);
fdisplay("Converted string is : %s^J^M", str);
endif
endproc
Komentáře k této Příručce