User:Kebap/Manual:display
Jump to navigation
Jump to search
- display(content)
- This is much like echo, in that is will show text at your screen, not send anything to anywhere. However, it also works with other objects than just text, like a number, table or function. This function is useful to easily take a look at the values of a lua table, for example. If a value is a string, it'll be in quotes, and if it's a number, it won't be quoted.
Note: Do not use this to display information to end-users. It may be hard to read. It is mainly useful for developing/debugging.
myTable = {} -- create an empty lua table
myTable.foo = "Hello there" -- add a text
myTable.bar = 23 -- add a number
myTable.ubar = function () echo("OK") end -- add more stuff
display( myTable ) -- take a look inside the table