Constant

Description:

The method Constant is an exception among format methods in that it does not actually format anything or even make use of the field value. Rather it passes on for display a string passed as a parameter.

One time Constant is handy is when you want to add a units (or other) qualifier to a number as in:

FIELD port_speed (Fixed 2 Bytes) (Decimal) ALSO (Constant "bps")

One more valuable use for Constant is when we want to note if a particular field is present or not without needing to display its value. This typically fits when a PRINT_IFclause is used as in:

FIELD archive (Fixed 1 Bit) PRINT_IF (FieldIs EqualTo 1) (Constant "Archive") "Attribute" FIELD hidden (Fixed 1 Bit) PRINT_IF (FieldIs EqualTo 1) (Constant "Hidden") "Attribute"

Parameters:

[Required]

Str

"String to print"


Example:

FIELD command (Fixed 2) (Constant "AT Command") IN_SUMMARY "Address/Control