Skip to main content

##quoteExp

Takes as an argument an expression that gets evaluated during compilation. This expression can contain nested/recursive MPP functions.

Description

This macro preprocessor function takes as an argument an expression that gets evaluated during compilation. This expression can contain nested/recursive MPP functions. It then returns the complied result as a quoted string. If the argument already contains quote characters it escapes these quote characters by doubling them. It has the form:

##quoteExp(expression)

where expression may contain any of the following nested/recursive MPP functions: ##BeginLit...##EndLit, ##expression, ##function, ##lit, ##quote, ##quoteExp, ##SafeExpression, ##stripq, ##unique, and ##This.

By using ##quoteExp you can create a general-purpose complex global macro that accepts a variable number of subscripts and returns that reference as a quoted string, whether the subscript values are passed as numeric or string. You define a macro as a complex global reference using #def1arg directive. To return this complex global reference as a quoted string, regardless of the subscripts provided to the macro, wrap this macro in ##quoteExp. The macro evaluates the expression argument passed to ##quoteExp and returns this value as a quoted string.

For example:

#def1arg complexGlobal(%subs) ^GLO("dd"##expression($s(%literalargs'=$lb(""):","_$LTS(%literalargs,","),1:"")))
#def1arg complexGlobalQE(%subs) ##quoteExp($$$complexGlobal(%subs))
FeedbackOpens in a new tab