|
Data on a Newton is stored in Soups. A soup is a collection of similar data
(apparently it got it's name because you can dip into it and ladle out the
data you are looking for.) Each piece of data is called an Entry. Before
I can describe an entry, I must first lay a sort of foundation of NewtonScript. NewtonScript is the programming language in which most of the applications on the Newton are written. It's derived from several languages, such as SmallTalk, Lisp, C, and Pascal, although it is superficially most like Pascal in it's syntax. There are several concepts unique to NewtonScript (though other languages may have similart ideas.) The most important is the Frame (similar to a structure in C.) A frame can be thought of as a group of labeled objects. It is written like this: {In the first column are the Slot names, and the second column the
Slot contents. A Slot name is a symbol...a type of string, basically. The
contents of the slot can be anything, even another frame. There is no minimum
or maximum to the number of slots in a frame.Now, back to entries and soups. An entry is merely a special frame, with a few extra slots in it. Here's a sample entry from the Names file (the soup is named: "Names"): {Some of this information is pretty self explanatory, such as the
'company, 'address, and 'city slots.
(Note: When referring to symbols outside of frame slots, you place a ',
or tick, before their name.) 'Phones is an array of phone numbers
(the system uses something called a Class to keep track of the type of phone
number, fax, home, what have you,) and 'emailAddr is an array
of email addresses (ditto.) 'CardType tells the Newton what
card design you prefer for this card. All of these slots will usually only
be found in Names entries.The last two slots here, '_uniqueID and '_modTime
are appended to every soup entry in the Newton. The first is basically the
order that the entry was added to the soup, while the second is the last
time the entry was modified (times on a Newton are expressed in terms of
the number of minutes passed since midnight, on January 1, 1904.)Other soups on the Newton include "Notes", "Calendar", "Packages", and "System". The first three are pretty self explanatory, the last contains application preferences. Each entry in each soup may have separate slots from any other, but usually there are certain common slots throughout a soup. If you need to sort a soup's entries by a certain value (say, a number or alphabetically), you can use an index. For example, the Names soup is indexed on the 'sortOn slot. When you create a new name card, the Names
file places either the company name or the last name into this slot. Now,
when the names soup is referenced on the 'sortOn slot, it will
go alphabetically, by either last name or company name (this referencing
is called a Query.) |