So I'm trying to add items into a array and then return all items in the array in a textbox. Can someone tell me what I'm doing wrong? When I click the button, it errors out or I get system.string[]
or it doesn't display all the items, just one full or partial item. edit1: here is the updated code.
Public Class Form1
Dim x As Integer = 0
Dim strencode As String
Dim strletters As String
Dim strholder(0 To 999) As String
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
strletters = TextBox1.Text
Label2.Text = x.ToString
If TextBox1.TextLength < x Then
x = 0
End If
If TextBox1.TextLength <> 0 Then
If TextBox1.TextLength < x Then
x = 0
End If
Do Until x = TextBox1.TextLength
If TextBox1.TextLength < x Then
x = 0
End If
If TextBox1.TextLength <> 0 Then
If strletters.Substring(x, 1) = "A" Then
strholder(x) = "346,"
x = x + 1
ElseIf strletters.Substring(x, 1) = "B" Then
strholder(x) = "917,"
x = x + 1
End If
End If
Loop
pause:
Dim i As Integer
For i = 0 To (x - 1)
TextBox2.Text = (strholder(i))
Next
End If
End Sub
End Class