[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: creating and evaluating functions -- Lua 4.0 vs Lua 5.0
- From: Jilani Khaldi <jilani.khaldi@...>
- Date: Wed, 18 Jun 2003 23:55:15 +0200
Hi,
lua_load is a very generic function to
load code (you execute it afterwards
with lua_call or lua_pcall). Try
luaL_loadfile and luaL_loadbuffer.
But, if you prefer, lua_dostring still
exists, it is declared in lauxlib.h
(lauxlib.pas, for Delphi).
Trying with "luaL_loadbuffer", the result is always "Error! ...".
...
st := 'print("Hello Lua!")';
k := luaL_loadbuffer(L,PChar(st), sizeof(st), '');
if k <> 0 then
ShowMessage('Error! Lua interpreter failed');
...
Trying with "luaL_loadfile", the result is always the same "Error! ...".
...
st := 'print("Hello Lua!")';
k := luaL_loadbuffer(L,PChar(st));
if k <> 0 then
ShowMessage('Error! Lua interpreter failed');
...
What am I missing with paramaters?
Thanks!
jilani