9.3.4.2 Expressions

Expressions can be used in Event value component to fulfill simple mathematical calculation.

Predefined Variables

NameDescription
val1the first 32bit integer value of event
val2the second 32bit integer value of event
val3the third 32bit integer value of event
......

For example, if an event is generated by calling EventRecord4(....), you get four 32bit integers, then your predefined variables are val1, val2, val3, val4. If you use val5 or further, the entire expression will be ignored.

Operators

OperatorsDescription
* / %Multiplication, Division, or Modulo
+ -Addition, Subtraction
& | ^Binary AND, OR, XOR
<< >>Shift left, Shift right
e ? e : eConditional operator

Format

FormatDescription
%dInteger value as signed decimal number
%uInteger value as unsigned decimal value
%tText output from ASCII characters
%xInteger value as hexadecimal number

Example

If you use EventRecord2(....) sending two integers 0x12345678, 0x90ABCDEF, below shows the relation between content in SCVD and output in Event Recorder table view:

SCVDOutput in Event Recorder Table View
<event id=......... value="val1_high=%x[(val1 &gt;&gt; 16 )&amp;0xFFFF], val1_low=%x[val1&amp;0xFFFF]" ..../>val1_high=0x1234, val1_low=0x5678
<event id=..........value="double_to_int=%d[val1/10000]"......../>double_to_int=30541
<event id=..........value="val_not_found=%x[val3&0xFFFF]"........../>val_not_found=
<event id=..........value="not_valid_expression=%d[hello world]"........./>not_valid_expression=