Results 1 to 3 of 3

Thread: VB AND CELL PHONES!!!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    99
    (Ok, so It was a nalant trick to get you to read this.. so sue me...)

    I want to append a text file, I want to add text to the TOP of it... how do i do that?? How do I open it and add text to the top!?!?!?
    ___________________________
    Chris

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    There is probably a WAY easier way to do this but since no one is posting it i thought i showed you a way that SHOULD work. What will happend is it will grab the already existent text into a string and grab the new text and add the new to the old and print into the file.
    Code:
    Dim olddata As String
    Dim newdata As String
    Dim everything As String
    newdata = Text1.Text
    Open "C:\myfile.txt" For Input As #1
        Do Until EOF(1)
                Line Input #1, olddata
        Loop
    Close #1
    everything = newdata & olddata
    Kill "C:\myfile.txt"
    Open "C:\myfile.txt" for OutPut As #1
         Print #1, everything
    Close #1
    Hope that helps,
    D!m
    Dim

  3. #3
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    If you have the old text in a textbox already, all you have to do is this:
    Code:
    Private Sub Command1_Click()
    text1.text = yournewtext & text1.text
    End Sub
    This will add the new text, which you might have in a variable or in another text box, to the top of the textbox. I hope that is what you want.
    <removed by admin>

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