The code is complaining that the value of Range isn't a character string. So to correct that, the below code forces both the value of range, and the column name returned to be character strings, by using the char() function to insure that they are character strings.
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt << New Table Variable( "Range", 2 );
New Window( "Select Column",
lb = Col List Box(
Data Table( dt << get name ),
all,
min col( 1 ),
max col( 1 ),
dt << New Table Variable( "Selected Column", (lb << get selected )[1])
),
Button Box( "Moving Average",
Eval(
Substitute(
Expr(
dt << New Column( "Movin Average", Numeric, Formula( __formula__ ) )
),
Expr( __formula__ ), Parse( char(dt << get table variable( "Range" )) || " + :" || char((lb << get selected)[1]) )
)
)
)
);
Jim