You are here: Elements > Methods > Format Methods

Format Methods

Format Methods are used to encode field values for display in the Frame Display window. The field value is implicitly passed to each method, as is the field size. The value that the method returns is a string.

Most of the methods that format single numeric values work with quantities of up to 64 bits. This applies to Binary, Decimal, Hex, IP Address, Octal and Time. If you try to use, say, Decimal to display the value of a field that is larger than 64 bits an error will be generated. Should you find a need to display a value that is larger than 64 bits as, say, a decimal then you would need to write a custom method for the purpose.

The StringOfXYZ methods can be used to display data from fields that are potentially larger than 64 bits. The StringOf methods may have unexpected results when used in conjunction with a RETRIEVE method, since they look directly at the data in the layer and not at the altered contents of the field. This is especially true when used with intra-frame methods, since the StringOf method will not look at the retrieved data value but will look at whatever happens to be below the bit pointer in the layer.

You can string two Format methods together using the ALSO keyword. For example, if you had a Field that contained the temperature and you wanted to make sure it was clear that the temperature was in Fahrenheit, you could write:

FIELD temperature (Fixed 2 Bytes) (Decimal) ALSO (Constant "Fahrenheit") "Temperature"

You can string together two Format methods but not more than that.