merge

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
merge(<stringToEvaluate>)
Summary

Evaluates any expressions in a string, replaces them with their value, and returns the transformed string.

Introduced1.1
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
stringToEvaluate

A string of any length, which may include expressions enclosed in double square brackets ([[expression]]) and return statements enclosed in "?"and "?" (?return expression?).

Example
merge("1+1 equals [[1+1]]") -- returns "1+1 equals 2"
merge("The current folder is [[the defaultFolder]]")
Values
NameTypeDescription
return

The merge function returns a string.

The result

Use the merge function to combine text with the result of evaluating expressions in a single string.

RelatedKeyword: string
Function: value
Glossary: statement, evaluate, return, expression
Control Structure: return, function
Description

The merge function Evaluates any expressions in double square brackets, and replaces them with the expression's value.

It also executes any return statements enclosed in "<?" and "?>", and replaces them by the value returned.