Comment about "do" (was clickLine/clickcharchunk)

Richard Gaskin ambassador at fourthworld.com
Tue May 7 22:29:06 EDT 2013


dunbarx wrote:

 > Danny Goodman once said that he was unsure where the disconnect took
 > place. He just said (paraphrased) "...when it seems like the code
 > ought to work, but doesn't, try a "do" construction..."

Ah, but Danny's moved on to JavaScript; he didn't stick around in the 
xTalk world long enough to appreciate one of LiveCode's many unique charms:

Almost every object that can act as a container has a text property, so 
we don't need to bother with the odd ambiguities the HyperCard team were 
enamored of by sometimes treating object references as objects and other 
times as containers, instead allowing us to enjoy the consistency of 
property-driven syntax.

So instead of problematic expressions like:

   put the focusedObject into tObject
   put resDate into tObject

..or the complex concatenated "do" form:

   do "put" && quote & resdate & quote && "into" && tObject

...we can simply write with confidence:

  set the text of tObject to resDate


the "do" command still has a place in LiveCode, but it's much less 
frequently-needed than in HyperTalk.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for Desktop, Mobile, and Web
  ____________________________________________________________
  Ambassador at FourthWorld.com        http://www.FourthWorld.com




More information about the use-livecode mailing list