The merge function is awesome!

Mark Waddingham mark at livecode.com
Fri Jan 18 06:22:45 EST 2019


On 2019-01-18 06:48, Geoff Canyon via use-livecode wrote:
> I was in the same position with merge(). If you haven't seen it 
> already,
> format() has some pretty amazing capabilities as well.

To answer your question about escaping - yes there is:

   [[[]] -> [
   [[]]] -> ]

Also the merge function has another feature (which I think was actually 
undocumented for a long time - although, for once, it is there now!):

   1) "[[ 1 + 2 ]]" -> 3 (function / expression evaluation)
   2) "<? if 1 + 2 is 3 then return true else return false ?>" -> 
(command / statement evaluation)

Basically (1) does the equivalent of 'value()' on the string enclosed in 
[[ / ]]; whilst (2) does the equivalent of 'do <script>' on the string 
enclosed in <? and ?>.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list