hi I’m having trouble inputting data in to an array. The first input is fine but after that it just overwrites the first input. i tried to write it so that it would increase the array index by one each time but it hasn’t worked. Any suggestions?
Code:Public Class Form1 Private InputStudentName As String Private StudentNames(9) As String Private Questions(29, 2) As String Private Sub StudentLogOn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StudentLogOn.Click StudentNames(0) = "" StudentNames(1) = "" StudentNames(2) = "" StudentNames(3) = "" StudentNames(4) = "" StudentNames(5) = "" StudentNames(6) = "" StudentNames(7) = "" StudentNames(8) = "" StudentNames(9) = "" Dim n As Integer For n = n To n StudentNames(n) = InputBox("enter your full name") n = n + 1 Next




Reply With Quote