background image
C H A P T E R 1 1
Data Storage and Retrieval
Using Newton Data Storage Objects
You can use the
function to undo the changes to the
soup entry if you have not yet written the cached entry back to the soup. Because
this function throws away the contents of the entry cache, referencing a slot in the
entry after calling the
function causes entry data to be
read into the cache again.
Most applications unregister their soup definitions when they are closed or
removed. To facilitate the automatic creation of soups when the user files or moves
soup entries in the Extras drawer, you may want your soup definition to remain
registered while your application is closed--to unregister only when your
application is removed, call the
function from your application
) part's
The following code example uses the
function to unregister a
soup definition. Because a single application can create multiple soups and soup
definitions, soup definitions are unregistered by name and application symbol:
// usually in your app part's DeletionScript fn
Using Stores
Because the system manages stores automatically, most NewtonScript applications'
direct interaction with store objects is limited. This section describes the use of
system-supplied functions and methods for
getting store objects
retrieving packages from stores
testing stores for write protection
getting and setting store information
Procedures for manipulating other objects that reside on stores (such as soups,
store parts and virtual binary objects) are described in "Using" sections for each of
these objects; for detailed information, see "Using Soups" on page 11-32; "Using
Virtual Binary Objects" on page 12-8; and "Using Store Parts" on page 12-12.
Store Object Size Limits
The system imposes a hard upper limit of 64 KB on store object sizes for any kind
of store. SRAM-based stores impose a further limitation of 32 KB on block size.
Trying to create an entry larger than 32 KB causes the system to throw
exceptions. These limits apply to the encoded form the
data takes when written to a soup, which varies from the object's size in the
NewtonScript heap.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна