Apple Newton Utilities User's Guide Page 485

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 484
CHAPTER 11
Data Storage and Retrieval
Using Newton Data Storage Objects 11-53
mySoup:MakeKey(["12345678901234567890", 3,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
['name.first, 'cardType, 'name.last] )
returns the key value
["12345678901234567890", 3, "ABCDEFGHIJKLMNO"]
The next example illustrates the truncation of subkeys when the total key size is
greater than 80 bytes. In this example, the rst string in the
string array is so long
that it uses up the entire 80 bytes allocated for the key, with the result that the rst
string is truncated and the remaining key values are
nil. Evaluating the following
code fragment in the Inspector
mySoup:MakeKey(["12345678901234567890abcdefghijjlmnopqrstuvwxyz",
3, "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678901234567890"],
['name.first, 'cardType, 'name.last] )
returns the key value
["12345678901234567890abcdefghijjlmnopqr", NIL, NIL]
Missing elements in the string array are treated as nil values. For example, the
following code fragment is missing the second two elements of the
string array:
mySoup:MakeKey(["12345678901234567890],
['name.first, 'cardType, 'name.last] )
Evaluating this code fragment in the Inspector returns the key value
["12345678901234567890", NIL, NIL]
On the other hand, missing index paths cause this method to throw an exception. If
one of the index paths in a multiple-slot index is missing from the array passed as
the value of the
indexPath parameter, the MakeKey method throws a “soup index
does not exist”
evt.ex.fr.store -48013 exception.
Using Cursors 11
This section discusses the functions and methods used to work with cursor objects
returned by the
Query method of soups or union soups. Individual entries in soups
and union soups are manipulated by the entry functions described in the section
“Using Entries,” later in this chapter. This section describes
getting the cursor
testing validity of the cursor
getting the currently referenced soup entry from the cursor
moving the cursor
Page view 484
1 2 ... 480 481 482 483 484 485 486 487 488 489 490 ... 941 942

Comments to this Manuals

No comments