|
Hello listers,
I am trying to understand the basic mechanism of Lua stack
registrations. This Pascal code compiled, but I have a run-time error.
As it's an generic error, I could not identify what's wrong.
library opr;
{$calling cdecl}
{$mode objfpc}{$H+}
uses
lua;
function sum(l: plua_state):integer;
var
x, y: integer;
begin
lua_tonumber(l, x);
lua_tonumber(l, y);
lua_pushnumber(l, x+y);