Forum Discussion

tinauser's avatar
tinauser
Frequent Contributor
13 years ago

writetotextfile multilines

hallo,

I´d like to write in a text file a text with multiple lines.

var s 1="my test\n"

var s 2="does not \nwork!"

aqfile.WriteToTextFile(filePath,s1)

aqfile.WriteToTextFile(filePath,s2)

The text is all written on the same line.



What am I missing?

thanks



L

3 Replies

  • Hi,



    Actually, this works fine. Here's what I tried:

    var s1="my test\n";

    var s2="does not \nwork!";

    aqFile.WriteToTextFile("c:\\something.txt",s1,aqFile.ctANSI);

    aqFile.WriteToTextFile("c:\\something.txt",s2,aqFile.ctANSI);




    And here's what was in 'c:\something.txt':

    my test



    does not



    work!




    BTW, replace '\n' with '\r\n' since this is more conventional in Windows.
  • tinauser's avatar
    tinauser
    Frequent Contributor
    jared, you are right.

    I guess the problem was that I was opening the txt file with Notepad and ANSI code...

    sorry