11 posts
Posted 04 April 2014 - 06:11 PM
Hello dudes and programmers
I need some help with my program, i made. It's a Cash Register, so i have to print a paper with price and etc.
But i can't print variables?
printer = peripheral.wrap("right")
printer.newPage()
printer.write("Hello i'm a printer", Variable)
printer.endPage()
When it prints, i only get "Hello i'm a printer" and not the variable…
I'm new at lua, but good at C#. That's why it's easy to learn new programming languages.
Please help :)/>
3790 posts
Location
Lincoln, Nebraska
Posted 04 April 2014 - 06:35 PM
Moved to Ask A Pro.
Make sure you post questions in the correct section, so that you can get the most exposure.
As far as your question goes however, have you already defined the variable? Additionally, the comma is not how you concatenate variables in Lua. Use a double period, like this:
printer.write("Hello i'm a printer" .. Variable)
Edited on 04 April 2014 - 04:36 PM
11 posts
Posted 04 April 2014 - 07:37 PM
Moved to Ask A Pro.
Make sure you post questions in the correct section, so that you can get the most exposure.
As far as your question goes however, have you already defined the variable? Additionally, the comma is not how you concatenate variables in Lua. Use a double period, like this:
printer.write("Hello i'm a printer" .. Variable)
Moved to Ask A Pro.
Make sure you post questions in the correct section, so that you can get the most exposure.
As far as your question goes however, have you already defined the variable? Additionally, the comma is not how you concatenate variables in Lua. Use a double period, like this:
printer.write("Hello i'm a printer" .. Variable)
Moved to Ask A Pro.
Make sure you post questions in the correct section, so that you can get the most exposure.
As far as your question goes however, have you already defined the variable? Additionally, the comma is not how you concatenate variables in Lua. Use a double period, like this:
printer.write("Hello i'm a printer" .. Variable)
Ok!
Thx. I don't noticed the Ask A Pro Section because im new …