Hallo zusammen.
Ich muss mal wieder meine beschränkten Programmierkünste zur Schau stellen
Kann mir einer Sagen, warum bei nachfolgendem Code von table.getn die Null zurück geliefert wird?
[lua] self.mySprays = {};
self.mySprays[Fillable.FILLTYPE_UNKNOWN] = true;
local sprayTypes = getXMLString(xmlFile, "vehicle.sprayFillTypes#fillTypes");
if sprayTypes ~= nil then
local types = Utils.splitString(" ", sprayTypes);
for _,v in pairs(types) do
print(v);
local sprayType = Fillable.fillTypeNameToInt[v];
print(sprayType);
if sprayType ~= nil then
self.mySprays[sprayType] = true;
print(tostring(self.mySprays[sprayType]));
else
print("Warning: '"..self.configFileName.. "' has invalid sprayType '"..v.."'.");
end;
end;
end;
print(table.getn(self.mySprays));[/lua]
prints in der Log:
Gruß & Dank im voraus!