• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Anyone know how to set an arbitrary subset of record elements? (another reason that associative arrays would be nice)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Anyone know how to set an arbitrary subset of record elements? (another reason that associative arrays would be nice) (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: saving text as XPress tags
  • Next by Date: new folder / move all REVISITED
  • Previous by thread: Re: Anyone know how to set an arbitrary subset of record elements? (another reason that associative arrays would be nice)
  • Next by thread: Issue with files passed to subroutines
  • Index(es):
    • Date
    • Thread