0

I Declared my Array like this:

Dim invoice_discountitems(100, 1) As String

Now i set values into the array:

invoice_discountitems(0,0) = "test1"
invoice_discountitems(0,1) = "test2"
invoice_discountitems(1,0) = "test3"
invoice_discountitems(1,1) = "test4"

Now I tried to count the elements:

MsgBox(invoice_discountitems.GetLength(0) - 1)

But it display the array size (100,1) I want to display (2) elements

1 Answer 1

1

You are displaying the length of the first dimension of the array not the second

MsgBox( invoice_discountitems.GetLength(1) ) '  displays 2 '

http://msdn.microsoft.com/en-us/library/system.array.getlength.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.