for an example
table1 = {"item1","item2","item3"}
function scroll(table)
--scroll through items on a table
end
scroll(table1)
that will outputitem1 | item2 | item3 | item1 | item2 | item3 | ite
and continue scrolling like that.
Posted 03 July 2015 - 09:23 AM
table1 = {"item1","item2","item3"}
function scroll(table)
--scroll through items on a table
end
scroll(table1)
that will outputPosted 03 July 2015 - 11:23 AM
function scroll(tab) --#table is a global variable, so I will use tab start.x, start.y = term.getCursorPosition() --#this is in 1.74 only (I think). An alternative is to pass these as parameters. Also I may be getting the function names slightly wrong for i, #tab do term.setCursorPosition(unpack(start)) print(tab[i]) --#this may leave some leftover characters from the previous string --#a solution to above comment would be to print spaces till this combined string is the same length as the longest one in your table sleep(1000)--#wait one second so we can see it end--#for loop end--#function
Edited by Lupus590, 03 July 2015 - 11:23 AM.
Posted 03 July 2015 - 11:43 AM
Edited by Wait_, 03 July 2015 - 11:44 AM.
Posted 03 July 2015 - 12:41 PM
Posted 03 July 2015 - 12:44 PM
function scroll(tab) --#table is a global variable, so I will use tab start.x, start.y = term.getCursorPos() --#this is in 1.74 only (I think). An alternative is to pass these as parameters. for i, #tab do term.setCursorPos(unpack(start)) print(tab[i]) --#this may leave some leftover characters from the previous string --#a solution to above comment would be to print spaces till this combined string is the same length as the longest one in your table sleep(1000)--#wait one second so we can see it end--#for loop end--#function
Edited by Lupus590, 03 July 2015 - 12:44 PM.
0 members, 3 guests, 0 anonymous users