Expressions can be used in Event value component to fulfill simple mathematical
calculation.
Predefined Variables
Name |
Description |
val1 |
the first 32bit integer value of event |
val2 |
the second 32bit integer value of event |
val3 |
the 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
Operators |
Description |
* / % |
Multiplication, Division, or Modulo |
+ - |
Addition, Subtraction |
& | ^ |
Binary AND, OR, XOR |
<< >> |
Shift left, Shift right |
e ? e : e |
Conditional operator |
Format
Format |
Description |
%d |
Integer value as signed decimal number |
%u |
Integer value as unsigned decimal value |
%t |
Text output from ASCII characters |
%x |
Integer 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:
SCVD |
Output in Event Recorder Table View |
<event id=......... value="val1_high=%x[(val1 >>
16 )&0xFFFF], val1_low=%x[val1&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= |