Description of Methods and Functions

Entry Functions

These are the global functions for entries. Applications often use only EntryChangeXmit and EntryRemoveFromSoupXmit. Other functions are used less often.


EntryRemoveFromSoupXmit(entry, changeSymbol)


This removes entry from its soup. The changeSymbol is a symbol specifying who made the change (it is usually an application symbol). If changeSymbol is nil, no change notification is done. For example:

namesSoup := GetUnionSoup("Names");
s := namesSoup:Query(nil);
e := s:Entry();
EntryRemoveFromSoupXmit(e, '|ProgNewton:Calliope|);
Print(s:Entry())
deleted

EntryChangeXmit(entry, changeSymbol)


This puts a modified entry back into the soup and updates modification time of the entry to reflect the current time. The changeSymbol is a symbol specifying who made the change (it is usually an application symbol). If changeSymbol is nil, no change notification is done. For example:

namesSoup := GetUnionSoup("Names");
s := namesSoup:Query(nil);
e := s:Entry();
Print(e);
{class: person,
 address2: NIL, 
 addresses: [], 
 pagers: [], 
 address: "217 Crocker Lane", 
 class: person, 
 postal_code: "44704", 
 cardType: 0, 
 anniversary: NIL, 
 region: "OH", 
 city: "Hillsdale", 
 email: NIL, 
 bdayEvent: NIL, 
 title: NIL, 
 country: NIL, 
 name: {class: person, first: "Royce", last: "Walthrop"}, 
 ...}

e.address := "123 Main Street";
EntryChangeXmit(e, 
  '|ProgNewton:Calliope|);
Print(e);

{class: person,
 address2: NIL, 
 addresses: [], 
 pagers: [], 
 address: "123 Main Street", 
 class: person, 
 postal_code: "44704", 
 cardType: 0, 
 anniversary: NIL, 
 region: "OH", 
 city: "Hillsdale", 
 email: NIL, 
 bdayEvent: NIL, 
 title: NIL, 
 country: NIL, 
 name: {class: person, first: "Royce", last: "Walthrop"}, 
 ...}

EntryUndoChangesXmit(entry, changeSymbol)


This routine rereads the original entry from its soup. Any changes made to entry since it was last read from or written to the soup are lost. The changeSymbol is a symbol specifying who made the change (it is usually an application symbol). If changeSymbol is nil, no change notification is done. For example:

namesSoup := GetUnionSoup("Names");
s := namesSoup:Query(nil);
e := s:Next();
Print(e);
{   sortOn: "LaGaly", 
   region: NIL, 
   name: { first: "Carolyn", 
           last: "LaGaly"}, 
   _uniqueID: 11, 
   _modtime: 47130480}
e.region := "CA";
Print(e);
{   sortOn: "LaGaly", 
   region: "CA", 
   name: { first: "Carolyn", 
           last: "LaGaly"}, 
   _uniqueID: 11, 
    _modtime: 47130480}
EntryUndoChangesXmit(e, '|ProgNewton:Calliope|);
Print(e);
{   sortOn: "LaGaly", 
   region: NIL, 
   name: { first: "Carolyn", 
           last: "LaGaly"}, 
   _uniqueID: 11, 
    _modtime: 47130480}

EntrySoup(entry)


This function takes an entry and returns its soup. The soup returned is not a union soup but the one on the entry's actual store. Here is an example of its use.

printDepth:=-1;
internalStore:=GetStores()[0];
Print(internalStore:GetSoup("Names"));
{#440F7F1}
externalStore:=GetStores()[1];
Print(externalStore:GetSoup("Names"));
{#440F991}
s := GetUnionSoup("Names");
Print(s);
{#440F979}
q := s:Query(nil);
e := q:Entry();
Print(EntrySoup(e));
{#440F991}
e := q:Next();
Print(EntrySoup(e));
{#440F7F1}

EntryStore(entry)


Similar to the last function, which returned an entry's particular soup, Entry-Store returns an entry's store. For example:

printDepth:=0;
Print(GetStores());
[{#44039B1}, {#4409BA1}]
printDepth:=-1;
s := GetUnionSoup("Names");
q := s:Query(nil);
e := q:Entry();
Print(EntryStore(e));
{#4409BA1}
e := q:Next();
Print(EntryStore(e));
{#44039B1}

EntryModTime(entry)


This returns the last modification time of entry. If entry has never been modified, it returns the time it was added to the soup. You must use this routine instead of directly accessing an entry's undocumented _modtime slot. The time is an integer equivalent to the minutes passed since midnight, January 1, 1904.


EntryUniqueID(entry)


This returns the unique ID of entry. You should use this routine instead of directly accessing the undocumented _uniqueID slot of an entry.


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

Last modified: 1 DEC 1996