Jump to content

Recommended Posts

Posted

my script file in .au3 extension works when i run it as .au3,

but when i compile it to .exe and run it as .exe it says error line -1, subscript array and some nonsense ...

i did use include in my .au3, are there compiling options to make sure the includes are included in the .exe ?

my script must be clean, the syntaxcheckprod shows 0 errors nor warnings and

the .au3 script works flawlessly ...

kinda weird that it wont work after compiling to .exe ...

any ideas?

thanks

Posted (edited)

I think it must be something related to the environment the exe is running (different working directory, relative path used to access a file ...) so an array doesn't get populated properly.

It depends on the size of your script but I would insert some "breakpoints" into the script to see where it crashes. Let's say put some

FileWriteLine("C:\temp\AutoIt.txt","Checkpoint for Statement ..."
before and after you access an array.

That should give you an idea where to further drill down.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

I think it must be something related to the environment the exe is running (different working directory, relative path used to access a file ...) so an array doesn't get populated properly.

It depends on the size of your script but I would insert some "breakpoints" into the script to see where it crashes. Let's say put some

FileWriteLine("C:\temp\AutoIt.txt","Checkpoint for Statement ..."
before and after you access an array.

That should give you an idea where to further drill down.

thank you, it seemed to have helped.

i had a big comment block of testing codes and your line pointed out an error in my comments ... lol!

anyways, i deleted all the comments before the actual code and it all worked well in the .exe :D

still strange to me, but oh well ...

i commented out about 20 lines with ;

thx again, problem solved

Posted

thank you, it seemed to have helped.

i had a big comment block of testing codes and your line pointed out an error in my comments ... lol!

anyways, i deleted all the comments before the actual code and it all worked well in the .exe :D

still strange to me, but oh well ...

i commented out about 20 lines with ;

thx again, problem solved

No, that's just coincidence.

♡♡♡

.

eMyvnE

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
×
×
  • Create New...