Here is one way to handle this
Names Default To Here( 1 );
dt = New Table( "Example dt",
Add Rows( 10 ),
Set Header Height( 46 ),
New Column( "Age",
Character,
"Nominal",
Set Selected,
Set Values(
{"2-day old", "43-day old", "3-day old",
"3-month old", "4-month old", "5-day old",
"32-day old", "13-year old", "10-year old",
"10-month old"}
)
)
);
dt << New Column( "AgeYears" );
dt << New Column( "AgeMonths" );
dt << New Column( "AgeDays" );
For( i = 1, i <= N Rows( dt ), i++,
Match( Word( 2, :Age[i], "- " ),
"day",
:AgeDays[i] =
Num( Word( 1, :age[i], "- " ) ),
"month",
:AgeMonths[i] =
Num( Word( 1, :age[i], "- " ) ),
"year",
:AgeYears[i] =
Num( Word( 1, :age[i], "- " ) )
)
);
Above was corrected as noted.
Jim