Difference between revisions of "Write"

From ComputerCraft Wiki
Jump to: navigation, search
m (Added to CAT:LuaCoreFunctions.)
(Made it more clear that arg doesn't have to be a string.)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=write
 
|name=write
|args= [[string (type)|string]]
+
|args= Mixed data
 
|api=
 
|api=
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Lets you write the string on the terminal.
+
|desc=Writes characters to the terminal screen.
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Writes something.
+
|desc=Writes Hello World! to the terminal screen.
 
|code=write ("Hello ")
 
|code=write ("Hello ")
 
  write ("World!")
 
  write ("World!")
 
|output=Hello World! (in one line)
 
|output=Hello World! (in one line)
 
}}
 
}}
|notes=*Starts writing where the last write stopped as opposed to [[print|print()]] which always prints in a new line.
+
|notes=*Starts writing where the last write stopped as opposed to [[print]]() which always prints in a new line.
 
*When used at the end of a program, the following prompt will be in the same line.
 
*When used at the end of a program, the following prompt will be in the same line.
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Revision as of 13:38, 15 May 2013


Grid Redstone.png  Function write
Writes characters to the terminal screen.
Syntax write(Mixed data)
Returns nil
Part of ComputerCraft
API none

Examples

Grid paper.png  Example
Writes Hello World! to the terminal screen.
Code
write ("Hello ")
write ("World!")
Output Hello World! (in one line)

Additional Notes

  • Starts writing where the last write stopped as opposed to print() which always prints in a new line.
  • When used at the end of a program, the following prompt will be in the same line.