Teledyne-lecroy Protocol Analyzers File-Based Decoding User Manual Manual de usuario Pagina 17

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 82
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 16
File-based Decoding User Manual Chapter 4: Operators
LeCroy Corporation 11
Operator
Symbol Description Operand Types
Result
Types Examples
Index Operator
[ ] Index or subscript Raw Bytes Integer Raw = '001122'
Raw[1] = 0x11
List Any List = [0, 1, 2, 3, [4, 5]]
List[2] = 2
List[4] = [4, 5]
List[4][1] = 5
*Note: if an indexed Raw value is assigned to any
value that is not a byte (
> 255 or not an integer), the
variable is promoted to a list before the assignment
is performed.
Associative Operator
( ) Associative Any Any ( 2 + 4 ) * 3 = 18
2 + ( 4 * 3 ) = 14
Arithmetic Operators
* Multiplication Integer-integer Integer 3 * 1 = 3
/ Division Integer-integer Integer 3 / 1 = 3
% Modulus Integer-integer Integer 3 % 1 = 0
+ Addition Integer-integer Integer 2 + 2 = 4
String-string String "one " + "two" = "one two"
Raw byte-raw byte Raw '001122' + '334455' = '001122334455'
List-list List [1, 2] + [3, 4] = [1, 2, 3, 4]
Integer-list List 1 + [2, 3] = [1, 2, 3]
Integer-string String "number = " + 2 = "number = 2"
*Note: integer-string concatenation uses decimal
conversion.
String-list List "one" + ["two"] = ["one", "two"]
- Subtraction Integer-integer Integer 3 – 1 = 2
Increment and Decrement Operators
++ Increment Integer Integer a = 1
++a = 2
b = 1
b++ = 1
*Note that the value of b after execution is 2.
-- Decrement Integer Integer a = 2
--a = 1
b = 2
b-- = 2
*Note that the value of b after execution is 1.
Table 4.2 Operators
Vista de pagina 16
1 2 ... 12 13 14 15 16 17 18 19 20 21 22 ... 81 82

Comentarios a estos manuales

Sin comentarios