Monday, November 08, 2010 at 12:00 AM.
scripting2Suite.oldstuff.getStoryLabel
on getStoryLabel (linetext) {
<<Changes
<<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 (getStoryLabel ("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.