Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
d9b412fb
Commit
d9b412fb
authored
Apr 14, 2013
by
Vinicius Jarina
Browse files
Update README.md
parent
552e4093
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
d9b412fb
...
...
@@ -22,23 +22,34 @@ iOS : [
```
csharp
string
url
=
@"http://raw.github.com/NLua/NLua/master/README.md"
;
string
script
=
@"
luanet.load_assembly ('System.dll')
WebClient = luanet.import_type ('System.Net.WebClient')
local client = WebClient ()
local ret = client:DownloadString (url);
return ret;
"
;
local s = Scriptable (""My String Parameter"")
s:DoSomething ()
print (s.Param1)
local ret = s:SumOfLengths (""Name"", 10);
print (tostring(ret))
Scriptable.Print(""Hello NLua"")
s.Param3 = 0.5;
local p2 = tostring(s.Param3)
print (p2)
"
;
using
(
Lua
lua
=
new
Lua
())
{
lua
[
"url"
]
=
url
;
lua
.
LoadCLRPackage
();
lua
.
DoString
(
@" import ('NLuaSample') "
);
lua
[
"gValue"
]
=
"This is a global value"
;
// You can set a global value.
var
returns
=
lua
.
DoString
(
script
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment