Allora, ho messo su un form 4 TextBox e un CommandButton, e ho scritto il seguente codice:
codice:
Private Sub Form_Load()
Text1.Text = "y'=e^(2x)+3y"
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command1_Click()
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Dim strValore As String
Dim intInd As Integer
Dim intIndUno As Integer
Dim strSinistra As String
Dim strCentro As String
Dim strDestra As String
' legge il valore della text1, quello da scomporre
strValore = Text1.Text
' SINISTRA
intInd = InStr(1, strValore, "(", vbTextCompare)
strSinistra = Mid(strValore, 1, intInd - 1)
' DESTRA
intIndUno = InStr(1, strValore, ")", vbTextCompare)
strDestra = Mid(strValore, intIndUno + 1, Len(strValore))
' CENTRO
strCentro = Mid(strValore, intInd + 1, _
Len(strValore) - intIndUno - 1)
Text2.Text = strSinistra
Text3.Text = strDestra
Text4.Text = strCentro
End Sub