Re: Records
Re: Records
- Subject: Re: Records
- From: Emmanuel <email@hidden>
- Date: Thu, 3 Nov 2005 21:06:19 +0100
At 9:56 AM -0600 11/3/05, Luther Fuller wrote:
I don't work with records too often and I've run into
a couple of puzzling situations:
1.
A project I started earlier this year (in OS X 10.3) used records constructed
with vertical bar characters, for example: {|a|:somevalue, ...}.
AppleScript will no longer create new labels like this, but the old labels
still work. Why?
2. Suppose r is a record only one of whose labels is known.
For example, r = {a:somevalue, ... }.
I need to create a new record that contains everything in r
except property a. (I really, really need this!)
One would think this would be as easy as something like ...
set n to r
delete a of n
which, of course, doesn't work. Any ideas?
Looks like a job for good ol' Satimage.osax' "suppress item" command:
set r to {a:"somevalue", foo:"bar"}
suppress item "a" from r
--> {foo:"bar"}
Caveat: "suppress item" does not suppress the item from the original
record! "suppress item" returns the changed record but leaves the
original record unchanged.
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Records (From: Luther Fuller <email@hidden>) |