Click here to Skip to main content
15,887,337 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
VB
For i As Integer = 0 To TextBox1.Lines.Count - 1
TextBox2.Text = TextBox1.Text
Next
For x = 0 To TextBox2.Lines.Count - 1
Dim str As String = TextBox2.Lines(x).ToString
Dim str1 = str.Split(",")(0).ToString
Dim str2 = str.Split(",")(1).ToString

Next




I want to insert a clause group accounts Eachd line Mikhaddh each line spaced and collected
I want to enter the first line
After what brings and make sure of the result
Enters the second line, and it deletes the first line
Brings and enters the second line to the third line and second line deletes
For example
1,+1=2
2,+2=4
5,+5=10
Give me the result of each line in the msgbox
Posted
Comments
Sergey Alexandrovich Kryukov 26-Mar-14 16:47pm    
And what is your question..? :-)
You are not doing anything with str1, str2. And we don't know what is in the lines of your text box and why. It all has very little to no sense...
—SA

1 solution

Perhaps you should switch from what you doing to some conscious programming. So far, this is not programming at all. In programming, you should understand what you are doing, every character you enter. Let's see.

In the loop, you create a string from TextBox2.Lines(x) by calling, actually string.ToString. It works, because all type have the method System.Object.ToString. But why making an identical string from string? It is already a string. Same thing in the next two lines. Now, what's the purpose of str1 and str2? When you exit each iteration of your loop, these two values are lost and the object are discarded, will eventually be destructed by the Garbage Collection.

This is not programming and not the way to learn programming. If you get some code, I doubt it will teach you to write your own. Perhaps you need to try even simpler exercises (how it can be even simpler than this one? I don't know; probably it can be; it depends on your level of understanding), but do them the way you would really understand each your step.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900