holidng another variable name within a variable

dunbarx at aol.com dunbarx at aol.com
Thu Jun 14 12:59:51 EDT 2012


Way back In HC days, Danny Goodman wrote the only tract on this subject, that two levels of evaluation are sometimes required to manipulate data. One example was in certain instances of putting text into a recently executed function, like "the foundChunk". You could not just:


put myText into the foundChunk.


You had to:


do "put" && myText" && "into" && the foundChunk --or somesuch


The instances where this is needed were learned by experience, frustration and luck.


Same with embedded text, a variable within a variable, so to speak. You must evaluate twice, as you did by longhand, or use a "do" construction for brevity.


I have always wanted a more definitive expose on this subject. Danny's comment was "...(the first evaluation) is not reduced enough for Hypercard to accept it as a valid container". (HCHB, 4th edition).


Craig Newman



-----Original Message-----
From: Dr. Hawkins <dochawk at gmail.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Thu, Jun 14, 2012 11:23 am
Subject: Re: holidng another variable name within a variable


On Thu, Jun 14, 2012 at 8:08 AM, Mark Schonewille
<m.schonewille at economy-x-talk.com> wrote:
> Here's an example:
>
> put "some text" into myVar
> put "myVar" into myVarName
> do "put" && myVarName && "into myLastVar"
> put myLastVar --> some text

Thanks.

And then I tried value() a second time, and it did it.

I'd forgotten all about "do" . . .


Thanks


-- 
The Hawkins Law Firm
Richard E. Hawkins, Esq.
(702) 508-8462
HawkinsLawFirm at gmail.com
3025 S. Maryland Parkway
Suite A
Las Vegas, NV  89109

_______________________________________________
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