showtable
code:Lua
t = textmodule.showtable(tbl, tree)
モジュール
引数
table:_
変数 型 概要
1 tbl table テーブル
2 tree boolean テーブルをツリーで表示するか
返り値
table:_
変数 型 概要
1 t string テーブルの内容
概要
テーブルtblの内容を文字列として返す。
treeをtrueに設定すると、引数のテーブルをツリー状に表示します(入れ子になったテーブルの中身を表示する)。
例
code:Lua
require("textmodule")
tbl1 = {1, 2, 3}
print("tbl1:")
print( textmodule.showtable(tbl1) )
tbl2 = {a="test", b=150, c={1,2,3} }
print("tbl2:")
print( textmodule.showtable(tbl2) )
tbl3 = {a="test", b=150, c={4,5,6} }
print("tbl3:")
print( textmodule.showtable(tbl3, true))
code:Console
tbl1:
tbl2:
tbl3: