E ehsan1111 New Member Nov 10, 2013 #1 Hi I'm newbie in b4a I have a text file. text.txt contents: first row second row third row . . . How can I create an button to display a random row by each click? thank you
Hi I'm newbie in b4a I have a text file. text.txt contents: first row second row third row . . . How can I create an button to display a random row by each click? thank you
Eric H Active Member Licensed User Longtime User Nov 11, 2013 #2 Do a search for my hangman tutorial in the forum. I have some code that would be helpful for you along with an explanation of how it works. Let me know if you have questions beyond that and I'll see if I can help. Eric Upvote 0
Do a search for my hangman tutorial in the forum. I have some code that would be helpful for you along with an explanation of how it works. Let me know if you have questions beyond that and I'll see if I can help. Eric
Erel B4X founder Staff member Licensed User Longtime User Nov 11, 2013 #3 Something like: Code: Copy 'read the file once: Dim rows As List = File.ReadList(...) 'select row Dim row As String = rows.Get(rnd(0, rows.Size)) Upvote 0
Something like: Code: Copy 'read the file once: Dim rows As List = File.ReadList(...) 'select row Dim row As String = rows.Get(rnd(0, rows.Size))
E ehsan1111 New Member Nov 11, 2013 #4 Eric H said: Do a search for my hangman tutorial in the forum. I have some code that would be helpful for you along with an explanation of how it works. Let me know if you have questions beyond that and I'll see if I can help. Eric Click to expand... hi , That was very nice tutorial. fantastic. thank you Erel said: Something like: Code: Copy 'read the file once: Dim rows As List = File.ReadList(...) 'select row Dim row As String = rows.Get(rnd(0, rows.Size)) Click to expand... Thanks for your good support dear Erel Solved. Upvote 0
Eric H said: Do a search for my hangman tutorial in the forum. I have some code that would be helpful for you along with an explanation of how it works. Let me know if you have questions beyond that and I'll see if I can help. Eric Click to expand... hi , That was very nice tutorial. fantastic. thank you Erel said: Something like: Code: Copy 'read the file once: Dim rows As List = File.ReadList(...) 'select row Dim row As String = rows.Get(rnd(0, rows.Size)) Click to expand... Thanks for your good support dear Erel Solved.