Jump to content

Recommended Posts

Posted

Hi All,

I keep getting 'variable used without being declared' when I run my script.Problem is the line number is wrong, it says like Line 3792 which is the line number after the #include files have been put in.  

It's not very helpful because there is no mention of which variable it is, and I have no idea where on the script it is.

Anything I can do?  Short of going through each variable line by line making sure it is declared??

The AutoIt3 Script in question is a compiled EXE.  I'm not sure if running it first as a non-EXE would give me more additional useful information which would be ideal but the script can only be tested as an EXE.

Thanks, All.

Pablo.

Posted

Running your script in SciTE will definitely give you a more detailed error information. E.g.:

  Quote

"C:\temp\Test.au3"(17,21) : warning: $pid: possibly used before declaration.
            ProcessClose($pid)
            ~~~~~~~~~~~~~~~~~^

Expand  

 

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

 

autoit  tells you where the error is ,

  On 3/25/2017 at 10:45 AM, Pablos544 said:

Line 3792

Expand  

that's where the error is, check the left side of autoit editor.

it is much better if you will show your script. :lol:

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Posted
  On 3/25/2017 at 11:12 AM, water said:

Running your script in SciTE will definitely give you a more detailed error information. E.g.:

 

Expand  

Sup water , 232showtime,

Yes I kind of guessed that running the script in SciTE will show much better errors like that 'Variable ...being declared.'  Problem I'm having is this script has to check  cmdLine[1]  for an input file which actually thinking about it I suppose I could 'fake' couldn't I?? Then I could see what it does in a safe environment.

I think the Line 3792 is the 'expanded' line after the #included.... lines have been put in.

I think it is also possible to calculate the actual line by adding how many lines each #include ... file is.

Cheers, guys! You've been very helpful!! :)

Pablo.

Posted

Yes, you can fake the command line in SciTE. Try Shift-F8.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted
  On 3/25/2017 at 1:03 PM, water said:

Yes, you can fake the command line in SciTE. Try Shift-F8.

Expand  

 

Awsome water thank you so much!  The faking attitude has done the job spot on.

Now I'm getting awesome error messages: "Line 11 (File .....) $sThisThat ^ ERROR  Error: Variable used without being declared"

whoa!!! 

Thanks!! :D

Pablo.

Posted

:)

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

I will do my very best ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

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