On 1/18/19 12:33 PM, kee nethery via use-livecode wrote:
Iām confused. Can someone explain why merge function exists when the put
function works just as well?
merge( [[ 1 + 2 ]] = 3)
vs
put 1 + 2 && ā= 3ā
What is it that merge can do that a put cannot do?
For me, it's convenience, precision, and readability (no need for all
those ampersands and quote marks.) I use it mostly for reports,
auto-generated emails from my server, and sometimes dynamic HTML
construction. It also eliminates the need for multiple "replace" commands.
For example, imagine a text template in a custom property named "cText":
Dear [[username]],
Thank you for your interest in [[productname]]. [[productname]] is
available for download at [[productURL]].
And the script:
put "John Doe" into username
put "Zygodact" into productname
put "http://mydomain.com//zygodact.html" into productURL
put merge(the cText of me) into tResponse
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode