Examples

Adding Slots to Entries in an Existing Soup

Adding entries to an existing soup is straightforward. A QuickTime movie of this example is available.You use the same steps as in the last example. You get a union soup, create a cursor, and move it to the entry. You add the slots to the entry by assignment. For example, an entry can get a new slot as easily as this:

anEntry.newSlot := "Dead Mystery Writer";
EntryChangeXmit(anEntry, '|ProgNewton:Calliope|);
Now if you print the entry you can see the new slot:

#440E875  {class: person, 
           version: 2, 
           sorton: "Christie Agatha", 
           address2: NIL, 
           addresses: [], 
           pagers: [], 
           address: NIL, 
           postal_code: "", 
           cardType: 1, 
           anniversary: NIL, 
           region: NIL, 
           _modTime: 48616550, 
           city: "London", 
           email: NIL, 
           bdayEvent: NIL, 
           title: NIL, 
           country: "England", 
           name: {honorific: NIL, first: "Agatha",
            last: "Christie", title: NIL, 
            class: person}, 
           company: "", 
           emailAddrs: [], 
           companies: [], 
           notes: NIL, 
           anniversaryEvent: NIL, 
           names: [], 
           phones: [NIL], 
           _uniqueID: 362, 
           bday: NIL, 
           emailPassword: NIL, 
          newSlot: "Dead Mystery Writer"}
The new slot will not be displayed in the Names application, however, even though Names will maintain the new slot for us. In our own program, we could display the new full name entry with the extra slots by simply taking them into account in our display routines.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996