PDA

Click to See Complete Forum and Search --> : adding data to a array


birch
Jan 27th, 2000, 02:49 AM
i'm stuck on a project, i have been asked to create a cd browser in vb6, it has to use an array, i need to add the cd title and artiste, i'm having trouble adding new records. if u could help me that would great

Aaron Young
Jan 27th, 2000, 07:26 AM
To add new Elements to an Array, Dim the Array as Dynamic and then use the ReDim Statement with the Preserve Keyword, ie.
Dim aArray() As String
ReDim aArray(0)
aArray(0) = "Item 1"
ReDim Preserve aArray(1)
aArray(1) = "Item 2"
'Etc..

------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com