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


Just as you send data table messages to a data table reference, you can send column messages to a reference to a data column object. The Column function returns a data column reference. Its argument is either a name in quotation marks, something that evaluates to a name in quotation marks, or a number.
注意:You can also use the syntax :Name( "Profits ($M)" ) to evaluate to a name that contains special characters.
This book uses col to represent data column references. To see the messages that you can send to data column objects, refer to the Scripting Index (Help > Objects > Data Tables > Column Scripting). Alternatively, you can use the Show Properties() command, as follows:
Sending messages to columns is comparable to sending messages to data tables. Either state the object, a double-angle operator <<, and then the message with its arguments in parentheses, or use the Send() function with the object and then the message. In some cases the messages themselves need no arguments, so the trailing parentheses are optional.
提示:To delete a column, you must send the message to a data table reference, because objects cannot delete themselves, only their containers can delete them.
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
dt << Run Script( "Set Age Value Labels" );
x = Column( dt, "age", formatted )[1];
Show( x );
y = Column( dt, "age" )[1];
Show( y );
The log shows the formatted value for x, which is Twelve, and the actual data value for y, which is 12.