
Newton Data Storage
Examples
In this next section, we give you some sample code that uses these various soup and cursor functions. From these examples, you should be able to get a reasonable idea of how to implement the same methods in your own code. Here is what we implement:
- Set up procedures to print all the names in the "Names" soup in both unsorted and sorted order.
- Show you three different ways to print all the names beginning with "K" in the Names soup.
- Change an entry in an existing soup.
- Add slots to entries in an existing soup.
- Find all the names that match a string.
- Remove a store while a cursor is iterating.
- Remove an entry while a cursor is iterating.
- Show you what happens when you forget to call
EntryChangeXmit
.
- Printing All the Names in the Names Soup
-
- Printing All Names Beginning with "K"
-
- Changing an Entry in an Existing Soup
-
- Adding Slots to Entries in an Existing Soup
-
- Finding All Names Matching a String
-
- Removing a Store While a Cursor Is Iterating
-
- Removing an Entry While a Cursor Is Iterating
-
- Forgetting to Call EntryChangeXmit
-
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996