Re: Anyone know how to set an arbitrary subset of record elements? (another reason that associative arrays would be nice)
Re: Anyone know how to set an arbitrary subset of record elements? (another reason that associative arrays would be nice)
- Subject: Re: Anyone know how to set an arbitrary subset of record elements? (another reason that associative arrays would be nice)
- From: Timothy Bates <email@hidden>
- Date: Sun, 09 Sep 2001 11:54:09 +1000
On 9/9/01 8:26 AM, "Shane Stanley" <email@hidden> wrote:
>
On 9/9/01 12:01 AM +1000, Timothy Bates, email@hidden, wrote:
>
> how can I update an arbitrary subset of the feidls of a record?
Shane Stanley wrote back
>
If I understand what you want correctly, you can just concatenate:
>
set pParameters to {prefix:"", suffix:"", maxLength:""}
>
set pParameters to {prefix:"test1", maxLength:"31"} & pParameters
Wow! That is fantastic. I did not realise that that was part of the record
functionality. Neat!.
So, just ot put Shane's advice into words:
When you say record1 & record2, you get back the values of record 1 plus any
key/value pairs in record2 which do not appear in record1. This allows you
to say:
set newRecord to keyToUpdate & oldRecord
Without knowing what the contents of the keytoupdate are: if they exist in
oldrecord, the values will be overwritten, if not, they will be appended.
thanks shane,
tim
Dr Timothy Bates <
mailto:email@hidden>
Macquarie Centre for Cognitive Science (MACCS)
Macquarie University
Ph 61 (2) 9850 8623
Fx 61 (2) 9850 6059