resolve-var-syntax()

This function replaces all variable placeholders (several possible) like @MY_VAR@ in string a with the value of the variable(s) if the variable is defined in the profile (otherwise not).

If the variable value itself again contains a variable placeholder of the form @VAR_NAME2@, the function must be called again with the return value of the first call to guarantee the resolution of the variable placeholder contained in the value. If the resolution is already done in the first call, it would be random (cannot be guaranteed).

Parameters


Parameter

Description

a

Text containing the variable placeholders(s).

b

(optional) true to resolve date and time placeholders like <yyyy> or <HH> as well. Default: false.


Examples


Parameter a

Parameter b

Result

Comment

Hello world!

anything

Hello world!

No replacement needed.

Hello @VAR_SAMPLE@!

anything

Hello world!

If VAR_SAMPLE is defined and has the value world.

@VAR_GREETINGS@ @VAR_SAMPLE@!

anything

Hi all!

If VAR_GREETINGS is defined and has the value Hi and VAR_SAMPLE is defined and has the value all.

@VAR_GREETINGS@ @VAR_SAMPLE@!

anything

Hi @VAR_SAMPLE@!

If VAR_GREETINGS is defined and has the value Hi but variable VAR_SAMPLE is not defined.

Current time is: <HH>:<mm>

true

Current time is: 14:12

If the current time is 14:12.

Current time is: <HH>:<mm>

false

Current time is: <HH>:<mm>

No support of date and time placeholders.