--- In [hidden email], kevinjardine <no_reply@...> wrote:
> in case anyone asks, I did try
> as well as
> All failed.
Since Plua 2.0b4, loadlib is the standard loadlib function present in
Lua 5.0. For an usage example, look at the LuaCalc.lua application
local l3dinit = loadlib("3dlib2","init")
if not l3dinit then
gui.alert("This app requires 3dlib2.prc")
You must test if the function returned by loadlib is not null and then
call it to initialize the library. Also look at the PluaLibInit
function inside 3dlib.c in libkit. This is the C function that is
called when you call l3dinit in the example. The second argument is
supposed to be a C function name ("init" in this example), but PalmOS
does not support this. So inside PluaLibInit you can choose what
funtion to return based on the name argument.
local testinit = loadlib("TestLib2","init")
I don't understand why loadlib appears to refer to the function it is
sitting inside instead of a function in the library.
It would be great to add some libkit documentation to the otherwise
excellent Plua manual supplied with the interpreter. Plua is a
fantastic language - the best I've ever seen for the Palm, and libkit
opens the way to an incredible range of functions.
Thanks for giving us a great piece of software, Marcio!