Section 7. Installation
329
String Operators
Operator
Description
<, >, <>, <=,
>=, =
ASCII codes of the first characters in each string are
compared. If the difference between the codes is zero, codes
for the next characters are compared. When unequal codes
or NULL are encountered (NULL terminates all strings), the
requested comparison is made. If the comparison is true, -1
or True is returned. If false, 0 or False is returned.
Examples:
Expression
Result
x = "abc" = "abc"
x = -1 or True
x = "abe" = "abc"
x = 0 or False
x = "ace" > "abe"
x = -1 or True
7.7.19.2 String Concatenation
Concatenation is the building of strings from other strings ("abc123"), characters
("a" or chr()), numbers, or variables. The table String Concatenation Examples
(p. 329)
lists some expressions and expected results. CRBasic example
Concatenation of Numbers and Strings
(p. 329)
demonstrates several concatenation
examples.
When non-string values are concatenated with strings, once a string is
encountered, all subsequent operands will first be converted to a string before the
+ operation is performed. When working with strings, exclusive use of the &
operator ensures that no string value will be converted to an integer.
String Concatenation Examples
Expression
Comments
Result
Str(1) = 5.4 + 3 + " Volts"
Add floats, concatenate strings
"8.4 Volts"
Str(2) = 5.4 & 3 & " Volts"
Concatenate floats and strings
"5.43 Volts"
Lng(1) = "123"
Convert string to long
123
Lng(2) = 1+2+"3"
Add floats to string / convert to
long
33
Lng(3) = "1"+2+3
Concatenate string and floats
123
Lng(4) = 1&2&"3"
Concatenate floats and string
123
Concatenation of Numbers and Strings
'This program example demonstrates the concatenation of numbers and strings to variables
'declared As Float and As String.
'
'Declare Variables
Public
Num(12)
As Float
Public
Str(2)
As String
Dim
I
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......