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


on getIndexAddress (indexName) {
	<<Return the path to the guest database for this index.
		<<Make sure the database exists and is open.
	local (f = user.searchEngine.indexesFolder);
	local (fname = indexName);
	local (flWasOpen = false);
	if sizeOf (fname) > 21 {
		fname = string.mid (fname, 1, 21)};
	fname = fname + " Index.root";
	f = f + fname;
	file.sureFilePath (f);
	if defined ([f]) {
		flWasOpen = true};
	try {
		table.sureDatabaseOpen (@[f])}
	else { (f); (f)};
	if not flWasOpen {
		window.hide (@[f])};
	local (adrIndex = @[f].index);
	if not defined (adrIndex^) {
		new (tableType, adrIndex)};
	return (adrIndex)}

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.