Tuesday, August 18, 2009 at 7:53 PM.
howtoSuite.getSectionLabel
on getSectionLabel (linetext) { <<Changes <<8/5/08; 10:39:46 PM by DW <<Cribbed from scriptingNews.root. <<9/7/07; 8:57:53 AM by DW <<Factors some common code. local (i, label = linetext, ch); for i = sizeof (label) downto 1 { ch = label [i]; if (not string.isalpha (ch)) and (not string.isnumeric (ch)) and (ch != ' ') { label = string.delete (label, i, 1)}}; label = string.innerCaseName (label); <<bundle //limit length, 3/23/07 by DW <<local (maxlen = scriptingNewsStoriesWebsite.["#prefs"].maxfilenamelength - sizeof (".html")) <<if sizeof (label) > maxlen <<label = string.mid (label, 1, maxlen) return (label)}; bundle { //test code dialog.alert (getSectionLabel ("How about a T-shirt??"))}
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.