Re: My Worrisome Lists :-)
Re: My Worrisome Lists :-)
- Subject: Re: My Worrisome Lists :-)
- From: Stephen Swift <email@hidden>
- Date: Mon, 04 Feb 2002 16:28:58 -0500
- Method-key: Ydco m.ooai. jrm.o uprm yd. e.ot ru Oy.ld.b Xgpbdam O,cuyv
At 2/4/02 9:25 AM, has (email@hidden) Wrote:
>
I must confess that I've kind of moved away from the record-as-hash
>
approach to using custom objects; the big advantage is that they're not
>
dependent on 3rd-party apps or osaxen, so are very portable. Plus, it's
>
pretty easy to customise them if you need extra features (they're plain AS,
>
and tend to be OO designs, so modifying/expanding them is a snap). It's
>
mostly down to what your requirements and/or personal preferences are.
What do you mean use custom objects? Could you give an example?
At 2/4/02 10:49 AM, Michael Sullivan (email@hidden) Wrote:
>
-->{hello:"goodbye",Brian:5,jane:6,leslie:{2,3}}
Hmm, I sort of like this idea except, how would I go about checking the
record?
Say I get a value of "hello" returned from my script. I want to add it to
my list of records *only* if the record hello doesn't already exist.
This would work *if* the two record's data were the same, but I think that
won't be the case.
set list1 to {hello:"goodbye"}
list1 contains ({{+class usrf;:{"hello", "goodbye"}}} as string as record)
How do I check if the list contains the record if the records have different
data?
>
Silly as it may sound, sometimes I wish there was a coercion string to
variable some days.
At 2/4/02 12:53 PM, Paul Berkowitz (email@hidden) Wrote:
>
I was a great user of 'collect items' and the other commands in Akua's List
>
Suite. But in more recent OS 9 releases (maybe 8.6 too, I forget) it seemed
>
to be faster to use a repeat loop than the osax. More _convenient_ to use
>
the osax, but usually slower.
I'm glad to hear this!
But now I want to know...
Which do you think is better,
-Using records (and having to resort to a hash of some sort) but being able
to go
set list1 to {hello:"goodbye", bob:3}
bob of list1
Or using a list and having to use a repeat loop to figure out the item # of
the specific item of the list?
I'm looking for the fastest, easiest to maintain, simplest, and shortest
script here. :-D
Stephen Swift
email@hidden
-----------------------------------------------
AppleScript Guru - The Mac Observer
http://www.macobserver.com/tips/applescript