MACSCRPT Archives

July 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
David Livesay <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sat, 28 Jul 2007 06:17:55 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
On Jul 27, 2007, at 9:54 PM, RJay Hansen wrote:
> Thanks to everyone!
>
> I must admit I was kind of embarrassed to ask since this seemed  
> like it should be pretty basic.I knew I could count on this list to  
> get an answer. And I got a wide selection of methods to choose from!
>
> RJay

Just don't let it happen again. ;-)

I don't think anyone mentioned this permutation yet, but another way  
to add lists together and get a list of lists is to make each list a  
nested list from the get-go. Observe:

set nestedlist1 to {{"a", "b", "c"}}
set nestedlist2 to {{"one", "two", "three"}}
set nestedlist3 to {{"do", "re", "mi"}}
set nestedlist4 to nestedlist1 & nestedlist2 & nestedlist3

 >  {{"a", "b", "c"}, {"one", "two", "three"}, {"do", "re", "mi"}}

It's also worth mentioning how to refer to items in nested lists.

"one" is in list 2 of nestedlist4

 > true

first item of the last list of nestedlist4

 > "do"

There's something about those double quotes and double braces that  
always makes me think I need stronger reading glasses, especially  
with anti-aliasing.

ATOM RSS1 RSS2