On Wed, 8 Jun 2016, Henrique Andrade wrote:
Dear Allin and Jack,
I think Gretl is making something wrong regarding to line breaks :-(
Please take a look at the following script:
<hansl>
outfile "(a)dotdir/test1.txt" --write --quiet
loop i = 1..5 --quiet
print "We all love Gretl!"
endloop
outfile --close
outfile "(a)dotdir/test2.txt" --write --quiet
string s1 = readfile("(a)dotdir/test1.txt")
print s1
outfile --close
string s2 = readfile("(a)dotdir/test2.txt")
printf "\n# String 1:\n%s\n# String 2:\n%s", s1, s2
<\hansl>
I think the strings 1 and 2 are the same, but s1 has CR LF line breaks
and s2 has CR CR LF line breaks. This behavior is breaking my script
that generates markdown file format documents (.md).
Your script works fine on Linux (the two strings are the same, and
look the same when printed via printf). I'll have to test on Windows
to see what's happening with Microsoft-specific line endings.
Allin