[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Using LUA directly from the DLL
- From: "Alexander Altshuler" <alt@...>
- Date: Tue, 23 Dec 2008 14:05:59 +0300
IMHO, it is possible to run Lua script from VB.
Declare Function lua_newstate Lib "lua51.dll" ( ByVal f As Long, ByVal
ud As Long ) As Long
Declare Sub luaL_openlibs Lib "lua51.dll" ( ByVal L As ong )
Declare Function luaL_loadfile Lib "lua51.dll" ( ByVal L As Long, ByVal
filename As String ) As Long
Decalare Function lua_pcall Lib "lua51.dll" ( ByVaL L As Long, ByVal
nargs As Long, ByVal nresults As Long, ByVal errfunc As Long ) As Long
Declare Sub lia_close Lib "lua51.dll" ( ByVal L As Long )
Dim L as Long
L = lua_newstate( 0,0 )
luaL_openlibs( L )
Dim ok as Long
ok = luaL_loadfile( L, "myfile.lua" )
If ok Then
Lua_pcall( L, 0, -1, 0 )
Lua_close( L )
Code above is never tested!
Last time I wrote for VB dialect (Lotus Script) 6 yeas ago.
[mailto:firstname.lastname@example.org] On Behalf Of Jerome Vuarand
Sent: Tuesday, December 23, 2008 12:34 PM
To: Lua list
Subject: Re: Using LUA directly from the DLL
2008/12/23 Giuseppe Luigi Punzi <email@example.com>:
> I'm testing a development platform, and I would like to test Lua as
> interface from scripting some things.
> I don't have the possibility to compile with Lua headers and so on,
> would like to know, how to execute Lua scripts, using DLL instead
> Some links to documentation would be appreciated (all the docs I see,
> Lua using lua headers from C programs)
> Thanks you very much, and I hope I explained well my question. (sorry
What can you do with your development platform if you cannot compile C
code and cannot execute precompiled lua.exe file ? How can you access
a DLL otherwise ?