Apple Newton Utilities User's Guide Page 467

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 466
CHAPTER 11
Data Storage and Retrieval
Using Newton Data Storage Objects 11-35
Adding Entries to Soups 11
This section describes how to add a frame to a union soup or a specied member
soup in a union. For information on creating union soups, see “Registering and
Unregistering Soup Denitions” on page 11-33. For information on retrieving
union soups, see “Retrieving Existing Soups” on page 11-34.
You can use either of the
AddToDefaultStoreXmit or AddToStoreXmit
methods to save frames as soup entries. Both of these methods create a single soup
in which to save the new entry when the appropriate member of the union is not
already present on the store. The
AddToDefaultStoreXmit method adds its
entry to the member soup on the store specied by the user as the destination for
new entries. The
AddToStoreXmit method allows you to specify according to
store the member soup to which it adds the new entry.
Methods that create soup entries—such as the
AddToDefaultStoreXmit,
AddToStoreXmit, and AddXmit methods—destructively modify the frame
presented as their argument to transform it into a soup entry. Thus, any frame
passed to these methods must allow write access. If the original frame must remain
unmodied, pass a copy of it to these methods.
The following code fragment saves a frame in the default store member of the
myUsoup union by sending the AddToDefaultStoreXmit message to the
union soup object that the
RegUnionSoup function returns:
// register soup def’n or get reference to already registered soup
local myUsoup := RegUnionSoup('|myApp:mySig|, mySoupDef);
// add the entry and transmit notification
local myEntry := myUSoup:AddToDefaultStoreXmit(
{aSlot:"my data"}, // frame to add to soup
'|myApp:mySig|); // app that changed soup
The following code fragment saves a frame in the internal store member of the
myUsoup union by sending the AddToStoreXmit message to the union soup
object that the
GetUnionSoupAlways function returns:
// get pre-existing uSoup by name
local myUSoup := GetUnionSoupAlways("mySoup:mySig");
// add entry to member on internal store and transmit notification
local myEntry := myUSoup:AddToStoreXmit(
{aSlot:"my data"}, // frame to add to soup
(GetStores()[0]), // add to member on internal store
'|myApp:mySig|); // app that changed soup
Page view 466
1 2 ... 462 463 464 465 466 467 468 469 470 471 472 ... 941 942

Comments to this Manuals

No comments