Jump to content
Sign in to follow this  
luvmachine

Send(Array[number]) issue

Recommended Posts

luvmachine

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 by luvmachine

Share this post


Link to post
Share on other sites
SmOke_N

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

Share this post


Link to post
Share on other sites
luvmachine

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.

Share this post


Link to post
Share on other sites
luvmachine

Okay that fixed it ^^ Thank you very much, I always end up having issues with my arrays -.-;

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×