Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2003
    Posts
    83

    writing new line to text file

    Hi guys,

    I have a form, when the user submits i want to write the line to the text file, but append not overwrite the data, however i want it appended on the next line.

    Current text file:
    my;name;is

    After adding i want:
    my;name;is
    new;name;is

    NOT
    my;name;isnew;name;is

    I assume i use the string append, but what character do i append to put the data on the nextline?

    Shawn

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. The TextFile.WriteFromString() action has an append option, would this be better suited to this task or am I misunderstanding?

    Corey Milner
    Creative Director, Indigo Rose Software

  3. #3
    Join Date
    May 2003
    Posts
    83
    hi corey,

    yeah thats what im using, but it appends to the text, not a new line, do you know what im saying

    existing text

    once i append "newtext"

    this is what i get:
    existing textnewtext

    this is what i want
    existing text
    new text

  4. #4
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Hi. just add \r\n to your text... i.e.:

    "\r\n\Line to write to file here"

    That creates a new line in the text file...

    Corey Milner
    Creative Director, Indigo Rose Software

  5. #5
    Join Date
    May 2003
    Posts
    83
    not working corey. Give me an error if i do 'r\n\' or "r\n\"

    in1 = Input.GetText("Input1");
    in2 = Input.GetText("Input2");
    in3 = Input.GetText("Input3");
    in4 = Input.GetText("Input4");
    result = String.Concat(in1, ";");
    result2 = String.Concat(result, in2);
    result = String.Concat(result2, ";");
    result3 = String.Concat(result, in3);
    result = String.Concat(result3, ";");
    result4 = String.Concat(result, in4);
    TextFile.WriteFromString("output.txt", result4, true);
    TextFile.WriteFromString("output.txt", 'r\n\', true);

    Error Detail: [unfinished string near `<eof>'] in [TextFile.WriteFromString("output.txt", 'r\n\', true);]

  6. #6
    Join Date
    May 2003
    Posts
    83
    nevermind i got it, thanks man

  7. #7
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    NP. :

    Corey Milner
    Creative Director, Indigo Rose Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts