Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3741
  • Last Modified:

AutoIT error Line -1

Hi all,

I work at a IT ServiceDesk.
In the last few weeks we get a lot of errors regarding AutoIT.
The complete error message is:
<AutoIt Error>
Line -1:
Error: Subscript used with non-Array variable.

Please take a look at the attchment for the screenshot that the user sent me.

Untill now, only a restage of the computer solved the problem.
Does anybody know how to deal with this issue?

I don't know if I've put it in the correct category.
If not, please accept my appologies.

Thank you for your support.
screenAutoITerror.jpg
0
alohadin
Asked:
alohadin
1 Solution
 
jeff_01Commented:
There is an error in the script that is running. You need to find out which script is running and then if possible post it here so we can help.

0
 
TobiasCommented:
Dear alohadin,

It's because one variable is empty or not correctly set in the software made with AutoIt.

Do you have the source made with AutoIt or only the software ?

Best Regards
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
alohadinSEAuthor Commented:
Hello guys...
I'm sorry for the late answer...
but it was Christmas... I wasn't at work

I don't have the source code for it.
I'm only the serviceDesk... I can take over the users screen, but I don't think I can change the source code

this is a new error that we get more often
i was thinking that there is another way to avoid the error rather than changing the source
0
 
jeff_01Commented:
Without the code it is near impossible for us to help you. All I can say is maybe get hold of the person responsible for the AutoIT app and ask them to take a look at it and maybe fix the code so it doesnt happen again.

:(

0
 
alohadinSEAuthor Commented:
I am unable to get the code...
I dispatched the case to the programmers... they will investigate further.

I would like to thank you for the support
I would also like to split these points between you all... donĂ¹t know if that's possible though
0
 
disposableCommented:
The error message is actually quite descriptive:  Subscript used with Non-Array Variable.  In other words, a variable that is not an array (containing a single value) is, at some point in the program, treated as an array (containing multiple values, referred by index).

Unfortunately, errors like these are common when you use AutoIT and you don't keep track of your variables.  This is because of the way AutoIT is designed, variables seldom need to be initialized and array variables are treated almost exactly the same way as single value variables.

The first thing to do to fix this would be to search for all instances of indices in the code, variables with subscripts and corresponding index (such as $var1[0]).  Then backtrack a bit to see if $var1 really is an array.  

i.e.
var1 =  _Stringbetween($str1, ....)     ==> var1 is an array
var1 = StringinStr($str1, ....)   ==> var1 is NOT an array
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now