testfile.es

来自「javascript source code part2」· ES 代码 · 共 14 行

ES
14
字号
// simple FESI code showing file IO support

var fileToWorkWith = File("testfile.txt");
fileToWorkWith.remove();
fileToWorkWith.open();
for  (i=1; i<=100; i++)
 fileToWorkWith.writeln("Number is "+i); 
fileToWorkWith.close();
alert ("File is at " + fileToWorkWith.getAbsolutePath());
var allString=fileToWorkWith.readAll();
var strSplit = allString.split("\n");
alert ("The third line says " + strSplit[2]);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?