globals: print, s2 || show examples || read the manual
s2.Buffer.new().append('').writeFile('exists'); print(s2.PathFinder.new().search('exists') ? 'file exists' : 'file not found'); print(s2.PathFinder.new().search('404') ? 'file exists' : 'file not found');;Run in Editor
print(s2.json.stringify({ 'this': 'is', 'a': 'native', 'object': 'which', 'gets': 'converted', 'to': 'a', 'json': 'string' }));;Run in Editor
[ true, false, null, undefined, -1, 0, 1, 1.0, '1.0', {}, [], proc(){}, s2.Hash.new(), s2.Buffer.new(), s2.PathFinder ].eachIndex(proc(v){ s2.dumpVal(v) });;Run in Editor
foreach (s2 => k) { var o = 's2.' + k; foreach (s2[k] => v) { o += '\n' + 's2.' + k + '.' + v; }; print(o) };; Run in Editor
// Write Heredoc to a File s2.Buffer.new().append(<<<:EOF print(__FLC); EOF).writeFile('test.s2'); // Import the Script File s2.import('test.s2'); // Load and Print the File's Contents print(s2.Buffer.readFile('test.s2'));;Run in Editor
print('Started: ' + s2.time.time()); s2.time.sleep(1); print('Finished: ' + s2.time.time());;Run in Editor