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

Error With Line 19 - Please More Answers

Started by MailoStudios, 16 October 2013 - 12:16 PM
MailoStudios #1
Posted 16 October 2013 - 02:16 PM
In my Programm is in Line 19 an error.
I can Not Write Print or set the Background in line 19
When i try to Print in that line it Print in line 18 and line 1 disappears
sorry for my bad english

It is when i have an Advanced Computer with mouse clicks
Zudo #2
Posted 16 October 2013 - 02:22 PM
Well if you don't post your code no one can help you.
MailoStudios #3
Posted 16 October 2013 - 02:45 PM
Here is the Code
loggeduser = "admin"
-- The Username have to max 7 Letters and Numbers not more!
slc = 0
term.clear()
function load()
background()
desktop()
end
function background()
term.setBackgroundColor(8)
term.clear()
bg = paintutils.loadImage("/Volumes/M_System/System/.background")
paintutils.drawImage(bg,1,1)
end
function desktop()
term.setCursorPos(1,1)
term.setBackgroundColor(colors.gray)
term.setTextColor(1)
write(" M   Programme   System							")
term.setCursorPos(45,1)
print(loggeduser)
term.setCursorPos(1,19)
print("MailoOS 4.0")
end
function Mmenu()
term.setCursorPos(1,2)
term.setBackgroundColor(1)
term.setTextColor(colors.black)
print("			  ")
end
load()

while true do
local event, button, X, Y = os.pullEventRaw()
if event == "mouse_click" then
  if slc == 0 then
   if X>=1 and X<=3 and Y==1 and button ==1 then
   term.setCursorPos(1,1)
   term.setBackgroundColor(colors.black)
   print(" M ")
   Mmenu()
   slc = 1
   end
  elseif slc == 1 then
   if X>=1 and X<=3 and Y==1 and button ==1 then
   slc = 0
   load()
   end
  end
end
end
Inumel #4
Posted 16 October 2013 - 03:08 PM
write(" M Programme System
\
You are missing the ending "), It should look like this


write(" M   Programme   System ")
MailoStudios #5
Posted 16 October 2013 - 03:14 PM
There is an ending
write(" M   Programme   System												  ")
– it is in the middle of the code box
theoriginalbit #6
Posted 16 October 2013 - 03:16 PM
what does the error say?
MailoStudios #7
Posted 16 October 2013 - 03:17 PM
there is no error i can not write what on line 19 when i have a mouse_click in the program
when i try to writing on line 19 it is in the program so ist go to line 18 and in line 19 is the background
MailoStudios #8
Posted 16 October 2013 - 03:27 PM
Here a Picture
Lyqyd #9
Posted 16 October 2013 - 05:05 PM
If you're using print(), it automatically appends a newline, so will scroll the screen if you are printing to the bottom line. Use term.write() or perhaps write() instead.