Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.utilities.findObsoleteStuff
<<6/16/01; 10:17:24 AM by DW
<<A utility that searches all the source code for a string, listing occurrences outside of comments and radio.init.
if dialog.ask ("What string would you like to search for?", @scratchpad.lastsearchstring) {
local (lowerSearchString = string.lower (scratchpad.lastsearchstring)); //PBS 02/22/01: case-insensitive
local (ct = 0);
local (adroutline = @scratchpad.objectsThatContainString, insertdir = right);
bundle { //set up the outline
new (outlinetype, adroutline); edit (adroutline);
target.set (adroutline);
op.firstsummit ();
op.setlinetext ("Objects that contain \"" + scratchpad.lastsearchstring + "\" on " + clock.now () + ":")};
window.about ();
on dotable (adrtable) {
on addadr (adr) {
if adr == @scratchpad.lastsearchstring {
return};
local (s = string (adr));
local (pattern = "\"].");
local (ix = string.patternmatch (pattern, s));
if ix > 0 {
s = string.delete (s, 1, ix + sizeof (pattern) - 1)};
op.insert (s + " (" + sizeof (adr^) + ")", insertdir); insertdir = down};
local (adr);
for adr in adrtable {
case typeof (adr^) {
tabletype {
dotable (adr)}}
else {
try {
if string.lower (string (adr^)) contains lowerSearchString { //PBS 02/22/01: case-inensitive
addadr (adr)}}};
if (++ct % 1000) == 0 {
msg (ct);
filemenu.save ()}};
return (true)};
dotable (@radio);
op.firstsummit ();
edit (adroutline);
msg ("")}
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.