-
Mar 20th, 2018, 07:00 AM
#1
Thread Starter
Banned
[RESOLVED] Helper needed for small stuff ( help )
Hi guys i need someone who can help me with read , write and save data to text file n from text file. Please PM me your skype/discord id
Thank you in advance
-
Mar 20th, 2018, 07:31 AM
#2
Re: Helper needed for small stuff ( help )
Hi,
what have you tried sofar?
post your code and I'm sure we can help where you are stuck
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
Mar 20th, 2018, 07:34 AM
#3
Thread Starter
Banned
Re: Helper needed for small stuff ( help )
Originally Posted by ChrisE
Hi,
what have you tried sofar?
post your code and I'm sure we can help where you are stuck
regards
Chris
Hey Chris , its kinda hard to explain like this with out pictures of on discord or skype i can send screen shots and explain c:
Thank you ♡
-
Mar 20th, 2018, 08:17 AM
#4
Re: Helper needed for small stuff ( help )
Welcome to VBForums
You can attach screenshots here, just click on "Go Advanced" then "Manage Attachments".
Getting private help is against the spirit of the forums for various reasons, and is actually worse for you.
The main idea of forums is that lots of people can help you, so you tend to get better quality help than you do with one person (as you aren't limited to the knowledge of one person, and we all have different areas of expertise), and it also means you get faster answers because you aren't limiting yourself to the availability of one person.
It also means that anybody who searches for help with their problems can benefit from the question you asked.
-
Mar 20th, 2018, 08:24 AM
#5
Thread Starter
Banned
Re: Helper needed for small stuff ( help )
Last edited by ixes7777; Mar 20th, 2018 at 10:21 AM.
-
Mar 20th, 2018, 08:25 AM
#6
Thread Starter
Banned
Re: Helper needed for small stuff ( help )
Originally Posted by si_the_geek
Welcome to VBForums
You can attach screenshots here, just click on "Go Advanced" then "Manage Attachments".
Getting private help is against the spirit of the forums for various reasons, and is actually worse for you.
The main idea of forums is that lots of people can help you, so you tend to get better quality help than you do with one person (as you aren't limited to the knowledge of one person, and we all have different areas of expertise), and it also means you get faster answers because you aren't limiting yourself to the availability of one person.
It also means that anybody who searches for help with their problems can benefit from the question you asked.
Sorry sir,
I posted my problem with screen shots hope someone can help me
-
Mar 20th, 2018, 09:07 AM
#7
Thread Starter
Banned
Re: Helper needed for small stuff ( help )
Quick update found a way to search the file but only shows the texts no values is shown in file look at my saved log and my output
Output:
http://prntscr.com/itt1f3
Log File:
https://prnt.sc/itt1ts
Here is the code i used
Code:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim i As Integer = 0
Dim filepath As String = IO.Path.Combine("D:\Logs", ComboBox1.Text + ".txt")
Dim readText() As String = File.ReadAllLines(filepath)
Dim s As String
Dim newForm As Form4 = New Form4
newForm.Show()
newForm.TextBox13.Text += readText(2)
newForm.TextBox1.Text += readText(4)
newForm.TextBox2.Text += readText(6)
newForm.TextBox3.Text += readText(8)
newForm.TextBox4.Text += readText(10)
newForm.TextBox5.Text += readText(12)
newForm.TextBox7.Text += readText(14)
newForm.TextBox6.Text += readText(16)
newForm.TextBox8.Text += readText(18)
newForm.TextBox9.Text += readText(20)
newForm.TextBox10.Text += readText(22)
newForm.TextBox11.Text += readText(24)
newForm.TextBox11.Text += readText(24)
For Each s In readText
Console.WriteLine(s)
Next
End Sub
Please help me only shows the texts no numbers
-
Mar 20th, 2018, 10:44 AM
#8
Re: Helper needed for small stuff ( help )
You are reading all the file contents into the array readText, and are then putting some of the values from it into textboxes.
The first one you get is readText(2), which is the third item in the array (because arrays start at 0). As such, TextBox13 should contain "Document Date".
If you want to see the actual values, you need to use the appropriate elements of the array (1,3,5,7,...).
Also note that you shouldn't really use + for strings because that can cause problems in some circumstances, it is better to use & instead (in exactly the same way you use + ) because it doesn't have those problems.
-
Mar 20th, 2018, 10:47 AM
#9
Thread Starter
Banned
Re: Helper needed for small stuff ( help )
Originally Posted by si_the_geek
You are reading all the file contents into the array readText, and are then putting some of the values from it into textboxes.
The first one you get is readText(2), which is the third item in the array (because arrays start at 0). As such, TextBox13 should contain "Document Date".
If you want to see the actual values, you need to use the appropriate elements of the array (1,3,5,7,...).
Also note that you shouldn't really use + for strings because that can cause problems in some circumstances, it is better to use & instead (in exactly the same way you use + ) because it doesn't have those problems.
Still same problem only reads the texts in notepad file
Code :
Code:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim filepath As String = IO.Path.Combine("D:\Logs", ComboBox1.Text & ".txt")
Dim readText() As String = File.ReadAllLines(filepath)
Dim s As String
Dim newForm As Form4 = New Form4
newForm.Show()
newForm.TextBox13.Text = readText(1)
newForm.TextBox1.Text = readText(3)
newForm.TextBox2.Text = readText(4)
newForm.TextBox3.Text = readText(7)
newForm.TextBox4.Text = readText(9)
newForm.TextBox5.Text = readText(11)
newForm.TextBox7.Text = readText(13)
newForm.TextBox6.Text = readText(15)
newForm.TextBox8.Text = readText(17)
newForm.TextBox9.Text = readText(19)
newForm.TextBox10.Text = readText(21)
newForm.TextBox11.Text = readText(23)
newForm.TextBox12.Text = readText(25)
For Each s In readText
Console.WriteLine(s)
Next
End Sub
-
Mar 20th, 2018, 12:21 PM
#10
Re: Helper needed for small stuff ( help )
OK, now you need to do a bit of debugging. That file seems a bit risky, but if you feel confident that the ordering of the values will never change, then that's fine with me. A safer alternative would be to put all the information into a datatable and then write it to an XML file, which is just text with some tags.
However, that has nothing much to do with this situation. What you need to do is to put a breakpoint on some good line. The one I would choose would be this one:
newForm.TextBox13.Text = readText(1)
By that point, readText has been filled. You have already determined that readText IS being filled, so that isn't the issue. It just may not hold things in quite the way you expect for a variety of reasons. So, when execution stops on the breakpoint, highlight readText and press Shift+F9, which will show you all that is in the array. From that, you should be able to see which array items need to be put into which textboxes.
My usual boring signature: Nothing
-
Mar 20th, 2018, 12:43 PM
#11
Thread Starter
Banned
Re: Helper needed for small stuff ( help )
Originally Posted by Shaggy Hiker
OK, now you need to do a bit of debugging. That file seems a bit risky, but if you feel confident that the ordering of the values will never change, then that's fine with me. A safer alternative would be to put all the information into a datatable and then write it to an XML file, which is just text with some tags.
However, that has nothing much to do with this situation. What you need to do is to put a breakpoint on some good line. The one I would choose would be this one:
newForm.TextBox13.Text = readText(1)
By that point, readText has been filled. You have already determined that readText IS being filled, so that isn't the issue. It just may not hold things in quite the way you expect for a variety of reasons. So, when execution stops on the breakpoint, highlight readText and press Shift+F9, which will show you all that is in the array. From that, you should be able to see which array items need to be put into which textboxes.
Thanks bro i have solved it but now need to know how to add copy paste shortcuts to the programm
-
Mar 20th, 2018, 12:50 PM
#12
Re: Helper needed for small stuff ( help )
We can help with that, but as it is a different question it belongs in a different thread.
While it is slightly easier for you to just reply here, it means that you will get less help - some people won't open a thread with lots of replies, and many of those who do will read and think about posts that are no longer relevant before they get to the current issue (and therefore be a bit annoyed).
As you now have the previous issue sorted out, could you please do us a little favour, and mark the thread as Resolved?
(this saves time reading for those of us who like to answer questions, and also helps those who search to find answers)
You can do it by clicking on "Thread tools" just above the first post in this thread, then "Mark thread resolved". (like various other features of this site, you need JavaScript enabled in your browser for this to work).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|