Re: Append new line to Text File



Open App.Path & "\sinfo.txt" For Append As #1
Print #1, title & " " & Artist
Close #1

When I use the above code in a file that already has one line of text,
it just puts the stuff at the end of the line not on a new line. (I
don't want to use write because I don't want quotes around my text).

That means the existing line you have in your file was not put there with
the above code. The Print statement (as written) puts the new line of text
into the file with a trailing Windows newline character sequence (carriage
return followed by a line feed), so each line it adds to the file goes on
the next line. If you open your existing file in a text editor, put the text
cursor at the end of the file (it will be right after the last letter of the
last word), hit the Enter Key (to put a newline character sequence after it)
and then save the file back out... then the above code will work correctly
from there on out. The key to maintaining a file of data is consistency in
how data is added to the file.

Rick


.



Relevant Pages

  • Re: IE Start Up Page And Cursor Position
    ... In order to start overtyping the URL press Tab or Alt-d or F6 or Ctrl-o ... > If this option is selected, not only is the page blank> when you open Netscape, but the cursor is positioned in> the address field to type a URL and also the address> field is blank. ... IE brings up a blank page but it also puts the> text "ABOUT:BLANK" in the address field and the cursor is> not positioned in the address field. ...
    (microsoft.public.windows.inetexplorer.ie6.setup)
  • Re: Adding replies to bottom of message
    ... >> top of the reply instead of the bottom as newslist protocol ... It puts the *cursor* at the top of the ... I had to also copy and paste the signature from the top to the ...
    (microsoft.public.windowsxp.general)
  • Re: OT - Spam
    ... Trimming doesn't start at the top enough to have that be an excuse, ... OE puts the cursor at the top is a problem, ... non-email based news reader client. ...
    (comp.security.firewalls)
  • Re: How to run SQL Script from forms 6i?
    ... define a cursor for your select ... utl_file emits from the database server; it puts the output into the file system available to the database server. ... text_io emits from the Forms execution engine; it puts the output into the file system available to the application server. ...
    (comp.databases.oracle.tools)
  • Re: Jumps in subform?
    ... But if he puts the cursor in an already written field, ... > / Rolf ...
    (microsoft.public.access.formscoding)