#1
Posted 21 December 2012 - 11:28 AM
#2
Posted 21 December 2012 - 11:30 AM
print("This is my first line!")
print("This is my second line!")
Ignore everything I just said
#3
Posted 21 December 2012 - 11:31 AM
plain text:
print("this is line 1 \n this is line 2")
defined functions
print(line1.."\n"..line2)
the \n tells the print function to print on the next line
#4
Posted 21 December 2012 - 11:54 AM
NDFJay, on 21 December 2012 - 11:31 AM, said:
plain text:
print("this is line 1 \n this is line 2")
defined functions
print(line1.."\n"..line2)
the \n tells the print function to print on the next line
Oh. I was trying to use two seperate print functions! So i just need to compile them into one print function?
#5
Posted 21 December 2012 - 11:55 AM
jewelshisen, on 21 December 2012 - 11:54 AM, said:
NDFJay, on 21 December 2012 - 11:31 AM, said:
plain text:
print("this is line 1 \n this is line 2")
defined functions
print(line1.."\n"..line2)
the \n tells the print function to print on the next line
Oh. I was trying to use two seperate print functions! So i just need to compile them into one print function?
what are you trying to print? it should work with 2 seperate print functions to print on seperate lines but compiling then into 1 makes the code cleaner, both ways should work
post your code if it still doesnt work
#6
Posted 21 December 2012 - 12:12 PM
jewelshisen, on 21 December 2012 - 11:54 AM, said:
NDFJay, on 21 December 2012 - 11:31 AM, said:
plain text:
print("this is line 1 \n this is line 2")
defined functions
print(line1.."\n"..line2)
the \n tells the print function to print on the next line
Oh. I was trying to use two seperate print functions! So i just need to compile them into one print function?
forget everything I said... try this
n = peripheral.wrap("left") --n is the printer
n.newPage()
n.write("Text for line 1 here")
n.setCursorPos(1,2)
n.write("Tesxt for line 2 here")
n.endPage()
#7
Posted 21 December 2012 - 01:14 PM
Also it is good practise to include the code that you have currently got so that we can take a look at it and suggest fixes to you
#8
Posted 21 December 2012 - 01:15 PM
NDFJay, on 21 December 2012 - 12:12 PM, said:
jewelshisen, on 21 December 2012 - 11:54 AM, said:
NDFJay, on 21 December 2012 - 11:31 AM, said:
plain text:
print("this is line 1 \n this is line 2")
defined functions
print(line1.."\n"..line2)
the \n tells the print function to print on the next line
Oh. I was trying to use two seperate print functions! So i just need to compile them into one print function?
forget everything I said... try this
n = peripheral.wrap("left") --n is the printer
n.newPage()
n.write("Text for line 1 here")
n.setCursorPos(1,2)
n.write("Tesxt for line 2 here")
n.endPage()
YES! It fixed it! See everytime i tried to use \n to make a new line it just returned a ? and kept on the same line!
#9
Posted 21 December 2012 - 01:27 PM
jewelshisen, on 21 December 2012 - 01:15 PM, said:
NDFJay, on 21 December 2012 - 12:12 PM, said:
jewelshisen, on 21 December 2012 - 11:54 AM, said:
NDFJay, on 21 December 2012 - 11:31 AM, said:
plain text:
print("this is line 1 \n this is line 2")
defined functions
print(line1.."\n"..line2)
the \n tells the print function to print on the next line
Oh. I was trying to use two seperate print functions! So i just need to compile them into one print function?
forget everything I said... try this
n = peripheral.wrap("left") --n is the printer
n.newPage()
n.write("Text for line 1 here")
n.setCursorPos(1,2)
n.write("Tesxt for line 2 here")
n.endPage()
YES! It fixed it! See everytime i tried to use \n to make a new line it just returned a ? and kept on the same line!
its a bit odd, the wiki says it works the same as the term and mon API's but apparently not, theres probably something we're missing but either way it works now
#10
Posted 21 December 2012 - 01:36 PM
Also, I don't see this mentioned earlier so I'll say it. This post is in the wrong section. Programs is reserved for actual published programs, it just makes finding stuff easier.
#11
Posted 21 December 2012 - 01:44 PM
Orwell, on 21 December 2012 - 01:36 PM, said:
Also, I don't see this mentioned earlier so I'll say it. This post is in the wrong section. Programs is reserved for actual published programs, it just makes finding stuff easier.
Thats actually a good point, I've spent so much time in the "Ask A Pro" section lately I didnt even notice it was in the wrong place lol I think I need sleep, my brains not functioning right... maybe after one more line of code
#13
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











