While a Script is processed, each message field can be checked for its properties.
A specific message field is accessed in the following form:
Packet.Field(field_name).FieldProperties
A 'Field Name' is the text name of the field and is listed when pressing "<F4>" or the Insert Field Lookup Code icon (the 'Export Fields Structure' tool can be used to export the fields structure including their name into an XML file format – see chapter IV.17 for details).
Possible Field Properties are:
• Meaning – a string holding the field current value meaning
• ValueText – the string holding the field value
• Hint – a string holding the field hint
• Value – the field numeric value (if applicable)
• Exist – Boolean indicates if the field exists in this message
• Sons – number of sons of this field
• Name – a string holding the field name
Since a field may have multiple instances in a message, the following variables hold a list of the meaning/value/tool-tips of each of the instances:
• Meanings – list of strings holding the field current value meaning
• ValuesText – list of strings holding the field value
• Hints - list of strings holding the field hint
• Values – list of field numeric value (if applicable)
• Properties - For repeating fields (such as attributes) with sons, the Properties structure holds the element main properties plus a hierarchical structure with all its sons.
There are two ways to use field values:
• By using field properties:
long time = packet.Field("InfoStartTime").Value
if (packet.Field("InfoRelatedMessagesAckAt").Exist)
• By using predefined search functions:
private bool Search( string fieldName,
StringOptions stringOptions,
string text,
ValueOptions valueOptions,
long minValue,
long maxValue,
bool searchValue);
public bool Search( string fieldName,
StringOptions options,
string text);
public bool Search( string fieldName,
ValueOptions options,
long minValue,
long maxValue);
public bool Search( string fieldName,
ValueOptions options,
long value);
public bool Search( string fieldName,
long value);
public bool Search( string fieldName,
long minValue,
long maxValue);
The following options or a combination of options using the logical 'or' (||) operator can be used:
ValueOptions :
{
None,
Not, // if selected, the filter will result true only if
// search string was not found
SearchInSons, // if selected, string will be searched
// in field and all its sons, if for
// example the not option was selected,
// than only if search string was not
// found in any of the field sons, the
// search result will be true
Exists // if selected, return value is true if field
// exists regardless its value
}
StringOptions
{
InHint = 0x1, // search in field hint
InDescription, // search in field description (i.e.
// meaning)
InValue, // Search in field value string (not the
// numeric value, but hte string
// displayed as field value)
CaseSensitive,
// if selected, comparison will be case
//
sensitive
Exact,
// if selected, search string must fit
// the
field text (same length and
// content)
RemoveBlanks,
// if selected, the filter will result
// true
only if search string was not
// found
Not, // if selected, the filter will result
// true only if search string was not
// found
SearchInSons // if selected, string will be searched
// in field and all its sons, if for
// example the not option was selected,
// than only if search string was not
// found in any of the field sons, the
// search result will be true
}