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

[error/bios:474 String Expected]

Started by BLKMMB, 19 February 2013 - 12:38 AM
BLKMMB #1
Posted 19 February 2013 - 01:38 AM
[EDIT]
I forgot to put this :
Title : [error/bios:474 String Expected]
[/end EDIT]

Hi, I have an error with this code when I try to write on a monitor. The same code works fine for the computer, but when I change it for monitor I tells me bios:474 String expected.

heres the code (ignore all the comment junk it was for running step by step test to see if everything worked):

–local fap = os.time()
–local wO, hO = term.getSize()
–local xO, yO = term.getCursorPos()
–local fapL = 0
–os.loadAPI("sync")
–monitor = peripheral.wrap(right)
while true do
–sync.redirect(true)
–sync.addMonitor(right)
monitor = peripheral.wrap(right)
fap = os.time()
wO, hO = monitor.getSize()
fap = textutils.formatTime(fap, true)
fapL = string.len(fap)
–print(fapL)
–print(wO)
–print(hO)
xC = math.floor((wO-fapL)/2)
–print(xC)
yC = math.floor(hO/2)
monitor.setCursorPos(xC, yC)
monitor.write(fap)
sleep(1)
monitor.clear()
end



thank you!
remiX #2
Posted 19 February 2013 - 04:42 AM
monitor = peripheral.wrap("right")

right needs to be in quotes
BLKMMB #3
Posted 19 February 2013 - 05:28 AM
Wow! I can't believe I missed that. Thank you. I even made a printer program before that one with the wrap function and I wrote it ok, this is what happens when you code past midnight.