Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!hsdndev!dartvax!Susan.A.Tenney From: Susan.A.Tenney@dartmouth.edu (Susan A. Tenney) Newsgroups: comp.sys.mac.hypercard Subject: Re: Variables in a list? Message-ID: <1991Mar26.145428.13626@dartvax.dartmouth.edu> Date: 26 Mar 91 14:54:28 GMT References: <4165@ac.dal.ca> Sender: news@dartvax.dartmouth.edu (The News Manager) Organization: Dartmouth College, Hanover, NH Lines: 29 In article <4165@ac.dal.ca> ireland@ac.dal.ca writes: > Can variables be put into a list and then referred to as items in that > list? I'd like to be able to do the following: > > on foobar > global G1,G2,G3 > put "G1,G2,G3" into myList > put 77 into item 2 of myList > end foobar > > I'd like the value of G2 to be set to 77. Unfortunately, all the above > does is replace G2 with 77 in myList. Being able to do something like > this would be an elegant solution to a scripting problem I have. > Anyone know how to do something like this? Try this: on foobar global G1,G2,G3 put "G1,G2,G3" into myList do "put 77 into" && item 2 of myList end foobar The "do" command executes "put 77 into G2". Susan Tenney Dartmouth College Computing Services