Robert, good first try. There are a few things in the lua.pas file that arn't quite right. Apparently I haven't updated the lua.pas that is on the website in a while (my apologies).

Try downloading: http://www.eonclash.com/LUA/luaexec.zip

It is an updated version of what you posted that runs just fine . You will want to use the units (lua, luawrapper, luautils, cutils, and luaobject) from this zip file for your projects. Basically part of the problem was that in FPC result doesn't exist, you have to use function name:[pascal]// This won't work in fpc
function Test():Integer;
begin
result := 1;
end;
// This is the "proper" way to do it
function Test():Integer;
begin
Test := 1;
end;[/pascal]

Also, in your lua_KeyPressed method you never set the method result. So I added it in for you . Now everything should work fine.

I also had a problem in the code I gave you. I did a create table and then a tointeger, that tointeger should have been a gettop

Finally, a minor fix in the push to accommodate searchResult.Name instead of path + mask makes it all work hunky dory.