lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello all,
 
First of all, I would like to get a confirm from someone if I'm still recieving mail
from the Lualist, I havn't had any mail in ages. (Last mail was since the new
donation announcement.)
 
Here is my real issue, I know how to register functions, push strings etc, but I
would love to know how to register methods in back-end lua.
 
methods = {
    ReturnBla = function()
        return self.bla;
    end
    SetBla = function(...)
        self.bla=arg[1];
    end
};
function constructor()
     local obj = {bla=true};
     setmetatable(obj,{__index=methods});
     return obj;
end
Obj = constructor();
Obj:SetBla(false);
 
 
I would like to achieve the above from within a C/PureBasic code,
so I could register methods like those.
 
Can anyone give me some information regarding this method?
If I talk like rubbish (I've been known to), please correct me hehe.
Thanks,
Bas Groothedde.