Section 7. Installation
Table 22.
Logical Expression Examples
The
NOT
operator complements every bit in the word. A Boolean can be FALSE (0 or all bits set to 0) or TRUE (-1 or all bits set to 1).
“Complementing” a Boolean turns TRUE to FALSE (all bits complemented to 0).
Example Program
'(a AND b) = (26 AND 26) = (&b11010 AND &b11010) =
'&b11010. NOT (&b11010) yields &b00101.
'This is non-zero, so when converted to a
'BOOLEAN, it becomes TRUE.
Public
a
As LONG
Public
b
As LONG
Public
is_true
As Boolean
Public
not_is_true
As Boolean
Public
not_a_and_b
As Boolean
BeginProg
a = 26
b = a
Scan
(1,Sec,0,0)
is_true = a
AND
b
'This evaluates to TRUE.
not_is_true = NOT (is_true)
'This evaluates to FALSE.
not_a_and_b = NOT (a AND b)
'This evaluates to TRUE!
NextScan
EndProg
7.8.4.15.5 String Expressions
CRBasic facilitates concatenation of string variables to variables of all data types
using
&
and
+
operators. To ensure consistent results, use
&
when concatenating
strings. Use
+
when concatenating strings to other variable types. CRBasic
example
String and Variable Concatenation
(p. 166)
demonstrates CRBasic code for
concatenating strings and integers. See section
String Operations
(p. 282)
in the
Programming Resource Library
(p. 169)
for more information on string
programming.
CRBasic Example 21.
String and Variable Concatenation
'This program example demonstrates the concatenation of variables declared As String to
'other strings and to variables declared as other data types.
'
'Declare Variables
Dim
PhraseNum(2)
As Long
Dim
Word(15)
As String
* 10
Public
Phrase(2)
As String
* 80
'Declare Data Table
DataTable
(HAL,1,-1)
DataInterval
(0,15,Sec,10)
'Write phrases to data table "Test"
Sample
(2,Phrase,String)
EndTable
166
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......