Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I'm having some troubles working out how to iterate through every row in a grid

If I use like "each x in grid.value" I get each column separately. And I can do it if I refer to each row with the index like "each x in count y" and then "grid.value[x]" that seems to be an option but I can't seem to find a way of getting the total size so that I know how far to go.

Is there something I'm missing? Is there a cleverer way of doing this?

The "rows" primitive turns a table into a list of dictionary, with each dictionary representing a row.

You can thus iterate over the rows of the table stored in a grid something like:

each row in rows mygrid.value
 # ...
end

More broadly, though, what are you trying to do? There might be better alternatives depending on the application.

I'm working on the launcher for my Deck Kiosk - so I'm starting with the sample code you sent me with the directory listing but I want to have it go through and  open up each deck and pull out the name (and maybe the author) for each deck so that things look a bit friendlier than just a filename. I tried doing it as part of the select statement but it didn't seen to work, I guess because the function I was using didn't work nicely over a vector?