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:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 19 May 2009 16:52:35 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
On May 19, 2009, at 4:36 PM, Bill Steele wrote:

> I see many examples of lists of records.  E.g....
>

Try this.

set arec to {foo:1, bar:"a"}
set alist to {}
repeat 3 times
	copy arec to end of alist
end repeat
alist

When you concatenate it coerces what ever you are adding into either a  
string or a list.  Since records can be coerced into lists it makes it  
a list rather than a list containing a record.

If you want to use concatenation make it a list first.

set arec to {foo:1, bar:"a"}
set alist to {}
repeat 3 times
	set alist to alist & {arec}
end repeat
alist

-Mark
Who is on facebook, looking like a pirate.

ATOM RSS1 RSS2