Improve documentation around loading.
This commit is contained in:
14
README.html
14
README.html
@@ -259,6 +259,18 @@ Loading from a file is done via Globals.loadFile():
|
||||
LuaValue chunk = globals.loadfile("examples/lua/hello.lua");
|
||||
</pre>
|
||||
|
||||
Chunks can also be loaded from a <code>Reader</code> as text source
|
||||
|
||||
<pre>
|
||||
chunk = globals.load(new StringReader("print 'hello, world'"), "main.lua");
|
||||
</pre>
|
||||
|
||||
or an InputStream to be loaded as text source "t", or binary lua file "b":
|
||||
|
||||
<pre>
|
||||
chunk = globals.load(new FileInputSStream("examples/lua/hello.lua"), "main.lua", "bt"));
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A simple example may be found in
|
||||
<pre>
|
||||
@@ -271,7 +283,7 @@ You must include the library <b>lib/luaj-jse-3.0-beta2.jar</b> in your class pat
|
||||
<h2>Run a script in a MIDlet</h2>
|
||||
|
||||
<p>
|
||||
The for MIDlets the <em>JmePlatform</em> is used instead:
|
||||
For MIDlets the <em>JmePlatform</em> is used instead:
|
||||
|
||||
<pre>
|
||||
import org.luaj.vm2.*;
|
||||
|
||||
Reference in New Issue
Block a user