C H A P T E R 1 1
Data Storage and Retrieval
Using Newton Data Storage Objects
for such stores. Do not use the global function
to test store objects;
use only the
store method for this purpose.
Getting or Setting the Default Store
The default store is that store designated by the user as the one on which new data
items are created. Normally, applications using union soups do not need to get or
set the default store. The system-supplied functions that accept union-soup
arguments handle the details of saving and retrieving soup data according to
preferences specified by the user.
If for some reason you need to get or set the default store yourself, you can utilize
Do not change the default store without
first notifying the user.
Getting and Setting the Store Name
Normal NewtonScript applications rarely need to get or set store names. A store's
name is the string that identifies the store in slips displayed to the user. The default
name for the internal store is "Internal" and a PCMCIA store is named "Card" by
default. The store methods
are used to get and set the
names of stores.
The following example uses the
method to obtain a string that is the
name of the internal store:
//returns the string "Internal"
Before attempting to set the store's name or write any other data to it, you can use
the store methods
to determine whether
the store can be written.
W A R N I N G
Renaming a store renders invalid all aliases to entries residing on
that store. See "Using Entry Aliases" on page 12-7.
Accessing the Store Information Frame
Each store may hold an optional information frame that applications can use to
save information associated with the store itself. Note that unless an application
stores data in this frame, it may not exist on every store.
store methods are intended for use by backup/restore
applications only; most applications need not use them at all. The