Re: can I make a list of records?
Re: can I make a list of records?
- Subject: Re: can I make a list of records?
- From: Nigel Garvey <email@hidden>
- Date: Tue, 29 Jan 2002 16:25:35 +0000
Michelle Steiner wrote on Mon, 28 Jan 2002 23:56:37 -0700:
>
Curiouser and curiouser.
Hi, Michelle. I get the same results as you with all your test scripts,
with both AS 1.3.7. and AS 1.6.
>
set MyList to {}
>
set myFirstRecord to {a:1, b:2}
>
set mySecondRecord to {a:3, b:4}
>
set the end of MyList to myFirstRecord
>
set the end of MyList to mySecondRecord
>
>
--> {a:3, b:4}
This isn't MyList, but the result of setting the end of it to
mySecondRecord.
>
set MyList to {}
>
set myFirstRecord to {a:1, b:2}
>
set mySecondRecord to {a:3, b:4}
>
set MyList to MyList & myFirstRecord & mySecondRecord
>
>
--> {a:1, b:2}
This is really odd. Could it be that MyList is starting life as an empty
record rather than an empty list?
>
set MyList to {}
>
set myFirstRecord to {a:1, b:2}
>
set mySecondRecord to {a:3, b:4}
>
set the end of MyList to {myFirstRecord}
>
set the end of MyList to {mySecondRecord}
>
>
--> {{a:3, b:4}}
Again, the result of setting the *end* of MyList.
>
set MyList to {}
>
set myFirstRecord to {a:1, b:2}
>
set mySecondRecord to {a:3, b:4}
>
set MyList to MyList & {myFirstRecord} & {mySecondRecord}
>
>
--> {{a:1, b:2}, {a:3, b:4}}
What you'd expect from a concatentation of three lists - but not if
MyList is actually an empty record. Maybe {} is interpreted as a list or
a record according to the circumstances.
?
NG