I am trying to draw a list using a for/each statement with multiple variables. What i am getting is each of ten items drawn in each of ten slots, where i want one item in each slot.
Is this possible? I am not seeing it yet.
for i = 0 to 9
for n = 1 to 10
for p = 211 to 589 step 42
m.screen.drawtext( n.toStr()+")" , 810, p, grey, font6) 'playlist:
m.screen.drawtext( m.item[i]["title"] ,850, p, grey, font6) ' song title
end for
end for
end for
gonzotek - Thank you! I think that should work, I’ll give it a try.
All I’m really trying to do is reduce the amount of code on the page. This is for an audioplayer on a roscreen which displays the playlist, either 10 of thirty items so its just a massive amount of stuff to scroll through all the time while working on it. I currently have the playlists offloaded into other functions, but of course that makes the redrawing real slow and that code will have to come back into the main function eventually, so less is better.
Thanks again.
destruk - Thank you for that - I tried it that way but not quite exactly and it didn’t work so I questioned if it was possible, turns out it was bad syntax as usual. I will try this way too, it seems yours and gonzotek’s are two good solutions to the same problem.