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 J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 21 May 2009 09:47:58 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (53 lines)
On Thu, May 21, 2009 at 9:39 AM, Bill Steele <[log in to unmask]> wrote:
>
> set recordList to {}
> set oneRecord to {foo:1, bar:"hello"}
> set end of recordList to oneRecord
> set twoRecord to {foo:2, bar:"Goodbye"}
> set end of recordList to twoRecord
> repeat with aRecord in recordList
> if foo of aRecord is 1
> set stuffIneeded to aRecord
> end if
> end repeat
> --> returns the entire list.

Not OMM.  It does, however, return a reference to the first item of
the list ("item 1") rather than the actual record.


> set stuffIneeded to CONTENTS of aRecord

yup.

> Fairly easy to figure out (I managed), but not the way ordinary lists
> behave.

No, it's exactly the way ordinary lists of *references* behave,
whether the referenced items are records or application objects - or
other lists.  This exhibits the same behavior.

repeat with aList in { { 1, 2, 3 }, { 4, 5, 6 } }
    if item 1 of aList is 1 then
       set stuffIneeded to aList
    end if
end repeat
stuffIneeded


> --
>
>
> Bill Steele
> [log in to unmask]
>
> The ultimate confrontation:
> "You will be assimilated."
> "Exterminate! Exterminate!"
>



-- 
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2