Skip to main content

Typed Value Creation

AMPS includes functions for explicitly constructing constant values of various types.

FunctionParametersDescription
FALSE_VALUEnone

Returns a boolean false value.

This function is most useful for constructing values in message types that have a distinct type for boolean values.

In the AMPS expression language, false is equivalent to a literal 0.

TRUE_VALUEnone

Returns a boolean true value.

This function is most useful for constructing values in message types that have a distinct type for boolean values.

In the AMPS expression language, true is typically represented with a literal 1.

NAN_VALUEnoneReturns a NaN (not a number) value.
CHAR_VALUEinteger (0-255)

Returns the character (byte) for the integer provided.

This function is most useful for constructing values in message types that have a distinct type for char values.

In the AMPS expression language, a single character value is equivalent to a string constructed with an escape, and constructing a string literal is more efficient. That is, '\x01' is more efficient in a filter or field construction than CHAR_VALUE(1).

However, to construct a character based on a field, use CHAR_VALUE. For example: CHAR_VALUE(/code).