Jump to content

Recommended Posts

Posted

I am setting an array something like

DIM $Array[10]
$num = 0
For $i = 1 to 2
   $num = $num +1
   $Array[$i] = $num
Next

Msgbox(0,"",$array[0])
Exit

My assumption is that I should get 2 in the messagebox. I always get 0 no matter what is in my array. Am I missing something? If I check $array[1] and $array[2] they do have values to them.

red

Posted

You're starting your For loop at 1 so $array[1] and $array[2] are being set, but $array[0] is never set and it's defaulting to 0.

Posted

Yeah I'm a dumbass. I thought since when you used Stringsplit() the array created said the nbr of items in the array i thought all arrays did that. Duh I just set the array manually. Easy.

:iamstupid:

red

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...