Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this simple iteration not work?

Asked by
unmiss 337 Moderation Voter
8 years ago
local shirts = {
    [1] = {
        Asset = 123456789;
        Name = "White T-Shirt";
        Price = 50;
    };
    [2] = {
        Asset = 987654321;
        Name = "Blue Jacket";
        Price = 120;
    };
}

for _,top in ipairs(shirts) do
    for k,prop in ipairs(top) do
        print(k.."="..prop)
    end
end

Nothing to say, really.

Answer this question