Monday, November 08, 2010 at 12:06 AM.
system.verbs.builtins.webserver.standardMacros.counter
on counter (scriptName) {
local (x);
if not defined (webserver.utilities.counters) {
new (tableType, @webserver.utilities.counters)};
semaphores.lock (scriptName, 3600);
try {
if not defined (webserver.utilities.counters.[scriptName]) {
webserver.utilities.counters.[scriptName] = 0};
x = ++webserver.utilities.counters.[scriptName];
semaphores.unlock (scriptName)}
else {
semaphores.unlock (scriptName);
scriptError (tryError)};
return (string.addCommas (x))}
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.