14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 15 Creating and Sharing Applications 521<br />

Application Builder<br />

2. Enter the script and click OK.<br />

The text of the anonymous script appears in the object’s properties (rather than the name of a named<br />

script).<br />

Tip: Avoid copying and pasting anonymous functions to simplify code maintenance; use a named script<br />

instead if the script is needed in more than one place.<br />

Show Specific Scripts<br />

There are several ways to view a script for a specific object:<br />

• Double-click the object on the Module tab.<br />

• When an object has multiple scripts, right-click the object, select Scripts, and then select the script<br />

name. You can also select the Scripts tab, select the module name from the Namespace list and then<br />

select the script name from the Method list. Likewise, to see the application scripts, select Application<br />

from the Namespace list.<br />

In each case, the Scripts tab appears with the cursor in the first line of the object’s script.<br />

Tip: To make a poorly formatted script easier to read, right-click and select Reformat Script.<br />

Copy and Paste Objects with Scripts<br />

When you copy and paste an object that has a script, the second instance of the object and script are<br />

renamed.<br />

Edit or Run an Application<br />

To open an application for editing, select File > Open, select the .jmpappsource file, and then select Open.<br />

To run an open application, select Run Application from the Application Builder red triangle menu.<br />

To run a closed application, select File > Open, select the .jmpapp file, and then select Open.<br />

On Windows, you can also open or run an application by doing one of the following:<br />

• Drag the file from Windows Explorer onto the JMP Home Window or onto a blank application<br />

window.<br />

• Double-click the file in the JMP Home Window Recent Files list.<br />

Options for Saving Applications<br />

JMP provides several options for saving application files. When you select File > Save As (or File > Export<br />

on Macintosh), you can choose to save as an application source file (.jmpappsource), an application<br />

(.jmpapp), or a script (.jsl).<br />

The Script red triangle menu provides additional options for saving scripts. When an encrypted script is<br />

saved, JMP encloses the script in the JSL Encrypted() function to preserve white space and comments.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!