Comment about "do" (was clickLine/clickcharchunk)

dunbarx at aol.com dunbarx at aol.com
Tue May 7 22:45:56 EDT 2013


Richard.


Right on about the ubiquitous "text" property. Sure cuts through a lot of paperwork.


Craig.



-----Original Message-----
From: Richard Gaskin <ambassador at fourthworld.com>
To: use-livecode <use-livecode at lists.runrev.com>
Sent: Tue, May 7, 2013 10:30 pm
Subject: Re: Comment about "do" (was clickLine/clickcharchunk)


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

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 



More information about the use-livecode mailing list