I have an array of size 6 called apparray(6). I have stored several strings into this array from textboxes. Two of the text boxes, lastName and firstName, has the value of 'Smith' and 'John', therefore apparray(0) and apparray(1) have the same values. How do I now display these values on a multicolumn listbox using the array?

I have an array of size 6 called apparray(6).
That by default is an array of size 7. Visual Basic 6 uses a Zero Based Index for arrays unless specifically told that the index starts with 1.

I have stored several strings into this array from textboxes. Two of the text boxes, lastName and firstName, has the value of 'Smith' and 'John', therefore apparray(0) and apparray(1) have the same values. How do I now display these values on a multicolumn listbox using the array?

' Previous code assumed to have filled values for apparray(6)
Dim i as Integer
For i = 0 to 1
     list1.AddItem apparray(i), i
Next i
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.