@jthi wrote:
Usually you can build them in other ways (expressions) than using just strings (and I would say if you can, you should).
One approach is to use a placeholder ( _cols_ ) - and then replace (substitute) it with your pre-configured expression - like here:
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
cols = Expr(Columns(:height, :weight));
mycommand = Expr(current data table () << Stack (_cols_, Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Move Columns( To First ),
Output Table ( "Test Output Table" )));
Eval (Substitute ( Name Expr(mycommand),Expr(_cols_), Name Expr (cols) ))
Some Expr() and Name Expr() "magic" is necessary to prevent JMP from executing expressions at the wrong time [Expr()] - and to get access to the expression (Name Expr()) which is stored inside a variable (name) instead of the name itself.
At first sight, a user will decide that it's better to live without this overhead - or to use Eval(Parse(String)) as a fallback solution. But it's a good idea to invest some time here, e.g. with the help of this great lecture:
Using JSL to Develop Efficient, Robust Applications (EU 2018 415)