Difference between revisions of "Tostring"

From ComputerCraft Wiki
Jump to: navigation, search
(os.toString)
 
Line 1: Line 1:
The ToString function is very common function through out programming languages. The use of this function is just to
+
The tostring function receives an argument of any type and converts it to a string.
take an integer and turn it into a string. The opposite of this function is ToInteger.'
+
 
+
Example Use: A Lua Clock
+
 
+
time = os.getTime()
+
TimeString = os.toString(time)
+
 
+
print(time)
+
 
+
Corrections and critism accepted!!
+

Revision as of 10:32, 25 July 2012

The tostring function receives an argument of any type and converts it to a string.