Choose Language Hide Translation Bar
Highlighted

Re: clone a column

Let's work it out in the order in which the expression will be evaluated.

 

dt3:Make << Get script

The message will result in JMP returning the JSL code that would create the same column.

 

Eval(dt3:Make << Get script)

The JSL code is evaluated resulting in a new data column that is a copy of the original :Make column. The Eval() function will also return a reference to that new column.

 

Eval(dt3:Make << Get script) << set name("Clone");

Finally, send the new column the message to change the name of the new column using the object reference.

Learn it once, use it forever!
Highlighted
owg
owg
Level II

Re: clone a column

Thanks for the explanation and the quick reply. I guess that Get is the name of the script that is 'built-in' to jmp and is run. Otherwise how would it know to clone the column as opposed to performing some other operation. I've learned a lot from your reply.

Re: clone a column

No, that interpretation is completely wrong.

 

Scripting JMP usually involves using built-in JMP objects like data tables, data columns, or analysis platforms. You use these objects by sending a message to the object that indicates the desired action. The general form is shown here in both versions: using the actual JMP function and using the equivalent operator.

 

Send( object, message );
object << message;

The object is represented by a reference value. The message is represented by name. This example is interpreted in the following way:

 

dt3:Make << Get Script

 

Send the message Get Script to the object referred to as dt3:Make. This reference is uses the form table:column. A reference to a data table was previously stored in the variable dt3. The reference to the column is by name.

 

The message Get Script may be sent to any JMP object. The 'getter' method behind this message is over-ridden by each object to return the script that will re-produce the original object. That is, it returns the code that will clone the object. So you can always use the same message to get the unique code for any object.

Learn it once, use it forever!
Article Labels

    There are no labels assigned to this post.