javascriptconstant(
VALUE
)

The javascriptconstant( function converts an expression into a JavaScript literal.


Parameters

This function has one parameter:

value – value to be encoded. This value may be text, in which case it will be properly quoted. Any special characters in the text will be escaped. The value may also be numeric, in which case it is passed thru “as-is”.


Description

This function converts an expression into a JavaScript literal. If the formula value is text, the function surrounds the text with double quote characters, and escapes any double quote and/or backslash characters within the text. If the value is numeric it is simply converted to text.

javascriptconstant("Hello World") ☞ "Hello World"
javascriptconstant("He said ""hello"" then he left") ☞ "He said \“hello\“ then he left"
javascriptconstant(3264) ☞ 3264

See Also


History

VersionStatusNotes
10.2NewNew in this version.