Error getting tags :
error 404Error getting tags :
error 404 merge | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
merge
Basics
Expander triangle
Type
Function
Syntax
merge(stringToEvaluate)
Introduced
1.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Evaluates any expressions in a string, replaces them with their value, and returns the transformed string.
Examples

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

Additional Comments
Expander triangle

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

Parameters:

The stringToEvaluate is a string of any length, which may include expressions enclosed in double square brackets ([[expression]]) and return statements enclosed in "<?" and "?>" (<?return expression?>).

Value:

The merge function returns a string.

Comments:

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.

User Comments
Expander triangle
User thumbnail
rodney@oceanbrowser.com
StarStarStarStarStar
Oct 20, 2009
See discussion on use of merge to make code containing quotations easier to read: http://runrev.com/newsletter/august/issue55/newsletter2.php
e.g. for example:
on mouseUp put quote & "Foobar" & quote && the short name of this stack \ & return & \ the layer of this card && "/" && the short ID of me into \ tVariable end mouseUp
... can be written:
on mouseUp put merge(&quot;[[quote]]Foobar[[quote]] [[the short name of \ this stack]]&quot;) & return & \ merge(&quot;[[the layer of this card]] / [[the short ID \ of me]]&quot;) into tVariable end mouseUp