Professional > Table scripting > Table specification syntax > Understanding axes > Navigating the axis tree
 
Navigating the axis tree
Understanding axes explains the structure of the Axis objects in the dimensions of a table. This topic shows the various techniques that you can use to reference individual Axis objects within a complex table axis structure. In this topic, we shall use the following table axis structure as an example. (This is the top axis in the fifth table discussed in Understanding axes.) This is a deliberately complex example that is being used for illustration purposes. In practice, most axis structures are less complex.
Complex axis: entrance + gender > (interview + (before > biology))
Assuming that the Top Axis object is part of a table, you can obtain a reference to this axis object using the following:
Dim MyTopAxis
Set MyTopAxis = MyTable.Axes.Item["Top"]
After obtaining this reference to the axis, you can obtain a reference to the Male Element object in the Gender axis using the following:
Dim MyElement
Set MyElement = MyTopAxis.SubAxes.Item["gender"].Elements.Item["Male"]
To obtain the element from the Table object using the full (combined) expression, you could use:
Set MyElement = MyTable.Axes.Item["Top"].SubAxes.Item["gender"].Elements.Item["Male"]
This is a long and complex expression to write. However, you can use the fact that the Item property is the default property for both the Axes and Elements collections and shorten the expression to:
Set MyElement = MyTable.Axes["Top"].SubAxes["gender"].Elements["Male"]
Similarly, the Axes property is the default property of the Table object. So you can shorten it even further:
Set MyElement = MyTable["Top"].SubAxes["gender"].Elements["Male"]
Using a feature of mrScriptBasic called “dynamic property expansion”, this can be written even more compactly. See Dynamic property expansion for more information.
See also
Understanding axes