Results 1 to 12 of 12

Thread: [RESOLVED] Helper needed for small stuff ( help )

  1. #1

    Thread Starter
    Banned
    Join Date
    Mar 2018
    Location
    GB
    Posts
    12

    Resolved [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

  2. #2
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,045

    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.

  3. #3

    Thread Starter
    Banned
    Join Date
    Mar 2018
    Location
    GB
    Posts
    12

    Smile Re: Helper needed for small stuff ( help )

    Quote Originally Posted by ChrisE View Post
    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 ♡

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    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.

  5. #5

    Thread Starter
    Banned
    Join Date
    Mar 2018
    Location
    GB
    Posts
    12

    Re: Helper needed for small stuff ( help )

    Removed*
    Last edited by ixes7777; Mar 20th, 2018 at 10:21 AM.

  6. #6

    Thread Starter
    Banned
    Join Date
    Mar 2018
    Location
    GB
    Posts
    12

    Re: Helper needed for small stuff ( help )

    Quote Originally Posted by si_the_geek View Post
    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

  7. #7

    Thread Starter
    Banned
    Join Date
    Mar 2018
    Location
    GB
    Posts
    12

    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

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    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.

  9. #9

    Thread Starter
    Banned
    Join Date
    Mar 2018
    Location
    GB
    Posts
    12

    Re: Helper needed for small stuff ( help )

    Quote Originally Posted by si_the_geek View Post
    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

  10. #10
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    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

  11. #11

    Thread Starter
    Banned
    Join Date
    Mar 2018
    Location
    GB
    Posts
    12

    Re: Helper needed for small stuff ( help )

    Quote Originally Posted by Shaggy Hiker View Post
    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

  12. #12
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    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
  •  



Click Here to Expand Forum to Full Width