Monday, November 08, 2010 at 12:00 AM.
scripting2Suite.server.getCalendarText
on getCalendarText (username, thedate, baseurl, adrcaltext, adrnextprevtext) { <<Changes <<6/6/10; 2:05:47 PM by DW <<Created. local (adrdata = scripting2suite.inituser (username), pattern = "<%xxx%>"); local (pt, pta = @pt); new (tabletype, pta); html.setpagetableaddress (pta); local (myt = "<font size=\"+0\"><center><b>***</b></center></font>"); local (dnt = "<font size=\"-2\" color=\"gray\"><center>***</center></font>"); local (dt = "<font size=\"-2\" color=\"black\"><center>***</center></font>"); caltext = mainresponder.calendar.draw (@adrdata^.calendar, pattern, colWidth:19, rowHeight:10, tableBorder:0, monthYearTemplate:myt, dayNameTemplate:dnt, dayTemplate:dt, curdate: thedate); bundle { //hack up the urls, 6/9/10 by DW local (ix, s = ""); loop { ix = string.patternmatch (pattern, caltext); if ix == 0 { break}; s = s + string.mid (caltext, 1, ix-1); caltext = string.delete (caltext, 1, ix-1 + sizeof (pattern)); <<caltext = string.delete (caltext, ix, sizeof (pattern)) caltext = string.insert (baseurl, caltext, 1); ix = string.patternmatch ("\">", caltext); caltext = string.insert (".html", caltext, ix)}; caltext = s + caltext}; adrcaltext^ = caltext; adrnextprevtext^ = mainresponder.calendar.getlinks (@adrdata^.calendar, thedate, baseurl, date ("4/1/97"))}; bundle { //test code local (tc = clock.ticks ()); for i = 1 to 10 { getCalendarText ("davewiner", clock.now (), "http://scripting.com/", @s, @ss)}; dialog.alert (clock.ticks () - tc); <<webbrowser.displaytext (s) op.newoutlineobject (s, @scratchpad.caltext2)}
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.