|
-
Oct 9th, 2000, 11:15 PM
#1
Thread Starter
Frenzied Member
I want to put the contents of a
always changing array into a
listbox... How do you do that?
-
Oct 10th, 2000, 12:00 AM
#2
Lively Member
I don't know if I understood what you're after, but
Dim MyArray(intArrayCount) As String
For i=0 To intArrayCount - 1
MyList.List(i) = MyArray(i)
Next i
0101011001000010
01101111011011100110110001101001011011100110010101110010
-
Oct 10th, 2000, 02:47 AM
#3
Lively Member
for x = 1 to ubound(myArray)
list1.additem myArray(x)
next x
-
Oct 10th, 2000, 08:57 AM
#4
joefoules:
i think the loop should be
for x = 0 to ubound(myArray)
unless you need to discount myArray(0).
-
Oct 10th, 2000, 08:59 AM
#5
Lively Member
I suppose, depends on how you populate the array in the first place.
-
Oct 10th, 2000, 12:58 PM
#6
Thread Starter
Frenzied Member
Look... If thats in a timer though
your gonna never clear the array..
This array changes all the time!
-
Oct 10th, 2000, 01:16 PM
#7
Fanatic Member
Correct me if I'm wrong, but you have a dynamic array, one that can be a different size each time. Each time the array is assigned something, you want the elements placed in a listbox. Each time the array changes, the listbox clears and repopulates with the new array information? If so:
Code:
'This code is NOT verified.
Private Sub List1Populate()
List1.Clear
For X = 0 to UBound(MyArray)
List1.AddItem MyArray(X)
Next X
End Sub
What'll happen:
Each time your array changes, call List1Populate. This will clear the listbox and populate it with the current contents of the Array. You could also add this to the same sub your array is being assigned data in, it wouldn't take much work there. More or less, this is exactly the same as the others with the added List1.Clear ...
If this isn't what you're looking for, a more detailed question might be in order
-
Oct 10th, 2000, 03:25 PM
#8
Array's can start at 0 or 1, thus use:
Code:
Private Sub List1Populate()
List1.Clear
For X = LBound(MyArray) To UBound(MyArray)
List1.AddItem MyArray(X)
Next X
End Sub
-
Oct 10th, 2000, 03:36 PM
#9
Is the loop
LBnd = LBound(MyArray)
UBnd = UBound(MyArray)
For X = LBnd To UBnd
not more efficient than
For X = LBound(MyArray) To UBound(MyArray)
??
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
|