打印出所有元表内容。

我有一个表格:

[кнк] = (table)
[20-6-2014] = (table)
  [16] = Steve,Maria
[16-6-2014] = (table)
  [17] = Elice, Hans
  [18] = Steve, Maria, Hans

我有一段代码:

function af.info(farm_name,date,time,name_string)
    r=os.date("*t")
    today = date..'-'..r.month..'-'..r.year
    real_date = today
    if farm == nil then
        send_msg(name_string,"错误。 没有数据库。")
    else
      if af.contains(farm,farm_name) then
  print(“第一阶段 - 搜寻农场”)
    if af.contains(farm [farm_name],real_date) then
      if af.contains(farm [farm_name] [real_date],时间)then
        print(name_string,“您要了解关于农场”.. farm_name ..“的数据\n” ..“当前记录日期为”..日期..“,时间为”..时间 ..“点,包括: \ n”.. table.concat(farm [farm_name] [真实日期] [时间],“,”,1,#farm [farm_name] [real_date] [时间])))
    send_msg(name_string,“您要了解有关农场”.. farm_name ..“的数据\n” ..“当前记录日期为”..日期 ..“,时间为”..时间..“点,包括:\n“..table.concat(farm[farm_name][real_date][time],”,“,1,#farm[farm_name][real_date][time]))
    else
      print(name_string,“您要了解关于农场”.. farm_name ..“的数据\n” ..“当前记录日期为”..日期 ..“,包括:\n”..table.concat(farm[farm_name][real_date],“,”,1,#farm[farm_name][real_date])))
      send_msg(name_string,“您要了解有关农场”.. farm_name ..“的数据\n” ..“当前记录日期为”..日期 ..“,包括:\n”..table.concat(farm[farm_name][real_date],“,”,1,#farm[farm_name][real_date])))
        end
    end
end

end
返回错误信息,农场信息
end

这是一个Telegram机器人。 当它被按名称,日期和时间要求有关农场的信息时,它可以正常运行。

我的问题是在else语句附近。 我想向机器人询问农场和日期。 它应该返回类似“在2014年6月16日,农场“knk”将有2个农场。 在17日 - 2名代理商。 在18日 - 3名代理商“的列表。

简单的table.concat对我无效。

点赞