为什么Lua程序没有正确编译? (EEPro)

首先,我想澄清一下,我是一个完全新手,使用 Lua。 我的目标是创建一个 Java 应用程序,使用下面发布的代码。 我有一台联想 Y560,它有 Windows 7 x64 操作系统。我为此目的下载了 LuaForWindows_v5.1.4-46。 正如我所说,我的目标是为移动设备创建一个具有 Symbian OS S40 的 Java 应用程序,我的想法是将此程序从 Lua 转换为 Java。但是在此过程中,我存在疑问。 如果我发表了错误的问题,我非常抱歉。

EEPro for Nspire on Lua

尝试编译此 Lua 的程序,我得到了以下错误:

> > lua -e "io.stdout:setvbuf 'no'" "EEPro.big.lua"
> > lua: proyecto.big.lua:14: attempt to call field 'uchar' (a nil value)
> stack traceback:
proyecto.big.lua:14: in function 'utf8'
proyecto.big.lua:35: in main chunk
[C]: ?

Exit code: 1

你能告诉我为什么会出现这种情况吗?

点赞
用户1847592
用户1847592

string.uchar 可以通过这种方式来实现(只需将以下行添加到您的 EEPro.big.lua 文件开头):

function string.uchar(c, ...)
    if c then
        local t, h, s = {}, 128, string.uchar(...)
        while c >= h do
            t[#t+1] = 128 + c%64
            c = math.floor(c/64)
            h = h > 32 and 32 or h/2
        end
        t[#t+1] = 256 - 2*h + c
        return s.char((table.unpack or unpack)(t)):reverse()..s
    else
        return ''
    end
end
2013-06-23 18:44:21