I'm a bit confused
Posted: Wed Jan 21, 2015 9:47 am
I picked the MM2 XML project up again when I last stopped I wanted to add a compatible layer for ROMbot because I can't remeber where I stopped I wanted to runt the code how it is, to see where it ends and what I missed.
I have this code ...
I added the waypointlist form Rombot but what I got is:
Some how I'm blind I don't get why MM won't find the load2 function ???
I have this code ...
Code: Select all
xml = XML()
Code: Select all
local xmlDLL = require("LuaXml");
include("Node.lua");
---local stack = {};
XML = class(
function (self)
-- <mylabel,</mylabel
self.stack = {};
self.lastXML = {};
end
);
function XML:pushS(symbol)
table.insert(self.stack, symbol)
end
function XML:popS()
-- = stack[#stack];
local entry = table.remove(self.stack,#self.stack);
return entry;
end
function XML:load2(file)
self:validXML(file)
self.lastXML = xmlDLL.load(file);
return self.lastXML;
end
function XML:open(file)
--TODO: add file checks
local xml_load = self:load2(file)
local node = parse(xml_load)
return node;
end
Code: Select all
Failed to run init function, err code: 7 (Runtime error)
Xml.lua:33: attempt to call method 'load2' (a nil value)
stack traceback:
Xml.lua:33: in function 'open'
waypointlist.lua:24: in function 'load'
main.lua:46: in function <main.lua:10>