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

Function error?

Started by hyperpika11, 14 March 2015 - 04:18 PM
hyperpika11 #1
Posted 14 March 2015 - 05:18 PM
Hi.i want to create a file with some improved functions, to make the creation of apps or operative system more easier.
That is my problem.
When i call the my function:
form.createTitleBar("[Menu]",1,1,32,128)
, i've get this error:

window:57:excepted number
Press any key to continue
After 5 seconds my pc will be shutdown if i don't press any key.
This append only with the form.createTitleBar() function not with other
There is the function:

function form.createTitleBar(Testo,X,Y,ColoreSfondo,ColoreTesto)
local w,h = term.getSize()
term.setCursorPos(1,Y)
term.setTextColor(Sfondo)
term.setBackgroundColor(Sfondo)
term.clearLine()
for V=0,w,1 do
  term.setCursorPos(V,Y)
  write(".")
end
term.setTextColor(ColoreTesto)
term.setCursorPos(X,Y)
write(Testo)
end
Where is the problem?
SpencerBeige #2
Posted 14 March 2015 - 06:07 PM
well, when you defined the function you used colorSfondo. if you later want to use that variable, you cant use sFondo, you have to use colorSfondo