Re: FW: Making a list of lists
Re: FW: Making a list of lists
- Subject: Re: FW: Making a list of lists
- From: John Stewart <email@hidden>
- Date: Wed, 1 Jan 2003 17:30:01 -0500
On Wednesday, January 1, 2003, at 03:07 PM, Jerry Podhajsky wrote:
I'm sure this is really simple, but I can't seem to find
any good
reference on it. I want to make a list of lists:
set d1 to {date "9/8/20", 1}
set d2 to {date "1/1/02", 2}
set d3 to {date "12/1/02", 3}
set masterlist to {}
set masterList to d1 & d2 & d3 -- yields a string
concatenation of all
the list items.
The result I want is:
{{date "9/8/20", 1},{date "1/1/02", 2},{date "12/1/02",
3}}
All help appreciated.
jp
To build your list of lists in this particular instance:
set masterlist to {d1, d2} -- or {d1, d2, d3}
--> {{date "Tuesday, September 8, 2020 12:00:00 AM", 1}, {date
"Tuesday, January 1, 2002 12:00:00 AM", 2}}
-- and to add an item to a pre-existing list
set end of masterlist to d3
--> {date "Sunday, December 1, 2002 12:00:00 AM", 3}
return masterlist
--> {{date "Tuesday, September 8, 2020 12:00:00 AM", 1}, {date
"Tuesday, January 1, 2002 12:00:00 AM", 2}, {date "Sunday, December 1,
2002 12:00:00 AM", 3}}
John
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.