home *** CD-ROM | disk | FTP | other *** search
- !!script
- // Copyright ⌐ 1997-2000 - Modelworks Software
-
- /**
- @Tool: findLongLinesInOpenDocuments~finds long lines in all open documents.
- @EndTool:
- @Summary: findLongLinesInOpenDocuments~finds long lines in all open documents
- */
-
- var gOutput = getOutput();
-
- function DoCommand()
- {
- gOutput.clear();
- gOutput.writeLine("Looking for long lines:");
-
- var count = 0;
- var index = 0;
- var lineIndex = -1;
- var editor = getEditor(index++);
- while (editor)
- {
- var fileName = editor.path;
-
- var maxLineCount = editor.getLineCount();
- for (var i = 0; i < maxLineCount; i++)
- {
- // Only print out one message per line
- if (editor.getLineLength(i) > 80)
- {
- gOutput.writeMessage(fileName, i, editor.copy(lineIndex));
- count += 1;
- }
- }
- editor = getEditor(index++);
- }
- gOutput.writeLine("Found " + count + " long lines");
- }
-
- !!/script
-
-