Apple Newton Utilities User's Guide Page 518

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 517
CHAPTER 12
Special-Purpose Objects for Data Storage and Retrieval
12-12 Using Special-Purpose Data Storage Objects
// decide to go back to the original
EntryUndoChanges(anEntry);
PlaySound(anEntry);
// clean up
foreach store in GetStores() do
begin
mySoup := store:GetSoup("foo:myApp:mySig") ;
if mySoup then
mySoup:RemoveFromStoreXmit(nil);
end ;
UnregUnionSoup("foo:myApp:mySig", '|foo:myApp:mySig|);
VBOs and String Data 12
In most cases, you should avoid using the & and && string-concatenation operators
with VBO-based strings. These operators work by allocating a new string in the
NewtonScript heap and copying data from its arguments into the new object. You
can run out of heap space easily when attempting this operation with large strings.
Instead, use the
StrMunger global function to concatenate two strings. The
following code fragment appends the
str2 string to the str1 string, increasing
the size of
str1 as necessary, regardless of whether str1 is VBO data or resident
in the NewtonScript heap.
StrMunger(str1, MAXINT, nil, str2, 0, nil);
The value of MAXINT is 1<<29-1 or 536870911; however, any number larger
than
StrLen(str1) works adequately.
Using Store Parts 12
This section describes how to create a store part and add soup data to it. This
discussion is followed by a description of how to access the store part’s soups
from your application.
Note that other representations may provide better space efciency or faster access
to data. Store parts are useful when you wish to avoid recoding soup data in a more
efcient representation, or when you need multiple indexes or some other
convenience that soup-based queries provide.
Page view 517
1 2 ... 513 514 515 516 517 518 519 520 521 522 523 ... 941 942

Comments to this Manuals

No comments