Share this post

Link to post

Share on other sites

BrewManNH 1,099

BrewManNH 1,099

Please post your code or at least a small reproducer script that demonstrates your issue. There's not nearly enough information in your post to give any kind of rational answer.

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

Share this post

Link to post

Share on other sites

BrewManNH 1,099

BrewManNH 1,099

Well, first off I can see that you don't declare the variable $list until after you've jumped to the gui() function, so it's being seen as undeclared.

Second, you're redeclaring the $X and $Y variables with the same Local declaration as the $list variable. Not that it makes a difference to the values in those variables, but what were you trying to accomplish by doing that?

Also, use Global for variables that are global in scope, and not Local, they're going to be Global variables anyways because of where you declared them, it will help in trouble-shooting later if you declare your variables in the proper scope.

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

Share this post

Link to post

Share on other sites

BrewManNH 1,099

BrewManNH 1,099

Move the declaration of $list to before the jump to the gui() function, and it will work. No more error messages that way.

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

Share this post

Link to post

Share on other sites

Kidney 9

Kidney 9

I can see that you populated the combobox with 5 items. The reason why it isn't working is because your index is wrong. A zero-based index starts with zero as the first item and then increases by one for every item after that. Make sure you look at the help files to check what index is returned for each function you call.