Difference between revisions of "User:Kebap/Manual:display"
Jump to navigation
Jump to search
(Created page with ";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, l...") |
m |
||
Line 1: | Line 1: | ||
+ | ==display== | ||
;display(content) | ;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. | :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. |
Latest revision as of 19:14, 5 June 2018
display
- 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