共用方式為


Expression.Constant

語法

Expression.Constant(value as any) as text

關於

傳回 M 原始程式碼中對常數值的表示。

範例 1

取得數字值的 M 程式碼表示法。

使用方式

Expression.Constant(123)

輸出

"123"

範例 2

取得日期值的 M 程式碼表示。

使用方式

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

輸出

"#date(2035, 1, 2)"

範例 3

取得文字值的 M 原始碼表示法。

使用方式

Expression.Constant("abc")

輸出

"""abc"""