Teledyne-lecroy CATC Scripting Language Reference Manual Manuale Utente Pagina 16

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 57
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 15
C
HAPTER
4
Operators
CATC Scripting Language
12
Operator
Symbol
Description
Operand
Ty
p
es
R
esult
Ty
p
es
Examples
Equality Operators
==
Equal
Integer-integer
Integer
2
==
2
String-string
Integer
"three" == "three"
Raw byte-raw byte
Integer
'001122' == '001122'
List-list
Integer
[1, [2, 3]] == [1, [2, 3]]
*Note: equality operations on values of different
types will evaluate to false.
!=
Not equal
Integer-integer
Integer
2
!=
3
String-string
Integer
"three" != "four"
Raw byte-raw byte
Integer
'001122' != '334455'
List-list
Integer
[1, [2, 3]] != [1, [2, 4]]
*Note: equality operations on values of different
types will evaluate to false.
Relational Operators
<
Less than
Integer-integer
Integer
1
<
2
String-string
Integer
"abc" < "def"
>
Greater than
Integer-integer
Integer
2
>
1
String-string
Integer
"xyz" > "abc"
<=
Less than or
equal
Integer-integer
Integer
23 <= 27
String-string
Integer
"cat" <= "dog"
>=
Greater than or
equal
Integer-integer
Integer
2
>=
1
String-string
Integer
"sun" >= "moon"
*Note: relational operations on string values are
evaluated according to character order in the ASCII
table.
Logical Operators
!
Negation
All combinations
of types
Integer
!0 = 1 !"cat" = 0
!9
=
0
!""
=
1
&&
Logical AND
All combinations
of types
Integer
1
&&
1
=
1
1
&&
!""
=
1
1 && 0 = 0 1 && "cat" = 1
||
Logical OR
All combinations
of types
Integer
1
||
1
=
1
0
||
0
=
0
1 || 0 = 1 "" || !"cat" = 0
Table 4.2: Operators (Continued)
Vedere la pagina 15
1 2 ... 11 12 13 14 15 16 17 18 19 20 21 ... 56 57

Commenti su questo manuale

Nessun commento