mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Lua: use of loadstring replaced with load; loadstring is deprecated. (#4275)
This commit is contained in:
parent
3aa763520b
commit
57fe664a50
@ -383,8 +383,9 @@ dofile('mod2.lua') --> Hi! (runs it again)
|
||||
-- loadfile loads a lua file but doesn't run it yet.
|
||||
f = loadfile('mod2.lua') -- Call f() to run it.
|
||||
|
||||
-- loadstring is loadfile for strings.
|
||||
g = loadstring('print(343)') -- Returns a function.
|
||||
-- load is loadfile for strings.
|
||||
-- (loadstring is deprecated, use load instead)
|
||||
g = load('print(343)') -- Returns a function.
|
||||
g() -- Prints out 343; nothing printed before now.
|
||||
|
||||
--]]
|
||||
|
Loading…
Reference in New Issue
Block a user