Rellica
|
  |
| Joined: 11 May 2013 |
| Total Posts: 955 |
|
|
| 01 Jan 2015 10:38 AM |
Is it possible to read data from the next subject in a table, here's my example:
local songs = { One = {196293583, 20}, Two = {184377620, 20}, }
I setup a music player and it runs smooth, but 3/4 of the way through the song I want to make a textlabel appear saying the next song, problem is I can't figure out how to get the next subject in the table, I tried to add 1 to the current data (stupid idea) thinking it'd work but it didn't, help? |
|
|
| Report Abuse |
|
|
Rellica
|
  |
| Joined: 11 May 2013 |
| Total Posts: 955 |
|
| |
|
|
| 01 Jan 2015 10:39 AM |
dont use a dictionary - use a normal array so you can index by a number
local songs = { {196293583, 20}, {184377620, 20}, }
songs[1] songs[2] ... songs[n] |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2015 10:39 AM |
uh, subject? what's a subject?
are you referring to the key or the value, or the pair together? |
|
|
| Report Abuse |
|
|
Rellica
|
  |
| Joined: 11 May 2013 |
| Total Posts: 955 |
|
|
| 01 Jan 2015 10:49 AM |
| I don't understand this, I just can't make it work.. |
|
|
| Report Abuse |
|
|
Rellica
|
  |
| Joined: 11 May 2013 |
| Total Posts: 955 |
|
| |
|
Rellica
|
  |
| Joined: 11 May 2013 |
| Total Posts: 955 |
|
| |
|
| |
|
Rellica
|
  |
| Joined: 11 May 2013 |
| Total Posts: 955 |
|
| |
|
|
| 13 Jan 2015 09:31 AM |
"dont use a dictionary - use a normal array so you can index by a number
local songs = { {196293583, 20}, {184377620, 20}, }
songs[1] songs[2] ... songs[n]" |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2015 09:41 AM |
| Look up on LinkedLists, you can implement number indexing on a non-array taxable, but it's useless. |
|
|
| Report Abuse |
|
|