Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.52 KB

printTable.markdown

File metadata and controls

49 lines (34 loc) · 1.52 KB

PLUGIN_NAME.printTable()

 
Type function
Library PLUGIN_NAME.*
Return value None
Keywords json
See also

Overview

This function recursively prints the contents of a table to the console.

Syntax

PLUGIN_NAME.printTable( t )
PLUGIN_NAME.printTable( t, label )
PLUGIN_NAME.printTable( t, label, indentLevel )
t (required)

Table. The Lua table you want to print to console.

label (optional)

String. An optional string to be printed on its own line, before the contents of the table are printed. If nil or none provided, then no line is printed.

indentLevel (optional)

Number. The number of tabs indented before each line. Default is 0.

Examples

local PLUGIN_NAME = require 'plugin.PLUGIN_NAME'

local colors = 
{
	{ name = "red",		value = { 1, 0, 0, 1 }, },
	{ name = "green",	value = { 0, 1, 0, 1 }, },
	{ name = "blue",	value = { 0, 0, 1, 1 }, },
	{ name = "cyan",	value = { 0, 1, 1, 1 }, },
	{ name = "magenta",	value = { 1, 0, 1, 1 }, },
	{ name = "yellow",	value = { 1, 1, 0, 1 }, },
}

PLUGIN_NAME.printTable( colors )