/* runs when worksheet title deleted */ wsdeltitle(h) { /* find window margin text */ handles = findtext("tag", "ws_title"); if (length(handles) == 1 && h == handles[1]) { setwsy(0, -1); } }