Hi all,
Unfortunately, Javascript isn't my first (programming) language and I'm
struggling to get to grips with creating a simple plain text file from a
script. I've spent hours staring at the JS Object Model Reference
(http://synchro.net/docs/jsobjs.html) and I just cannot work it out.
This is what I've got so far:
var f = new File('test.txt');
file.open('w');
file.writeln('Line 1');
file.writeln('Line 2');
file.close();
I've tried the file.open(file_exists(file.name) ? 'r+':'w+'); line mentioned
in the documentation and I just cannot get this to work.
Any code suggestions would be welcome!
Thanks,
Lab Rat.
---
■ Synchronet ■ Toxic Laboratory BBS - Birmingham, UK - toxicbbs.com
|