Records
Records
- Subject: Records
- From: Simon Forster <email@hidden>
- Date: Wed, 28 Feb 2001 07:30:30 +0000
I'm writing an AppleScript CGI and I thought that it'd be neat to use a
record to store name value pairs as I haven't used a record in anger before.
I can parse a typical get string out to a list without problem but don't see
how one can dynamically create a record. Coercion to a record is not
possible according to the AppleScript Language Guide, so how to create one?
There must be an answer - no doubt an obvious one, but I can't see it.
As an example, given a list of:
{"name=fred", "path=1234"}
How do I get to a record of:
{name:"fred", path:"1234"}
At the moment I'm explicitly declaring a record with empty name and path
properties and then looping through the list to find the appropriate values
to drop in. This'll work fine in this instance but isn't terribly elegant
and is definitely not very extensible.
So, can one create records dynamically? If so, what am I missing?
TIA
Simon Forster
________________________________________________
LDML Ltd, 28 Montgomery Road, London, W4 5LZ, UK
<tel int="+44 20 8995 5694" uk="020 8995 5694">
<fax int="+44 20 8995 6013" uk="020 8995 6013">
<
mailto:email@hidden>
________________________________________________