Ok, just for completely understanding: Do you want to execute a Lua script from your Pascal program and return the boolean value to the Pascal program or do you want to implement that function in Pascal and execute it from a Lua script and return the result to the Lua script?