I am not aware of doing what you want with the Text to Columns() function, but here is a simple function that will do what you want
Names Default To Here( 1 );
dt = New Table( "Example",
Add Rows( 3 ),
New Column( "string",
Character,
"Nominal",
Set Values( {"1,2,3", "1,2,3,4", "1,,3,4"} ),
Set Display Width( 44 )
)
);
newTexttoColumns = Function({dt,x},{defaultlocal},
start = N Cols( dt );
For( theRow = 1, theRow <= N Rows( dt ), theRow++,
theWord = "";
wordCnt = 1;
For( i = 1, i <= Length( Column( x )[theRow] ), i++,
If( Substr( Column( x )[theRow], i, 1 ) == "," | i == Length( Column( x )[theRow] ),
If(i == Length( Column( x )[theRow]),theWord = theWord || Substr( Column( x )[theRow], i, 1 ));
If( N Col( dt ) < start + wordCnt,
dt << New Column( "", character )
);
Column( start + wordCnt )[theRow] = theWord;
wordCnt++;
theWord = "";
,
theWord = theWord || Substr( Column( x )[theRow], i, 1 )
)
);
);
0;
);
return = newTexttoColumns(dt,"string");
Jim