ScanScript

Are you picky about your scripts?



Description

Reads specified file, displays subroutine structure and identifies unreferenced objects.

Version

1.2

Last Mod

April, 2008

Client

NA

Language

VbScript/HTA

Finish Level

Application

Description

Reads script, displays list of subroutines and selected information for each. With no options, only the routines’ name and type are declared, in the order they appear in the script. Optionally more information, including variable declaration/usage is included.

Configuration

There is no configuration, unless you would like to edit the script body to change the default state of the option checkboxes. You may call the script with a command line argument to auto-load the target script.

      ScanScript.hta /FilePath\FileName

You may wish to configure your editor to call this tool from within your workspace.

Execution

As shown in the image, below, the application displays script information in a scrolling text window after clicking the Analyze button.

The window content above is the built-in help text.

The default options execute quickly for all scripts. Selecting the Variables option, for scripts of more than a few hundred lines, may take a while to process.

Options

          Declared On – Displays the beginning/ending line number of the routine. If the routine name is not referenced the following is displayed: Referenced: Nowhere, I'm event code or an orphan...

          Note: In an HTA file, subroutines referenced via the OnClick property of an object event will not be recognized.

          Parameters – Displays the routine’s parameters, if any.

          Called From – Displays line numbers that reference the routine. To register properly, the SUB routine call should be preceded by the optional keyword, CALL.

          Variables – This displays Global variables, including CONSTants, and local variables declared within subroutines. This assumes the Option Explicit statement is present, and all variables are declared with a DIM statement, either individually or in a group on the same line of code.

          Append – Each time the Analyze button is clicked, window content is replaced. If you would like to append a new analysis to the existing window, select the Append option. Be sure to scroll to the appropriate content within the output window. There is a timestamp at the end of each analysis.

          Trim – Selecting this option removes trailing whitespace from lines with text. Spaces and tabs are removed. Whitespace is not removed from otherwise blank lines.

          Browse – The Browse feature may not work on OS versions after WindowsXP. If needed, type/paste the target file name in the Script textbox.

Documentation

Only this document. Basic help information available within the application.

Download

Home Up