Posted 08 March 2014 - 08:09 PM
I need a some help on a program I am writing.
so am following this series of tutorials on how to create you own basic OS, and I have created the files, typed in the code and I get a message every time: "paintutils:92: attempt to get length of nil" and I have only written a small amount. I first created a title bar, and that showed up. Then I tried to add my paint file to it as a desktop background using paintutils, and it gives me that message, and I don't even have 92 lines of code yet! So I went and opened up the paintutils api file, went to line 92, and all that was there was "else"?
Here is my code (hopefully you can understand it):
so am following this series of tutorials on how to create you own basic OS, and I have created the files, typed in the code and I get a message every time: "paintutils:92: attempt to get length of nil" and I have only written a small amount. I first created a title bar, and that showed up. Then I tried to add my paint file to it as a desktop background using paintutils, and it gives me that message, and I don't even have 92 lines of code yet! So I went and opened up the paintutils api file, went to line 92, and all that was there was "else"?
Here is my code (hopefully you can understand it):
-- Preload variables
slc = 0
tbarC = 8
tbartC = 1
backColor = 1
term.setBackgroundColor(backColor)
term.clear()
function titleBar() -- Draws the title bar at the top.
term.setCursorPos(1,1)
term.setBackgroundColor(tbarC)
term.setTextColor(tbartC)
term.clearLine()
term.setCursorPos(3, 1)
print("[Begin]")
end
function drawDesktop()
bground = paintutils.loadImage("main.bground")
paintutils.drawImage(bground,1,1)
titlebar()
end
drawDesktop()
Edited on 08 March 2014 - 08:03 PM