lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


IMHO, it is possible to run Lua script from VB.
For example:

======8<================================
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 )
End If
Lua_close( L )
======8<================================

Code above is never tested!
Last time I wrote for VB dialect (Lotus Script) 6 yeas ago.

Alex


-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] 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 <glpunzi@lordzealon.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,
and, I
> would like to know, how to execute Lua scripts, using DLL instead
lua.exe.
>
> Some links to documentation would be appreciated (all the docs I see,
embbed
> Lua using lua headers from C programs)
>
> Thanks you very much, and I hope I explained well my question. (sorry
for my
> english)

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 ?