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

system.verbs.builtins.html.directory.getFirstComment

on getFirstComment (adrinxstruct) {
	<<Changes
		<<11/26/2000; 10:28:32 AM by DW
			<<Created. Given an address in a compiled OPML structure, check the first subitem to see if it's a comment, if so, return the text, otherwise return the empty string. 
	try {
		local (adrsub = @adrinxstruct^ [1]);
		if adrsub^.["/atts"].isComment {
			local (s = xml.entityDecode (adrsub^.["/atts"].text, flAlphaEntities:true));
			if not (s beginswith "<") { //it's not a rule
				return (s)}}};
	return ("")}
<<bundle //test code
	<<dialog.alert (getFirstComment (table.getcursor ()))



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.