Jump to content

Recommended Posts

Posted (edited)

Have you ever spent more time than you really had available tracking down where a duplicate function name or variable declaration was?

How about taking a working script from one machine to another, only to find that either a needed UDF was missing, or a different version?

I wrote this little tool to help me out. It will scan through the script and all its include files, record global variables, functions, and include files. It then provides you with a report.

It is not a beautiful solution, but does the trick.

Limitations:

  Reveal hidden contents

Currently, only variables explicitly created using the Global keyword are included.

Does not support "portable" AutoIt setups

Drag and drop works, or you can do /? for a help screen with more detailed control.

Latest Version: (1.0.0.35)

https://www.dropbox.com/s/p4xnb5u7i64v57q/ScriptScanner.exe

Old Versions:

  Reveal hidden contents

Scriptscanner_10.zip

Edited by willichan
Posted (edited)

I tested it and it appears you're not taking into consideration includes in the AutoIt directory.

Input:

#include <Array.au3>
#include <File.au3>

Example()

Func Example()
    Local $aArray = 0
    _FileReadToArray(@ScriptFullPath, $aArray)
    _ArrayDisplay($aArray)
EndFunc   ;==>Example

Output:

Files
=====
c:usersguinnessdesktoparray.au3 *
c:usersguinnessdesktopexample_test.au3
c:usersguinnessdesktopfile.au3 *

  (* = Encountered at least one file read error)

Functions
=========
example()
  File: c:usersguinnessdesktopexample_test.au3
  Line: 6

Global Variables
=========

Includes
========
c:usersguinnessdesktoparray.au3
  File: c:usersguinnessdesktopexample_test.au3
  Line: 1
c:usersguinnessdesktopfile.au3
  File: c:usersguinnessdesktopexample_test.au3
  Line: 2

I don't have AutoIt & SciTE installed as I'm using my custom Portable launcher.

Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

  On 12/8/2012 at 12:00 AM, 'guinness said:

I tested it and it appears you're not taking into consideration includes in the AutoIt directory.

I don't have AutoIt & SciTE installed as I'm using my custom Portable launcher.

guinness,

Thanks for taking a look.

I didn't take portable versions into account. The scanner looks at the registry to see where the Autoit directory is, and where any personal include folders are. I will have to set up a "clean" box that does not have Autoit installed, so I can test and account for the portable version.

  • 3 months later...
Posted

  On 3/14/2013 at 7:13 AM, 'JohnOne said:

I think an improvement might be the ability to exclude files/folders, such as standard includes folder and focus only on user scripts.

I will look into making exclusions available. The problem with that, though, is that you won't see where a duplicate variable or function name with a standard include exists. In the case I had when I initially wrote the script, two UDFs were both including file.au3, but one was including its own version, while the other was including the standard version. I would not have traced down the problem if I had skipped the standard includes.

Posted

I recently wrote code on how to parse includes. It's easy to find in the Forum.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...