Results 1 to 7 of 7

Thread: Atypical write to file? – look here

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Atypical write to file? – look here

    Welcome

    Me again, small question.

    Is this possible? some way is to save in 1 textfile from 3,4 different objects, but in such the way that i can easily and the correctly text load to every with the objects

    Or maybe it load them before the call this form?

    Thx in advance
    I know, I know, my English is bad, sorry .....

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Atypical write to file? – look here

    I'm not understanding your question.

    Are you asking how to save the contents of three different textboxes to the same text file?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Re: Atypical write to file? – look here

    Yes exactly, and also it can be e.g. from 2 TextBoxes and 1 ComboBox

    I think so, that to sort thing in a file and to mark specified strings some the symbols......it is possible?
    Last edited by Tamgovb; Mar 22nd, 2006 at 09:06 AM.
    I know, I know, my English is bad, sorry .....

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Atypical write to file? – look here

    Quote Originally Posted by Tamgovb
    Yes exactly, and also it can be e.g. from 2 TextBoxes and 1 ComboBox
    VB Code:
    1. Open "c:\tamgovb.txt" For Append As #1
    2. Print #1, Text1.Text & vbNewLine
    3. Print #1, Text2.Text & vbNewLine
    4. Print #1, Combo1.List(Combo1.ListIndex)
    5. Close #1
    Quote Originally Posted by Tamgovb
    I think so, that to sort thing in a file and to mark specified strings some the symbols......it is possible?
    You lost me again. What is it that you want to do?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Re: Atypical write to file? – look here

    On moment I will return to your solution. You passed example, it will not be problem with load the data from this file to a textboxes and combobox?

    What is it.... so, good questions. Hmm, you will not believe, only i wonder how to make to spare on my work with writing the code. Also with a practical causes - it's more quickly.

    Only my knowledge, hmm.......damn (sorry), such poor is, i must get to know much.

    back to the theme, or can ask you about some example code - save / read such banal example of code, leaning on this what you wrote already.

    Hack, i will be grateful, thx

    P.S. AAaaa - really I noticed now - you about it ask, I thought that it is complikated very and now this has not meaning
    Last edited by Tamgovb; Mar 22nd, 2006 at 02:52 PM.
    I know, I know, my English is bad, sorry .....

  6. #6
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Atypical write to file? – look here

    Quote Originally Posted by Hack
    Are you asking how to save the contents of three different textboxes to the same text file?
    VB Code:
    1. Dim data() As String
    2. 'to save the data
    3. Private Sub Command1_Click()
    4.     Open App.Path & "\data.txt" For Output As #1 'open file for output
    5.         Print #1, Text1.Text 'save text1's text
    6.         Print #1, Text2.Text 'save text2's text
    7.         Print #1, Text3.Text 'save text3's text
    8.     Close #1 'close file
    9. End Sub
    10. ' to load the data
    11. Private Sub Command2_Click()
    12.     Dim buffer As String
    13.         Open App.Path & "\data.txt" For Input As #1 ' open file for input
    14.             buffer = Input$(LOF(1), 1) 'load the whole file at once
    15.         Close #1 'close file
    16.     data = Split(buffer, vbNewLine) 'split the data at every new line
    17.     Text1.Text = data(0) 'text1's text is the splited data
    18.     Text2.Text = data(1) '         "             "
    19.     Text3.Text = data(2) '         "             "
    20. End Sub
    Last edited by wiz126; Mar 22nd, 2006 at 03:44 PM.
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Atypical write to file? – look here

    Where are you with this particular issue at the moment?

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