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


on outlineResults (searchResults, sortList=nil, outlineAddr=nil) {
	local (x, count, dir = right);
	bundle { <<set up the outline
		if (outlineAddr == nil) {
			outlineAddr = @scratchpad.searchResults};
		if not defined (outlineAddr^) {
			new (outlineType, outlineAddr);
			target.set (outlineAddr);
			editMenu.setFont ("Monaco");
			editMenu.setFontSize (9);
			target.clear ()};
		edit (outlineAddr); <<user can see what's going on
		target.set (outlineAddr); <<user can bring a different window to front
		op.fullCollapse ();
		op.firstSummit ();
		if op.getLineText () == "" {
			op.setLineText ("Search Results " +}
		else {
			op.insert ("Search Results " +, up)}};
	dir = right;
	count = sizeof(searchResults^);
	for x = 1 to count {
		aRec = searchResults^[x];
		if (aRec[anarchie.eventInfo.isDirectory]) {
			op.insert(aRec[1] + " ", dir)}
		else {
			op.insert(aRec[1], dir)};
		dir = down; << after the first, insert down
		<<op.insert (searchResults^[x]['name'], dir)
		<<do all the subfields of the record
		with anarchie, eventInfo {
			op.insert("Host: "+aRec[host], right);
			op.insert("Path: "+aRec[path], down);
			op.insert("Size: "+aRec[fileSize], down);
			op.insert("Date: "+string(aRec[modification]), down)};
		op.collapse ()};
	bundle { <<restore the outline
		op.firstSummit ();
		if (sortList) {
			op.go(right, 1);
		target.clear()}}; << just in case!


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.