Apple Newton Utilities User's Guide Page 519

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 518
CHAPTER 12
Special-Purpose Objects for Data Storage and Retrieval
Using Special-Purpose Data Storage Objects 12-13
Creating a Store Part 12
To create a store part, take the following steps using Newton Toolkit version 1.5
or greater:
Create a new project.
Select the Store Part radio button in the Output Settings dialog box. NTK disables
all other settings in this dialog box when the Store Part option is selected.
Congure the Package Settings dialog box as you normally would. The name
specied in this dialog box identies the store part to the system in much the
same way that a package name identies a package; thus, you need to ensure the
uniqueness of this identier by basing it on your developer signature in some way.
Add a new text le to the project. You’ll add to this document the NewtonScript
code that creates one or more soups to reside on the store part.
At compile time, NTK provides a global variable named
theStore, which
represents the store part (package store) you are building. Any changes made to
this variable are reected in the store part that is produced as the output of the build
cycle. Thus, to create your read-only soup, you can add to the text le some
NewtonScript code similar to the following example:
// some useful consts; note use of developer signature
constant kStoreName := "MyStore:MYSIG" ;
constant kSoupName := "MySoup:MYSIG" ;
constant kSoupIndices := '[] ;
// theStore is a global var provided by NTK
theStore:SetName(kStoreName) ;
// create the soup but don’t xmit at build time
local soup:=theStore:CreateSoupXmit(kSoupName,
kSoupIndices, nil);
// add a couple entries
soup:Add({anInteger: 1}) ;
soup:Add({anInteger: 2}) ;
When the package is built, NTK incorporates the store part in it.
Page view 518
1 2 ... 514 515 516 517 518 519 520 521 522 523 524 ... 941 942

Comments to this Manuals

No comments