Jan,
I joined below a simple code to test your proposal.
I am sure the principle works, but somehow I cannot manage to do it:
dt = CreateTab();
CreateTab = Function( {},
A = New Table( "TestTable",
Add Rows( 4 ),
New Column( "Age",
Numeric,
Continuous,
Format( "Best", 12 ),
Set Values( [3, 5, 2, 8] )
),
New Column( "Height",
Numeric,
Continuous,
Format( "Best", 12 ),
Set Values( [0.6, 1.03, 0.55, 1.3] )
)
);
A;
);
It is like the generated table cannot be passed to dt.