A complete example, appreciating how hard it is to get started in a new language. (The help->scripting index and the online help are complementary resources. I mostly use the help->scripting index, for reminding me how it works. The online help might be better for starting out.) I put a little more here than just needed. I've forgotten SAS rules for case of names...
Names Default To Here( 1 );
// what does that mean? JSL has several namespaces; the 'here' namespace is for this
// editor window and means 'press' is really 'here:press' but 'dtFrustration:press' belongs to
// the table's namespace (of column names.) You could also just use different names,
// like 'iPress' for the loop control variable. JMP's variable names are almost never
// case sensitive, the weird exception being column names, which are only sensitive
// if both 'Age' and 'age' are columns...Don't do that!
// an easy way to get this table script is to make a new table with the
// JMP GUI, then use the top-left red triangle to 'Copy Table Script (No Data)'.
// By convention, JSL uses 'dt' in the variable name that holds a handle to a table.
dtFrustration = New Table( "frustration",
New Column( "temp" ), // continuous numeric by default
New Column( "press" ),
New Column( "time" )
);
// because the table might be linked to other reports, there
// is a lot of hidden messaging when the table changes. A lot.
// The messaging can be shut off and later enabled for a nice speedup.
// (to see it take longer, rerun just the loop below.)
// dtFrustration << BeginDataUpdate; // pair with EndDataUpdate, below
For( temp = 1, temp <= 10, temp++,
For( press = 5, press <= 20, press += 5,
For( time = 1, time <= 1000, time += 20,
dtFrustration << addrows( 1 );
dtFrustration:time = time;
dtFrustration:temp = temp;
dtFrustration:press = press;
)
)
);
// dtFrustration << EndDataUpdate;
Craige