So working again with table views. Essentially I am trying to to take data from within a table that is within a table and for now print it out to the console. Once i have it working in the console, I can make it do what i need to do, but I am having issues with this part of it.
Here is the table…
albumData = { {albumName = "Cry Sister - Single", albumYear = "2013", albumCover = "crysister.png", songsTitle = {"Cry Sister"}, songsURL = {"audio/crysister-pre.m4a"} }, {albumName = "Waiting Out The Storm", albumYear = "2012", albumCover = "waitingstorm.png", songsTitle = {"I Got This", "Monster"}, songsURL = {"audio/igot-pre.m4a", "audio/monst-pre.m4a"} } }
The tables songsTitle, and songsURL are both tables within the master table albumData (if I have the table built right). Both of those sub tables will have varying data indexes within. Some may have 1 entry, some 3 some 12 etc…
The table view is not my problem, I can pull the first three variables and have them display properly with no issues. The issue is when i try to loop the secondary tables.
What I have been doing is this…
for i = 1, #albumData do print(albumData[i].albumName) print(albumData[i].albumYear) print(albumData[i].albumCover) end
i have tried creating a new loop within the loop, but it did not seem to work. Basically I need to be able to loop through each album in the table and while doing that loop through each song to make a list that coincides with the album. So when printed to console the above table should look like…
Cry Sister - Single 2013 crysister.png Cry Sister audio/crysister-pre.m4a Waiting Out The Storm 2012 waitingstorm.png I Got This audio/igot-pre.m4a Monster audio/monst-pre.m4a
Any help on this is would be greatly appreciated. Thanks in Advance