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

system.verbs.builtins.mainResponder.calendar.getLastAddress

on getLastAddress (adrcalendar) {
	<<Tue, May 23, 2000 at 5:43:46 PM by AR
		<<Old code
			<<on getLastAddress (adrcalendar)
				<<Notes
					<<Thu, 11 Mar 1999 19:54:50 GMT by AR
						<<adrcalendar is the address of a valid calendar structure.
						<<We return the address of the last element in the calendar.
						<<We throw a scriptError if adrcalendar does not point to a valid non-empty calendar structure.
				<<local (adryear, adrmonth, adrday, ix)
				<<on diveinto (parent, adrsibling)
					<<for ix = sizeof (parent^) downto 1
						<<try
							<<number (nameOf (parent^[ix]))
							<<adrsibling^ = @parent^[ix]
							<<return (true)
					<<return (false)
				<<if diveinto (adrcalendar, @adryear)
					<<if diveinto (adryear, @adrmonth)
						<<if diveinto (adrmonth, @adrday)
							<<return (adrday)
				<<scripterror ("Can't get the last address in the calendar because adrcalendar doesn't point to a valid non-empty calendar structure.")
	kernel (mrcalendar.getlastaddress)};
bundle { //test code
	dialog.notify (getLastAddress (@AndresFirstSiteManilaWebsite.["#discussionGroup"].calendar))}



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.