Jump to content
Sign in to follow this  
Immensee

Help me with finding last array

Recommended Posts

Immensee

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

Share this post


Link to post
Share on other sites
/dev/null

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 *

Share this post


Link to post
Share on other sites
Cue

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)

Share this post


Link to post
Share on other sites
Immensee

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

Share this post


Link to post
Share on other sites
/dev/null

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 *

Share this post


Link to post
Share on other sites
Immensee

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

Share this post


Link to post
Share on other sites
Immensee

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.