I'm trying to make a table that I can look at on the screen and I want the border to be one color while the actual data I want to be a different color. This is from the help on colournote.
I modified my script to 'colorize' the table. Which is produces a string like the one above to match my table. The problem is that colournote(line) will not work even though I've made sure that line is composed of 3 args all sets of 3 are separated by commas for everything I'm wanting to send to colournote. Am I doing something wrong? Or is there an easier way to get this accomplished?
ColourNote ("red", "blue", "Hello there ",
"white", "green", "everyone")
I modified my script to 'colorize' the table. Which is produces a string like the one above to match my table. The problem is that colournote(line) will not work even though I've made sure that line is composed of 3 args all sets of 3 are separated by commas for everything I'm wanting to send to colournote. Am I doing something wrong? Or is there an easier way to get this accomplished?
function init_table(name, output, wild)
local r, c
filled = {}
for r = 1, 4 do
filled[r] = {}
for c = 1, 15 do
filled[r][c] = " "
end --for
end --for
colournote("red", "", "Table ready to be filled.")
end --init_table
function colorize(array)
array = "\"" .. table.concat(array, "\", \"") .. "\""
return array --the 3 agr for colournote in quotes
end --colorize
function print_table(name, output, wild)
local i, r, c, space, tmp1, tmp2, tmp3, tmp4, line
rows = utils.split ("A,B,C,D", ",")
cols = utils.split ("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15", ",")
space = "\n"
for i = 1, 63 do
space = space .. "-"
end --for
space = space .. "\n"
tmp1 = { "green", "", space } --border between rows
tmp2 = { "green", "", "|" } --border between columns
line = colorize(tmp1)
for r = 1, 4 do
tmp3 = { "white", "", rows[r] }
line = line .. ", " .. colorize(tmp2) .. ", " .. colorize(tmp3) .. ", " .. colorize(tmp2)
for c = 1, 15 do
tmp4 = { "white", "", filled[r][c] }
line = line .. ", " .. colorize(tmp4) .. ", " .. colorize(tmp2)
end -- for
line = line .. ", " .. colorize(tmp1)
end --for
colournote(line)
end --print_table