C H A P T E R 1 1
Data Storage and Retrieval
Using Newton Data Storage Objects
global function returns an array of references to all currently
available stores. You can send the messages described in this section to any of the
store objects in this array.
local allStores := GetStores();
W A R N I N G
Do not modify the array that the
You can reference individual stores in the array by appending an array index value
call, as in the following code example:
local internalStore := GetStores();
The first element of the array returned by the
function is always the
internal store; however, the ordering of subsequent elements in this array cannot be
relied upon, as it may vary on different Newton devices.
Don't call the
function from your application's
method, or you may find yourself looking at the
"Newton needs the card..." slip. You can avoid this situation by
store method to test the validity of a store
object before sending messages to it.
Retrieving Packages From Stores
global function returns an array of packages currently available
to the system; this array contains packages that reside on any currently available store.
To determine the store on which a specified package resides, test the value of the
slot in the package reference information frame associated with the
package. This frame is returned by the
To load a package procedurally, use either of the store methods
. For more
information, see the descriptions of these methods in "Data Storage and Retrieval
Reference" (page 9-1) in Newton Programmer's Reference.
Testing Stores for Write-Protection
The store methods
determine whether a
store is write-protected. The former throws an exception when it is passed a
reference to a write-protected store, while the latter simply returns the value