Monday, November 08, 2010 at 12:01 AM.


<<3/31/01; 8:22:10 PM by DW
	<<Step through this script in the debugger. It will show you the results it gets.

local (msgnum);
mailToTheFuture.init ();
bundle { //create a new message, sent to you, at 8AM tomorrow
	local (day, month, year, hour, minute, second);
	date.get (date.tomorrow ( ()), @day, @month, @year, @hour, @minute, @second);
	local (when = date.set (day, month, year, 8, 0, 0));
	msgnum = mailToTheFuture.addMessage (user.prefs.mailaddress, "Test message", "This is a quick test of MTTF.", when)};
bundle { //open the message in the browser
	webBrowser.openUrl ("$" + msgnum)};
bundle { //get the message back as a odb table
	scratchpad.mttfMessage = mailToTheFuture.getMessage (msgnum);
	edit (@scratchpad.mttfMessage)};
bundle { //tell me how many messages are in my queue
	dialog.alert (mailToTheFuture.getMessageCount ())};
bundle { //get all the messages in an odb table
	scratchpad.mttfMessages = mailToTheFuture.getAllMessages ();
	edit (@scratchpad.mttfMessages)};
bundle { //add and delete a message
	mailToTheFuture.deleteMessage (mailToTheFuture.addMessage (user.prefs.mailaddress, ":-(", "This message will never be sent", ()))}

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.