Basically, I'm trying to read the information shown in a listbox into an array, which is then printed into a text file.
Private Sub cmd_input_Click()
arrayhold(0) = InputBox("Enter a value")
arrayhold(1) = InputBox("Enter a value")
arrayhold(2) = InputBox("Enter a value")
arrayhold(3) = InputBox("Enter a value")
arrayhold(4) = InputBox("Enter a value")
End Sub
Private Sub cmd_save_Click()
Dim i As Integer
Open "F:\Event Programming\Assignment 2\Task 3\array.dat" For Output As #1
For i = 0 To 4
Write #1, arrayhold(i)
Next i
Close #1
End Sub
See, where the InputBoxes are, I'm looking to enter the listbox's information, but is there a specific way to define a row in a listbox? Say I have 10 rows in a listbox;
Question
Nerve
Basically, I'm trying to read the information shown in a listbox into an array, which is then printed into a text file.
Private Sub cmd_input_Click() arrayhold(0) = InputBox("Enter a value") arrayhold(1) = InputBox("Enter a value") arrayhold(2) = InputBox("Enter a value") arrayhold(3) = InputBox("Enter a value") arrayhold(4) = InputBox("Enter a value") End Sub Private Sub cmd_save_Click() Dim i As Integer Open "F:\Event Programming\Assignment 2\Task 3\array.dat" For Output As #1 For i = 0 To 4 Write #1, arrayhold(i) Next i Close #1 End SubSee, where the InputBoxes are, I'm looking to enter the listbox's information, but is there a specific way to define a row in a listbox? Say I have 10 rows in a listbox;
I suck at explaining, but you see what I mean. Any help is appreciated.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts