Mac and Win (and Linux) have odd, different histories on how newlines are used. There are a number of things happening here:
- you are putting some sort of newline sequence into your string. It may vary between Win and Mac.
- SaveTextFile may be doing some host specific conversion on the newlines. It may vary...
- Different editors may treat newline sequences differently. It may vary...
JMP can control the first two, and most likely you can find a set of newline characters that works for your editors.
To set the newline sequences, try one of these to replace any sequence of CR and LF with a predictable sequence
lakepar = regex(lakepar,"[\n\r]+","\!n",GLOBALREPLACE);
// or
lakepar = regex(lakepar,"[\n\r]+","\!r",GLOBALREPLACE);
// or
lakepar = regex(lakepar,"[\n\r]+","\!r\!n",GLOBALREPLACE);
LF, CR, or CRLF are the usual possibilities for a newline sequence.
To prevent savetextfile from converting newline sequences to what it thinks the host needs, save a blob:
saveTextFile( "$desktop/x.txt", chartoblob(lakepar) );
To peek at the string or file, use a blob:
show(chartoblob(lakepar));
// or
show(loadtextfile( "$desktop/x.txt", blob));// to view
Load Text File("$desktop/x.txt", blob) = Char To Blob( "abc~0D~0Adef~0D~0Aghiu", "ascii~hex" );
~0D is a CR and ~0A is a LF
Craige