background image
C H A P T E R 1 9
Built-in Applications and System Data
19-12
Dates
Deleting Meetings and Events
19
The Dates application provides three methods for deleting meetings or events:
DeleteAppointment
,
DeleteRepeatingEntry
, and
DeleteEvent
.
These three methods all take the same parameters, as in
DeleteAppointment(
mtgTextOrFrame
,
mtgStartDate
,
deleteOneOnly
)
. The
meeting or event to be deleted can be identified in one of two ways:
By matching the title (in the mtgTextOrFrame parameter) and the start date (in
the mtgStartDate parameter) of the meeting or event.
By passing in a meeting frame for the mtgTextOrFrame parameter. A meeting
frame can be obtained either by calling one of two searching methods
(
FindAppointment
or
FindExactlyOneAppointment
) described in
"Finding Meetings or Events" (page 19-13), or by querying one of the Dates
soups, described in "Dates Soup Formats" (page 16-56) in Newton
Programmer's Reference
.
As is explained in "Using the Dates Soups" (page 19-22), repeating meetings and
events are stored as a single soup entry (meeting frame) in either the "Repeat
Meetings" or "Repeat Notes" soups. Calling
DeleteAppointment
or
DeleteEvent
with a meeting title and start date (as in the first bullet above)
deletes only that instance of a repeating meeting or event. However, calling one of
these methods with a meeting frame (as in the second bullet above) stored in one of
these two soups deletes the entire series.
DeleteRepeatingEntry
deletes the
entire series of repeating events or meetings, regardless of whether a meeting frame
or the title and start date of an event or meeting is used.
Here are some examples of deleting meetings or events of different types:
To delete a meeting by title/start time:
GetRoot().calendar:DeleteAppointment ("lunch with Ellen",
StringToDate("6/30/95 11:30am"), true);
To delete the same meeting passing in a meeting frame returned by
FindExactlyOneAppointment
:
GetRoot().calendar:DeleteAppointment
(GetRoot().calendar:FindExactlyOneAppointment
("lunch with Ellen",
nil,
StringToDate("6/30/95 11:30am"),
'Meeting),
nil,
// these last two params. are ignored when
nil); // supplying a meeting frame.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна