PrintTable(concommand.GetTable()) issue

Hello.

I’ve found an issue with the following LUA code for some reason(I am not familiar with, as on wiki it state that PrintTable() function takes table as the first argument/parameter, and concommand.GetTable() returns a table) it output this (weird) error:


] lua_openscript_cl testing.lua
Running script testing.lua...
List of concommands (key, value):

[ERROR] lua/includes/util.lua:57: bad argument #2 to 'rep' (number expected, got table)
  1. rep - [C]:-1
   2. PrintTable - lua/includes/util.lua:57
    3. unknown - lua/testing.lua:2


Screenshot of console in-game:

http://i.imgur.com/Dbw9uQW.png

This is the code I have used:
[LUA]print(‘List of concommands (key, value):’)
PrintTable(concommand.GetTable())[/LUA]

Docs I used:

But, also I have found the following GLua code compiles fine:
[LUA]print(‘List of concommands (key, value):’)
for k, v in pairs(concommand.GetTable()) do
print(k, v)
end
[/LUA]

Why does not the first code snippet compile properly? What is going on in the background when the first code snippet is run?

PrintTable can have more then one argument, and concommand.GetTable() returns more then one value.

A simple wiki lookup and you’d have known that.

Yeah, I do already know that. LOL.
So, can you explain me then why does not “PrintTable(hook.GetTable())” throw this error too?
EDIT: And also if you didn’t noticed another two arguments/parameters for PrintTable function are optional. So, why does “PrintTable(concommand.GetTable())” throw that weird error?

because you’re supplying invalid values for the optionals. do PrintTable{concommand.GetTable()}