|
-
Aug 22nd, 2015, 02:49 PM
#1
Thread Starter
Lively Member
Count indexes/items in a 2-Dimensional array, to ultimately populate a Listbox.
I'm trying to populate a ListBox on a main form with the values of a 2-dimensional array.
This array will not have a known or fixed number of indexes or lines, so I need to count the indexes, to use this value in a loop to add each line Additem to a ListBox. I have not been able to find a similar enough post/example of counting the indexes to help.
Simplified objective:
Code:
Dim Count as Byte
Count = Disparray().IndexCount 'ie. 4 for 4 lines as below
For x = 0 To Count 'Count = highest index value
List1.AddItem Split(Disparray(x, x) at commas) 'I'm familiar with this
Next x
Based on inputs to my app, array items will slowly come & go, so each time there is a change I want to refresh my Listbox based on current Disparray() contents.
My array and array contents:
Dim Disparray(0 To 10, 0 To 15) As String
Data example
1,3,Patient,Room,Treatment,Time_in
3,7,Patient,Room,Treatment,Time_in
3,9,Patient,Room,Treatment,Time_in
4,5,Patient,Room,Treatment,Time_in
Any suggestions appreciated
Last edited by Enrique_; Aug 22nd, 2015 at 03:28 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|