Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Kylotan

Lua: lua_dostring, loadstring, lua_load, etc

This topic is 5202 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I think this was covered before, but it came up again today when I was talking about recompiling code from a string: Lua 4.0 has a function called lua_dostring() which executes a string, treating it as Lua code. Lua 5.0 mentions (near the bottom of the manual) that ''dostring is deprecated. Use loadstring instead''. But there is no loadstring (or lua_loadstring) in the C API. I''m assuming you use lua_load() and that the mention of loadstring in the manual was just a mix-up. lauxlib.h provides lua_dostring() in the Compatibility section so I assume you can still use that anyway, it seems. Does anybody know if my theory is right though? [ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
The mention in the manual about loadstring refers to Lua code.

You should use lua_load instead of lua_dostring in C code.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I''m told there''s a luaL_dobuffer (or something, note the "L" utility function, but I haven''t checked this out yet.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!