Garry's Mod Wiki

Garry's Mod Wiki

  PrintTable( table tableToPrint, number indent = 0, table done = {} )

Description

Recursively prints the contents of a table to the console.

The table keys will be sorted alphabetically or numerically when printed to the console.

Arguments

1 table tableToPrint
The table to be printed
2 number indent = 0
Number of tabs to start indenting at. Increases by 2 when entering another table.
3 table done = {}
Internal argument, you shouldn't normally change this. Used to check if a nested table has already been printed so it doesn't get caught in a loop.

Example

Prints the table we created.

local tbl = { "test", 3829.4, {"foo", "baah", 20/5}, true } PrintTable(tbl)
Output:
1 = test 2 = 3829.4 3: 1 = foo 2 = baah 3 = 4 4 = true

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...