drumminfreak
Member
- Joined
- Oct 31, 2011
- Messages
- 5
- Programming Experience
- Beginner
Hello to you all.
Ok, ive had a brief look round and can't find the answer to this question. I've also been browsing the internet for what feels like a life time in order to find this answer but i've had no success so far and its driving me up the wall.
What i'm doing is a very simple (or so i thought) project for my local Pool Team. I haven't had much experience in VB apart from very basic VBA so treat me like a complete newbie
Ok, the bit im struggling with is: I'm trying to make text files for each player. With the text file being called Player 1, player 2 etc etc, and the first line inside the txt file to be their name., I'm getting the "player 1", "Player 2" part, but the first line is constantly coming up with "textbx_1" instead of whats inside the Text box.
Here's the code i have; hopefully it might show my mistake. Any help would be greatly greatly appreciated.
(the focusedtextbx is something i did recently (as i would also like it to see inside the text box and not keep the string.) i would like to keep my script small.) )
PrivateSub btn_okpoints_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_okpoints.Click
Dim intcount AsInteger
Dim text_filename AsString
Dim focusedtextbx AsString
Dim firstlinetext AsString
intcount = 0
If intcount = "0"ThenGoTo actualsums
actualsums:
intcount = intcount + 1
focusedtextbx = "txtbx_name" & intcount.ToString
If focusedtextbx = ""ThenGoTo exitme ElseGoTo txtfile_name
txtfile_name:
text_filename = "C:\POOL_LEAGUE_DATA\player" & intcount & ".txt"
firstlinetext = "textbx" & intcount.ToString
Dim objWriter AsNew System.IO.StreamWriter(text_filename, True)
objWriter.Write(firstlinetext)
objWriter.Close()
If intcount = "18"ThenGoTo exitme ElseGoTo actualsums
exitme:
If MsgBox("Text written to file", MsgBoxStyle.OkOnly) = MsgBoxResult.Ok ThenExit Sub
EndSub
Thank you for your time. And Thank you so much for any help you can give me. (sorry if this is posted in the wrong place too. )
Regards
Drumminfreak
Ok, ive had a brief look round and can't find the answer to this question. I've also been browsing the internet for what feels like a life time in order to find this answer but i've had no success so far and its driving me up the wall.
What i'm doing is a very simple (or so i thought) project for my local Pool Team. I haven't had much experience in VB apart from very basic VBA so treat me like a complete newbie
Ok, the bit im struggling with is: I'm trying to make text files for each player. With the text file being called Player 1, player 2 etc etc, and the first line inside the txt file to be their name., I'm getting the "player 1", "Player 2" part, but the first line is constantly coming up with "textbx_1" instead of whats inside the Text box.
Here's the code i have; hopefully it might show my mistake. Any help would be greatly greatly appreciated.
(the focusedtextbx is something i did recently (as i would also like it to see inside the text box and not keep the string.) i would like to keep my script small.) )
PrivateSub btn_okpoints_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_okpoints.Click
Dim intcount AsInteger
Dim text_filename AsString
Dim focusedtextbx AsString
Dim firstlinetext AsString
intcount = 0
If intcount = "0"ThenGoTo actualsums
actualsums:
intcount = intcount + 1
focusedtextbx = "txtbx_name" & intcount.ToString
If focusedtextbx = ""ThenGoTo exitme ElseGoTo txtfile_name
txtfile_name:
text_filename = "C:\POOL_LEAGUE_DATA\player" & intcount & ".txt"
firstlinetext = "textbx" & intcount.ToString
Dim objWriter AsNew System.IO.StreamWriter(text_filename, True)
objWriter.Write(firstlinetext)
objWriter.Close()
If intcount = "18"ThenGoTo exitme ElseGoTo actualsums
exitme:
If MsgBox("Text written to file", MsgBoxStyle.OkOnly) = MsgBoxResult.Ok ThenExit Sub
EndSub
Thank you for your time. And Thank you so much for any help you can give me. (sorry if this is posted in the wrong place too. )
Regards
Drumminfreak