该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


To add rows, send an Add Rows message and specify how many rows. You can also specify after which row to insert the new rows. The arguments can either be numbers or expressions that evaluate to numbers.
A variation of Add Rows lets you specify an argument yielding a list of assignments. Assignments can be separated with commas or semicolons.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Add Rows(
{:name = "Peter", :age = 14, :sex = "M", :height = 61, :weight = 124}
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Add Rows(
{:name = "Peter"; :age = 14; :sex = "M"; :height = 61; :weight = 124}
dt = New Table( "Cities" );
dt << New Column( "xx", Numeric );
dt << New Column( "cc", Character, width( 12 ) );
dt << Add Rows( {xx = 12, cc = "Chicago"} ); // single list
dt << Add Rows( {xx = 13, cc = "New York"}, {xx = 14, cc = "Newark"} );
dt << Add Rows(
{{xx = 15, cc = "San Francisco"}, {xx = Sqrt( 256 ), cc = "Oakland"}}
); // list of lists
a = {xx = 20, cc = "Miami"};
dt << Add Rows( a ); // evaluate as single list
b={{xx = 17, cc = "San Antonio"},{xx = 18, cc = "Houston"}, {xx = 19, cc = "Dallas"}};
dt << Add Rows( b ); // evaluate as list of lists