1
votes

I am trying to access the element of a table which is inside a table.

MainTable={Table1={},Table2={},Table3={}}

Table1.is="Bool"
Table1.Name="Bit1".

similar parameters for Table2 and Table3

If I access either Maintable.Table1[is] or Maintable[Table1[is]], it is returning null.

How do I get the value of is or Name?

How I can use pairs in this regard?

2

2 Answers

3
votes
MainTable.Table1.is="Bool"
MainTable.Table1.Name="Bit1".

In this case

print(MainTable.Table1.is) // Bool
3
votes

You can use either of these methods:

MainTable.Table1.is
MainTable.Table1["is"]
MainTable["Table1"]["is"]

to get the same result.

Here is a working example: http://eval.in/16665