length in a array

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Gustavo

length in a array

Post by Gustavo » Sat Jan 29, 2005 5:08 pm

Why it do not work?
Can you complet the macro, please?


VBStart
Dim numeros
numeros=Array("uno","dos","tres","cuatro","cinco")
arrayobj = numeros()
msgbox numeros.length
Vbend

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Sat Jan 29, 2005 6:34 pm

(Not really a beginner question)...

arrayObj.length is "JScript", not vbscript.

Instead for vbscript, you can use something like:
msgbox ubound(numeros)
(which returns '4'... the index of the the 5th cell)

Gustavo

Post by Gustavo » Fri Feb 04, 2005 8:53 pm

Thank you, it work fine

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts