how to set linebreak property in file object

Mar 25, 2006 at 11:34am

how to set linebreak property in file object

hi again,
i would like to set the linebreak property of the file object to
something different than “native”, to hopefully end up with a NL
character (ascii 10) at the end of a text line i create with writeline
(), rather than a CR (ascii 13).

maybe someone can point me to where i go wrong.
thanks,
volker.

function writefile(s)
{
var f = new File(s,”write”,”TEXT”);
post(f.linebreak, “n”);
f.linebreak = “unix”;
post(f.linebreak, “n”);
if (f.isopen) {
for(i=0;i<3;i++){
f.writeline(“abc”);
}
f.close();
} else {
post(“could not create file: ” + s + “n”);
}
}

#25077
Mar 25, 2006 at 5:24pm

Hi Volker,

Thanks for finding this bug in File (which also pointed to similar
problems with the byteorder attribute). These problems will be fixed
in the next release of Max, so for the time being you will need to
use the newline character in the written string, rather than the
writeline() method. For example:

myfile.writestring(“foo barn”);

Hope this helps.

-Joshua

#73393
Mar 25, 2006 at 7:05pm

yap, that solves it for now.
thanks.
volker.

#73394

You must be logged in to reply to this topic.