Examples

Forgetting to Call EntryChangeXmit

Modifying entries can be deceptive. If you modify an entry and move forward and back again, you will see the modified entry. This is true even if you do not call EntryChangeXmit after the modification. The entry will eventually revert to the original, however, making this a deceptive change. Here is what causes the idiosyncrasy: entries are cached in memory, even if there are no references to them. When an entry is no longer in the cache it must be reread from the soup.

To test this, modify an address in the Names soup without calling EntryChangeXmit (a QuickTime movie of this example is available):

soup := GetUnionSoup("Names");
curs := soup:Query(nil);
e := curs:Entry();
e.address := "FooBar";
Open the Names application and scroll to the item you changed. You should see that the address is changed to "FooBar". Now, close the Names application and reset your Newton. Reopen the Names application and scroll to the item you changed. It should no longer appear as "FooBar", but as its original value.


Note:The moral of this example should be clear: always call EntryChangeXmit to update an entry in the soup.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996