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

[Calculator]Error: string expected, got table

Started by vali11, 27 March 2013 - 04:04 AM
vali11 #1
Posted 27 March 2013 - 05:04 AM
I coded a little calculator…well i tried it. The Problem is at the function TaschenrechnerZahlen.
I want that the numbers , which were typed, added to a table, which is used to print and calculate with. But i get the Error:"String expected, got table". Hope you can help me :)/>

http://pastebin.com/H3jDvUtK
theoriginalbit #2
Posted 27 March 2013 - 05:09 AM
that is because a table is something that cannot be printed. try using table.concat instead.


write( table.concat( tableName, ' ' ) )
where the ' ' is the separator between each element in the table.
vali11 #3
Posted 27 March 2013 - 05:17 AM
Thanks. Its fixed