Jump to content

Help me with finding last array


 Share

Recommended Posts

hello,

im quite experienced with any programming language,

but how the h*ck can i return the last array index? :">

i've tried _arraymax,min,maxindex,minindex etc.

but didnt work out, it seems that my english skills are quite bad..

which command can do the trick?

thnx,

-me

Link to comment
Share on other sites

hello,

im quite experienced with any programming language,

but how the h*ck can i return the last array index? :">

i've tried _arraymax,min,maxindex,minindex etc.

but didnt work out, it seems that my english skills are quite bad..

which command can do the trick?

thnx,

-me

I don't understand what you want. Post your code and mark the area where we should help.

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

well, i want the last index of an array,

like:

#Include <array.au3>
Dim $MyArray[5]
$MyArray[0] = 1
$MyArray[1] = 2
$MyArray[2] = 8
$MyArray[3] = "sadsad"
$MyArray[4] = "213"

_ArrayAdd($Myarray, "myvalue")

what is in this code the last index? (6, but i want a command that gives this answer)

- me

Link to comment
Share on other sites

well, i want the last index of an array,

what is in this code the last index? (6, but i want a command that gives this answer)

- me

see help file: ubound()

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

In the help file u will find 'Ubound' which I guess is short for upper bound so you could just put array[ubound-1] (i think)

No :), i know what ubound is

it will return the number of DIMENSIONS and not INDEX

dimensions is:

$array[1][2][3][4]
;Ubound = 4

like that

so it doens't fix my prob.. :D

- me

Link to comment
Share on other sites

Nevermind, it was UBOund!!! :)

it says:

Dimension [optional] Which dimension of a multi-dimensioned array to report the size of. Default is 1, which is the first dimension. If this parameter is 0, the number of subscripts in the array is returned.

so, i need to do this

UBound($Myarray, 0)

thanks alot :D

- me

Link to comment
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
 Share

  • Recently Browsing   0 members

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