Skip to main content

Expression.Constant

Returns the M source code representation of a constant value.

Syntax​

Expression.Constant(
value as any
) as text

Remarks​

Returns the M source code representation of a constant value.

Examples​

Example #1​

Get the M source code representation of a number value.

Expression.Constant(123)

Result:

"123"

Example #2​

Get the M source code representation of a date value.

Expression.Constant(#date(2035, 01, 02))

Result:

"#date(2035, 1, 2)"

Example #3​

Get the M source code representation of a text value.

Expression.Constant("abc")

Result:

"""abc"""

Category​

Expression