cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Objects and Messages

Started ‎11-08-2022 by
Modified ‎11-08-2022 by
View Fullscreen Exit Fullscreen

Now let's discuss the concept of objects. Many of the capabilities of JMP are available to your script through built-in objects. Every JMP object knows how to perform certain actions or tasks. And some examples of JMP objects are data tables, data columns, platforms, and even JMP itself. Now in order to use an object in your script, the script first needs to instantiate the object, or create an instance of the object, and then the script can work with the object to accomplish a task. When you instantiate an object, JMP associates a unique reference value with it, and uses that reference to identify the object. And you can store that reference in a variable for later use. There are also several functions that you can use to obtain a reference to an existing object. For example, the Current Data Table function returns a reference to the current data table -- the table closest to the front of your JMP session. The Data Table function takes a data table name as its argument and returns a reference to that data table. In both cases, you can store the returned reference in a variable in order to easily use it again later. So, you communicate with a JMP object by sending a message to it. The message indicates an action that you want the object to perform, and it also supplies any necessary arguments for the task. Each object has its own set of messages, or protocols, that are associated with the tasks that it can perform. You use an object reference to identify which object should receive the message. You use the Send function to send the message. The first argument is the object reference, or a variable storing the object reference, and the second argument is the message. Alternatively, you can use the Send operator, which is two left angle brackets. So, for example, to get the name of the current data table, you use the Current Data Table function to return the object reference, and send Get Name as the message. And again, you can do that either using the Send function or the Send operator. Let's look at an example where you use a message to launch a data filter. You send the Data Filter message to the current data table, and the optional arguments to the message indicate the columns to use for filtering and the modes that will be affected by the filter. In this example, you send the Data Filter message to the Concrete data table, specifying Type as the filter column, and Select as the only mode that will be affected.