![Campbell CR800 Series Скачать руководство пользователя страница 305](http://html1.mh-extra.com/html/campbell/cr800-series/cr800-series_operators-manual_489099305.webp)
Section 7. Installation
305
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
BeginProg
Scan
(1,Sec,0,0)
I = 0
'Set I to zero
'Data type of the following destination variables is Float
'because Num() array is declared As Float.
I += 1
'Increment I by 1 to clock through sequential elements of the Num() array
'As shown in the following expression, if all parameter are numbers, the result
'of using '+' is a sum of the numbers:
Num(I) = 2 + 3 + 4
'= 9
'Following are examples of using '+' and '*' when one or more parameters are strings.
'Parameters are processed in the standard order of operations. In the order of
'operation, once a string or an '&' is processed, all following parameters will
'be processed (concatenated) as strings:
I += 1
Num(I) = "1" + 2 + 3 + 4
'= 1234
I += 1
Num(I) = 1 + "2" + 3 + 4
'= 1234
I += 1
Num(I) = 1 + 2 + "3" + 4
'= 334
I += 1
Num(I) = 1 + 2 + 3 + "4"
'= 64
I += 1
Num(I) = 1 + 2 + "3" + 4 + 5 + "6"
'= 33456
I += 1
Num(I) = 1 + 2 + "3" + (4 + 5) + "6"
'= 3396
I += 1
Num(I) = 1 + 2 + "3" + 4 * 5 + "6"
'= 33206
I += 1
Num(I) = 1 & 2 + 3 + 4
'= 1234
I += 1
Num(I) = 1 + 2 + 3 & 4
'= 64
'If a non-numeric string is attempted to be processed into a float destination,
'operations are truncated at that point
I += 1
Num(I) = 1 + 2 + "hey" + 4 + 5 + "6"
'= 3
I += 1
Num(I) = 1 + 2 + "hey" + (4 + 5) + "6"
'= 3
'The same rules apply when the destination is of data type String, except in the
'case wherein a non-numeric string is encountered as follows. Data type of the
Содержание CR800 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 34: ......
Страница 54: ......
Страница 92: ......
Страница 190: ...Section 7 Installation 190 FIGURE 40 Running Average Frequency Response FIGURE 41 Running Average Signal Attenuation ...
Страница 310: ......
Страница 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Страница 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Страница 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Страница 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Страница 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Страница 456: ......
Страница 462: ......
Страница 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Страница 524: ......
Страница 526: ......
Страница 556: ......
Страница 558: ......
Страница 560: ......
Страница 597: ......