864 posts
Location
Sometime.
Posted 19 September 2012 - 01:33 AM
Let my pictures explain!
mon = peripheral.wrap("right")
test = [[This is a test
with diffrent lines
like a nice monitor should..]]
mon.write(test)
[attachment=468:2012-09-18_19.32.51.png]
[attachment=469:2012-09-18_19.32.56.png]
1604 posts
Posted 19 September 2012 - 01:40 AM
The write function in the in the monitor (also on the term api) doesn't handle newlines, that's why there's a global write function that does that. If you want to use it with monitors you have to use term.redirect:
write([[
Some multiline text
on the console
]])
term.redirect(mon) -- mon is the wraped monitor
write([[
Now on
the monitor
]])
term.restore()
print("Back to the console")
864 posts
Location
Sometime.
Posted 19 September 2012 - 01:42 AM
The write function in the in the monitor (also on the term api) doesn't handle newlines, that's why there's a global write function that does that. If you want to use it with monitors you have to use term.redirect:
write([[
Some multiline text
on the console
]])
term.redirect(mon) -- mon is the wraped monitor
write([[
Now on
the monitor
]])
term.restore()
print("Back to the console")
It wasn't a question.. I was just saying they should add newlines to monitors. I know how to do the term.redirect()..
Technically it is a bug though because of the '?'.
1604 posts
Posted 19 September 2012 - 01:48 AM
Oh, sorry. Is just that all the information on your post confused me :)/>/>
Anyway, I think it's fine like that. Why should the monitor handle the newlines? It doesn't handle any special characters, since all it does is display the given characters on the screen. And it's really easy to workaround (as I posted above).
2447 posts
Posted 19 September 2012 - 08:37 AM
Isn't a bug. Closed.