I have a program here that will solve an expression...
First I need to input the expression in a textbox. That will be stored in a CharArray and then substitute the variables to integer by using input boxes...
My problem is: How can I store the integer to an array and also store the operation?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim arr() As Char = TextBox1.Text.ToCharArray
Dim aChar As Char
Dim a As String
Dim calc() as String
'Me.Height = Me.Height + 90
Me.Button1.Enabled = False
Me.TextBox1.Enabled = False
For i = 0 To TextBox1.Text.Length() - 1
aChar = arr.ElementAt(i)
If Char.IsLetter(aChar) Then
a = InputBox("Enter value for " & aChar, "Expression")
'Here what code?
' Try
' calc(i) = a
' Catch ex As Exception
' MsgBox("eee")
' End Try
'Else
End If
Next i
End Sub
I generally prefer to work with generic Lists, they make adding and removing items much easier. The code below should do what you need: