Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: The all function.

From: ingo:2b1 at: 15-Apr-2002 10:40

Hi Louis, Dr. Louis A. Turk wrote: <...>
> What I am wanting to do is to make sure that the record is not already > in the database before I insert it. In other words, no duplicate > _records_ are allowed. Note, however, that although the records are > all unique, the code data is not necessarily unique, nor is the chknum > data. There may be many records with the same code, and also many > records with the same chknum. Only the code / chknum combination is > unique. > > So, do I perhaps need the records to look like this?: > > ] "bho" "5259" ; <===<<< TWO KEYS. > make object! [ > code: "bho" > chknum: "5259" > date: 27-Jul-2001 > amount: $100.00 > special: $0.00
well, I think this would get you into much trouble, but how about using a single key, that joins the two values?, e.g.
>> key: join join code "-" chknum
== "bho-5259" and then use ] "bho-5259" ; <===<<< ONE KEY, composed of TWO KEYS. make object! [ code: "bho" chknum: "5259" date: 27-Jul-2001 amount: $100.00 special: $0.00 I hope that helps, Ingo