merge
- function
- The merge function will scan a text string for SenseTalk variables or expressions enclosed in double-square-brackets ( [[ and ]] ) and replace those expressions with their values:
put merge("A week has [[24*7]] hours")
—> "A week has 168 hours"
In addition to expressions, the embedded code may include full SenseTalk statements, including repeat loops:
put ("apple", "banana", "orange", "pineapple") into list
put merge(<<List contains the following items:[[
repeat with n = 1 to the number of items in list]]
Item [[n]]: [[item n of list]][[end repeat]]
That's all!>>)
which produces the following output:
List contains the following items:
Item 1: apple
Item 2: banana
Item 3: orange
Item 4: pineapple
That's all!