Jump to content

Recommended Posts

Posted

Hello. I have a script which, when compiled, tells me that a variable on line 4645 was used without being declared.

I have

AutoItSetOption("MustDeclareVars", 1)

at the beginning of my script and have checked all the #include .au3 files individually using SyntaxCheck Prod. It can't find anything to yell at me about. The program works fine if I run it using "Go" in Scite. It is only when I compile it using Autoit2exe that there is a problem. Is there an easy way to find out what variable isn't being declared? My script starts with these includes if it matters:

#include <StructureConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <GuiScrollBars.au3>
#include <SendMessage.au3>
#include <GUIToolTip.au3>
#include <Misc.au3>

I don't know if I can just count the lines of each one of those .au3's until I wind up at 4645, or if compiling the script changes what line numbers I have. Any insight into how to find the variable would be greatly appreciated.

If it matters, I'm doing this on Autoit version 3.3.8.1 because everything newer makes the antivirus mad for some reason I can't determine.

Thanks in advance!

Posted

This is what I would do:

1. Use Au3Stripper (available in Scite4AutoIt)

2. Compile. It will generate a "yourfile_stripped.au3" file on the same folder, containing the stripped code that will be exactly what is being saved on the executable file.

3. Take the error line number and check on that stripped file, trying to guess, from the stripped code, what part of the original source code it represents.

Or:

1. Try to reproduce using AutoIt Debugger.

P.S.: Actually there is a much easier way, however according to forum rules, I cannot mention it :sweating:

My stuff

  Reveal hidden contents

 

Posted

In SciTe when there's an undeclared var, i simply double click the "error" line, in the console,  and it takes me to the line in question.

 

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

That probably need to have the extra SciTe installer.

@careca  It isn't ?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted

Kind of strange that in Scite it works fine, but not in a compiled exe.  I would suggest that you put some msgbox (0,"","test") here and there till you find the spot where the problem is.  Not very elegant, but it will get you there. Line # 4645 is your last line of the  script, btw !

Posted
  On 1/9/2019 at 8:00 AM, caramen said:

That probably need to have the extra SciTe installer.

@careca  It isn't ?

Expand  

Well yes i use the full SciTe.

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted
Posted

Try adding this line to the script and see if the error comes up

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7

 

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

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...