Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Need to get one line each time the function is called, and each time it's called....

I need to get one line at a time from a TextBox, and each time the function is called, it goes to the next line in the list of string in the TextBox.

Anyone help out with this?

Do your research! It can save your life!
[Image: uZwFcEU.png]
Here you go maybe this will help you
Code
Dim index as Integer = 0
Public Function ReadNextLine() As String
Return TextBox1.Lines(index).ToString
index += 1
End Function
(Oct 28, 2016 04:23 AM)DopplerAF Wrote:  Here you go maybe this will help you
Code
Dim index as Integer = 0
Public Function ReadNextLine() As String
Return TextBox1.Lines(index).ToString
index += 1
End Function

I'm about to test it out.
If it works, I need your address to come kiss your ass.

edit:
Doesn't work, only gets the first line.

Do your research! It can save your life!
[Image: uZwFcEU.png]
My mistake.. I called the return without ever adding the index. Here it is fixed now.

Code
Dim index as Integer = 0

Public Function GetTextLineByLine() As String
Dim result = TextBox1.Lines(index).ToString
index = index + 1
Return result
End Function
Thanks for those who tried to help! I had a friend who fixed it in like 5 seconds over TeamViewer.. I've been working on this all night long.

Do your research! It can save your life!
[Image: uZwFcEU.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by FhackMar 2, 2022 03:52 AM 4 307 Mar 2, 2022 03:52 AM
Last Post: Fhack
[C#] by Formula 1Dec 6, 2019 01:11 AM 23 708 Dec 6, 2019 01:11 AM
Last Post: itcorp
[Java] by RaitzNov 4, 2017 02:04 PM 7 183 Nov 4, 2017 02:04 PM
Last Post: ZeratulTheWizard