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
Содержание CR3000 Micrologger
Страница 2: ......
Страница 3: ......
Страница 4: ......
Страница 6: ......
Страница 30: ......
Страница 34: ......
Страница 36: ......
Страница 96: ......
Страница 200: ...Section 7 Installation 200 FIGURE 42 Running Average Frequency Response FIGURE 43 Running Average Signal Attenuation ...
Страница 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Страница 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Страница 488: ...Section 8 Operation 488 8 11 2 3 Final Storage Data FIGURE 113 Keyboard and Display Final Storage Data ...
Страница 489: ...Section 8 Operation 489 8 11 3 Run Stop Program FIGURE 114 Keyboard and Display Run Stop Program ...
Страница 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Страница 495: ...Section 8 Operation 495 Low power standby whenever possible Low power bus sets bus and modules to low power ...
Страница 496: ......
Страница 502: ......
Страница 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Страница 566: ......
Страница 594: ......
Страница 598: ......
Страница 600: ......
Страница 602: ......
Страница 624: ......
Страница 642: ......
Страница 643: ......