Jump to content

Best way to tell if I need include or not

Recommended Posts

Other than seeing it (and ignoring it, sometimes) within the helpfile, is there an quicker and easier way to tell when an include is needed?


I spent a little time trying to debug some code before realizing I was missing the include all along. I can see the general error, error: %MacroName% undefined function, when I compile, but in my case I didn't bother looking at the top of the script (2,500 lines of code) to see if the include (UDF ?) was included. 

Link to post
Share on other sites


Welcome to the AutoIt forum

I just made up this tool that might be relevant for you try :


Not only that: It can list the includes without paging up to look if they exist :think:

if it is customarily used and considering the needed includes and other files exist in one configured location, the tool simply imports to the used script directory, all needed missing includes and files 
For now it won't tell you off missing files maybe I will add that at a later stage..


Edited by Deye
Link to post
Share on other sites


I use a tool that organizes the includes: https://www.autoitscript.com/forum/topic/111554-organize-includes-in-scite4autoit3/?tab=comments#comment-782390.

That shows you which includes are missing and which you can delete.





SciTE4AutoIt =   AutoIt =   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to post
Share on other sites

Inside SciTE, if you use it, you can run AU3Check, this will do a quick check of your code to see if you've made any mistakes. It will immediately tell you if you've used a function from a UDF that you haven't added to the script because it won't know about that function. It won't tell you which UDFs you've added that aren't needed, but at least you will know what is missing.

Also, remember most of the bigger UDFs will have #include lines for other UDFs and you may end up referencing them several times, but if they're AutoIt standard includes, they will only be added once because of the directive #include-once in them

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to post
Share on other sites

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.

  • Similar Content

  • Create New...