指數如何,我可以把我的循環值到一個數組,如果我有這樣的代碼?在LUA循環如何與陣列
local data = {
for row in db:nrows("SELECT song.id, song.title as title, artist.name as name FROM song, artist where song.artist_id = artist.id") do
{
song = row.title,
artist = row.name
}
end
}
,但我得到這個錯誤:
unexpected symbol near 'for'
我只是想成爲這個樣子......
local data = {
{
song = "HI",
artist = "Tom"
}
{
song = "Hello",
artist = "mike"
}
...
}
可有人能幫助我我的情況或提供一些意見關於它? 由於事先
萊納斯感謝你的答案...你的問題,我只是想爲'tableView.lua'我電暈SDK數組.. – gadss