SaveData
viewDef:SaveData(entry)
Called when the current entry is about to be saved to the soup.
DISCUSSION
- entry
- The target entry to be saved. Note that the entry could be invalid or read-only; see the discussion.
- return value
- Return
true
(if you want the entry saved),nil
(if you haven't changed the entry), or the symbol'NoRealChange
(if you want the data saved, but the modification time not updated).
If there is data to be saved, modify entry to hold the new or changed data, and return
true
. Note that if you returnnil
, the soup entry may still be saved if it has otherwise been modified, for example, by the NewtApp framework. Returningnil
does not prevent the entry from being saved, it just notifies Newton Works that you didn't change it.To save the data but not mark the entry as changed, for example if the hilite location needs to be saved, return the symbol
'NoRealChange
, instead oftrue
. This tells Newton Works to save the changes to the soup entry, but not to update the modification time of the entry (as displayed in the title slip).It is possible for your *
SaveData
method to be passed an entry that is invalid or read-only. In the *SaveData
method, before you do begin any operations that write to the soup entry, you should perform this check:
If EntryValid(entry) and not EntryStore(entry):IsReadOnly()
then // do the operation
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help