04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 7. Installation<br />

7.8.13.1 String Operators<br />

The table String Operators (p. 237) list and describes available string operators.<br />

String operators are case sensitive.<br />

Table 38. String Operators<br />

Operator<br />

&<br />

+<br />

Description<br />

Concatenates strings. Forces numeric values to strings before<br />

concatenation.<br />

Example<br />

1 & 2 & 3 & "a" & 5 & 6 & 7 = "123a567"<br />

Adds numeric values until a string is encountered. When a string is<br />

encountered, it is appended to the sum of the numeric values. Subsequent<br />

numeric values are appended as strings.<br />

Example:<br />

1 + 2 + 3 + "a" + 5 + 6 + 7 = "6a567"<br />

"Subtracts" NULL ("") from the end of ASCII characters for conversion to<br />

an ASCII code (LONG data type).<br />

Example:<br />

"a" - "" = 97<br />

-<br />

, , =, =<br />

ASCII codes of the first characters in each string are compared. If the<br />

difference between the codes is zero, codes for the next characters are<br />

compared. When unequal codes or NULL are encountered (NULL<br />

terminates all strings), the difference between the last compared ASCII<br />

codes is returned.<br />

Examples:<br />

Note — ASCII code for a = 97, b = 98, c = 99, d = 100, e = 101, and all<br />

strings end with NULL.<br />

Difference between NULL and NULL<br />

"abc" - "abc" = 0<br />

Difference between e and c<br />

"abe" - "abc" = 2<br />

Difference between c and b<br />

"ace" - "abe" = 1<br />

Difference between d and NULL<br />

"abcd" - "abc" = 100<br />

ASCII codes of the first characters in each string are compared. If the<br />

difference between the codes is zero, codes for the next characters are<br />

compared. When unequal codes or NULL are encountered (NULL<br />

terminates all strings), the requested comparison is made. If the comparison<br />

is true, -1 or True is returned. If false, 0 or False is returned.<br />

Examples:<br />

Expression<br />

x = "abc" = "abc"<br />

x = "abe" = "abc"<br />

x = "ace" > "abe"<br />

Result<br />

x = -1 or True<br />

x = 0 or False<br />

x = -1 or True<br />

7.8.13.2 String Concatenation<br />

Concatenation is the building of strings from other strings ("abc123"), characters<br />

("a" or chr()), numbers, or variables.<br />

237

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!