MACSCRPT Archives

May 2009

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:
Bill Steele <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 19 May 2009 16:36:44 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
I see many examples of lists of records.  E.g....

set theRecords to {{foo:1, bar:"hello"}, {foo:2, bar:"Goodbye"}}
foo of item 2 of theRecords
--> 2

But how do you create such a list?

set recordList to {}
set oneRecord to {foo:1, bar:"hello"}
set recordList to recordList & oneRecord
-->{foo:1, bar:"hello"}
set twoRecord to {foo:2, bar:"Goodbye"}
set recordList to recordList & twoRecord
recordList
-->{foo:1, bar:"hello"}

Apparently records refuse to concatenate into a list.

Also tried this:

set recordList to {{}}
set oneRecord to {foo:1, bar:"hello"}
set recordList to recordList & oneRecord
-->{foo:1, bar:"hello"}
set twoRecord to {foo:2, bar:"Goodbye"}
set recordList to recordList & twoRecord
recordList
--> {{}, 1, "hello", 2, "Goodbye"}

It adds the contents o\f the records to the list, but not the complete records.

What am I missing?
-- 

Bill Steele
[log in to unmask]

ATOM RSS1 RSS2