google-code-export / skulpt

Automatically exported from code.google.com/p/skulpt
Other
1 stars 1 forks source link

Patch for /src/env.js #107

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Adds function 'loadXMLDoc()' which allows text files to be read into skulpt.
Also adds implementation of 'Sk.read()'. The location of the file is passed to 
the parameter of Sk.read().

Original issue reported on code.google.com by chris35...@gmail.com on 24 May 2012 at 2:37

Attachments:

GoogleCodeExporter commented 9 years ago
The only problem with this is that  Sk.read also must be used when loading 
standard library modules from builtin.js.  I've been thinking about this and I 
wonder if there should simply be an Sk.builtinRead function for handling the 
builtin.js modules.

On a separate note I had also implemented file IO some time ago.  My approach 
-- which is very web page oriented was to use the text from a particular 
element ID as the file.  For example  <pre id="myfile.txt">  which allows you 
to show the file contents in the web page as well as treat those lines like a 
file.

Original comment by bonelake on 26 May 2012 at 9:10