Hello! I’m pretty new to Lua and using arrays in amy complexity (usually just a physics logic gal).
I have a table set up comprised of a list of beers, their country of origin, and their type, it looks like this:
[lua]
beerList = {
{bName = “Foster’s Oil Can”, bCountry = “Australia”, bType = “Lager”},
{bName = “Samichlaus”, bCountry = “Austra”, bType = “Lager”}
…etc
}
[/lua]
There are about 200 beers on this list, and I need the user to be able to view them Alphabetically, Alphabetically by Country, or by Type (I assume I’ll also have it as alphabetically just to be easier).
I’ve been trying table.sort, but I’m assuming there’s a problem with it being a table and not a standard array. I also gave “table.sort(beerList.bName)” a shot, but it didn’t like that because it isn’t a table (“Table expected, got nil”).
How should I best proceed?