Sign in to follow this  
Followers 0
glasglow

Array in numbered order?

1 post in this topic

#1 ·  Posted (edited)

I have an array like this:

$array = _ArrayCreate(-5,-4,-3,-2,-1,0,1,2,3,4,5)

$count = 0
For $I = 0 to UBound( $Array ) - 1
    $count += 1
Next

The count is ok, I just need the total number of array variables but now I need to select a number. For example, in using the array above, if I want to choose the number 2 I want that number 2 to give me the number 8 since it is the 8th variable in the array.

(-5,-4,-3,-2,-1,0,1,2,3,4,5)

(1, 2, 3, 4, 5, 6,7,8,9,10,11)

Starting with 0 is ok too but I can't figure out how to find the "count" WHERE $N = 2

Any ideas or suggestions?

I"M SORRY I JUST EDITED THIS>>>> PLEASE DELETE>>> I FOUND ARRAYSEARCH....

Edited by glasglow

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  
Followers 0