22 posts
Posted 17 April 2017 - 08:40 AM
Have you guys wondering how to create a new line after using these code like term.write to tell something to user??These are the basic function for program/api to make a new line
function newLine()
xPos, yPos = term.getCursorPos()
term.setCursorPos(1,(yPos + 1))
end
Easy huh?
726 posts
Location
Rem is best girl
Posted 17 April 2017 - 10:15 AM
you can always use print(). It has text wrapping and makes a new line after calling.
1583 posts
Location
Germany
Posted 17 April 2017 - 12:25 PM
Or just use print instead of term.write?
818 posts
Location
Wherever you want me to be
Posted 17 April 2017 - 12:58 PM
Or just use \n in the string at the end?
797 posts
Posted 17 April 2017 - 01:11 PM
term.write doesn't handle newlines. It's only print/write that do because they word wrap.
Anyway, yeah, print"", and write"\n" both do the exact same thing as the whole 4 line function.
8543 posts
Posted 17 April 2017 - 04:17 PM
It's not just that you can use write or print to more easily move to a new line, this also doesn't scroll the screen if you're already on the bottom row.
7083 posts
Location
Tasmania (AU)
Posted 17 April 2017 - 11:32 PM
Sort of worth noting that term.redirect() can be used to get access print/write through displays other than the default. External monitors, for eg.