The syntax you made up for your example will not work, however, what I have gleaned from it, is that you want to create a new column that contains the maximum value across a list of columns. The code specified in a formula, such as
:a * 2 + :b
must be input as the actual literal string one wants for the formula. JMP will not do any evaluation of the JSL in the formula before it is pass on to the new column being created. Therefore, the formula one wants to use, must be fully realized. And in your code, it needs to be dynamic, which requires the formula statement to be created in JSL and then passed to the formula.
Below is a script that shows one way of doing that
names default to here(1);
dt = Current Data Table();
// The formula that needs to be passed into the new column JSL needs
// to look like
// Max( :NameA, :UniqueX, :Name bb )
// A literal string of ":NameA, :UniqueX, :Name bb" needs to be created
// and then plugged into the JSL and then executed
// ":NameA, :UniqueX, :Name bb" is just an illustration, what the
// make up of the string needs to be derived from the actual column
// names in the data table
FreqList = dt << get column names( string, numeric );
freqString = "";
// build the JSL in the form that is required for the formula
For( i = 1, i <= N Items( FreqList ), i++,
If(
Contains( FreqList[i], "Unique" ) == 1 |
Contains( FreqList[i], "Name" ) == 1,
If( i==1, delim = "", delim = ",");
freqString = freqString || delim || " :" || FreqList[i]
)
);
// Run the command, passing into the formula the command string developed above
Eval( Parse( "dt << New Column (\!"Freq\!", numeric, Formula( Max( " || freqString || " )));" ) );
Jim