1847 posts
Location
/home/dannysmc95
Posted 20 October 2014 - 10:14 AM
How would I go about say printing lots of information on a screen without having to manually add in a new line? so use a function that will print 51 characters then next line and print the rest?
7083 posts
Location
Tasmania (AU)
Posted 20 October 2014 - 10:44 AM
write() and print() will automatically apply word-wrap in this manner, whereas term.write() will not.
Edit:
Though I suppose it's worth noting that write()/print() will only work for the purposes of outputting to whatever your active terminal is.
If you don't want to
term.redirect() to a display on which you wish to use word-wrap, then make your own function. You'll want to get the
screen size then use that information to craft a loop incorporating
string.sub() and
term.setCursorPos().
Edited on 20 October 2014 - 08:50 AM