luvmachine Posted January 5, 2007 Share Posted January 5, 2007 (edited) When I run my script it declares an array size 100, calls another function to fill the array, then goes into a loop spilling out every value in the array. However when it gets to the loop it finally decides that the variable is no longer an array :| If I use a message box after the function fills the array it treats it like one, just not after it leaves that function. Here's what the script looks like from the standpoint of that one variable: EDIT: BTW, the error I'm getting is "Subscript used with non-Array variable." on line "Send($name_list[$numb_sent])" at [$numb Dim $name_list[100] $numb_sent = 0 $name_list = _RetrieveNames() Do Send($name_list[$numb_sent]) $numb_sent = $numb_sent + 1 Until $numb_sent = 50 Func _RetrieveNames() For $x = 0 to 99 $name_list[$x] = $x Next EndFunc Edited January 5, 2007 by luvmachine Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 5, 2007 Moderators Share Posted January 5, 2007 (edited) Sounds like it's the other function you should be looking at, but you are very hard to understand what you want. Try this to fix the array error. Do $numb_sent += 1 If IsArray($name_list) Then Send($name_list[$numb_sent]) Until $numb_sent = 50oÝ÷ ØGbµ8b²+0®àjÌ[a¢è!jëh×6Dim $name_list[100] $numb_sent = 0 $name_list = _RetrieveNames() Edited January 5, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
luvmachine Posted January 5, 2007 Author Share Posted January 5, 2007 Sorry about being hard to understand :| Basically my issue is that after leaving the function _RetrieveNames() the variable $name_list goes from being an array, to not being an array. Link to comment Share on other sites More sharing options...
luvmachine Posted January 5, 2007 Author Share Posted January 5, 2007 Okay that fixed it ^^ Thank you very much, I always end up having issues with my arrays -.-; Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now