This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Noodle's profile picture

[1.41] Monitor '?'

Started by Noodle, 18 September 2012 - 11:33 PM
Noodle #1
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]
MysticT #2
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")
Noodle #3
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 '?'.
MysticT #4
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).
Cloudy #5
Posted 19 September 2012 - 08:37 AM
Isn't a bug. Closed.