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

system.verbs.apps.AnArchie.examples.findAndOutline

if (dialog.ask("Enter the string to find", @searchStr)) {
	if (Frontier.isRuntime()) { << no outlining in Runtime :(  
		if (dialog.yesNo("Runtime is unable to outline things.  Shall I simply write the results to a file?")) {
			if (file.putFileDialog("Where do you wish to save the results?", @fName)) {
				bundle { << prep the file
					file.new(fName);
					file.setType(fName, 'TEXT');;
					file.setCreator(fName, 'ttxt')};
				file.open(fName);
				with anarchie, eventInfo, examples {
					results = find(searchStr);
					loop (x=1;x<=sizeof(results);x++) {
						aRec = results[x];
						recData = aRec[host] + tab + aRec[path] + cr;
						file.write(fName, string(recData))}};
				file.close(fName)}}}
	else {
		with anarchie, utilities, examples {
			results = find(searchStr);
			Frontier.bringToFront();
			outlineResults(@results, true, @scratchpad.searchResults);
			organizeOutline(@scratchpad.searchResults)}}}



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.