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

	<<10/30/01; 2:19:49 AM by JES
		<<Open the Theme's table after reading the files.
	<<10/29/01; 11:11:44 AM by JES
		<<Created. Reads all of the text files in the www folder whose names begin with the # character, and saves them as a theme, in the table.
if not defined ( { = ""};
local (themeName =;
if not dialog.ask ("Enter a name for this theme:", @themeName) {
	return (false)};
local (themetablename = themeName);
bundle { //set themetablename
	local (i, ct = sizeOf (themetablename));
	for i = 1 to ct {
		if not (string.isAlpha (themetablename[i]) or string.isNumeric (themetablename[i])) {
			themetablename[i] = " "}};
	themetablename = string.innerCaseName (themetablename)};
local (adrtable =[themetablename]);
new (tableType, adrtable);
new (tableType, @adrtable^.info);
adrtable^ = themeName;
local (homefolder =;
on savefile (f) {
	local (fname = string.delete (f, 1, sizeOf (homefolder) + 1)); // + 1 for the # character
	local (flOutline = (string.lower (fname) endsWith ".opml"));
	fname = string.popSuffix (fname);
	local (adrobject = @adrtable^.[fname]);
	if flOutline {
		op.xmlToOutline (string (file.readwholefile (f)), adrobject)}
	else {
		wp.newtextobject (string (file.readwholefile (f)), adrobject)};
	setTimeCreated (adrobject, file.created (f));
	setTimeModified (adrobject, file.modified (f))};
fileloop (f in homefolder) {
	if file.fileFromPath (f) beginsWith "#" {
		savefile (f)}}; = themeName;
edit (adrtable);
return (true)

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.