Indirection question
Jan Schenkel
janschenkel at yahoo.com
Wed Feb 19 15:19:00 EST 2003
--- Barry Levine <themacguy at macosx.com> wrote:
> I have a variable named "theM" in which I am storing
> any number of
> comma-delimited items. If I use the message box for
> something like
> "answer theM", I get a dialog with the list of the
> items in the var. So
> far, so good.
>
> I have other vars with similar names (theW, theH,
> etc.) that contain
> other comma-delimited lists. I also have another
> variable
> (currentLetter) whose content changes (in this case:
> from "M" to "W" to
> "H" and back again in no consistent order). I have
> to check the content
> of currentLetter before knowing which of these lists
> I must manipulate.
> What I'd like to do is something like:
>
> on mouseUp
> if currentLetter = "W" then put "theW" into theList
> (etc)
> answer theList
> end mouseUp
>
> Now, if I do this, the answer dialog shows "theW"
> instead of the
> contents of the var named theW. Obviously, I'm not
> referring to the
> variable in the appropriate manner.
>
> Any ideas?
>
> Thanks,
> Barry
>
Hi Barry,
I'd say the 'do' command is your friend :-)
on mouseUp
do ("put the" & currentLetter && "into theList")
answer theList
end mouseUp
Don't forget to declare theX as globals, or their data
won't be retrievable.
Hope this helped,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
More information about the use-livecode
mailing list