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.

232 Programming Methods Chapter 8<br />

Functions that Communicate with Users<br />

StatusMsg<br />

Mail<br />

The Spoken option causes captions to be read aloud by the operating system’s speech system (if available).<br />

Spoken takes a Boolean argument, and the current setting (on or off) remains in effect until switched by<br />

another Caption statement that includes a Spoken setting.<br />

You can include pauses in the playback by including the named argument Delayed and a time in seconds.<br />

Such a setting causes that caption and all subsequent caption windows to be delayed by that number of<br />

seconds, until a different Delayed setting is issued in a Caption statement. Use Delayed(0) to stop<br />

delaying altogether.<br />

This script turns speaking on and leaves it on until the last caption.<br />

caption({10,30},"A tour of the JMP Analyses", spoken(1), Delayed(5));<br />

caption("Open a data Table");<br />

bigClass=open("$SAMPLE_DATA/Big Class.JMP");<br />

caption("A JMP Data Table consists of rows and columns of data");<br />

caption("The rows are numbered and the columns are named");<br />

caption({250,50},"The data itself is in the grid on the right");<br />

caption({5,30},spoken(0),"A panel along the left side shows columns and other<br />

attributes");<br />

Each new Caption hides the previous one. In other words, there is only one caption window available at a<br />

time. To close a caption without displaying a new one, use the named argument Remove.<br />

caption(remove);<br />

This command sends a message to the status bar.<br />

StatusMsg("string")<br />

(Windows only) Mail sends an e-mail message to alert a user about a condition in JMP. For example, a<br />

process control manager might include a test alert script in a control chart to trigger an e-mail warning to<br />

her pager:<br />

mail("JaneDoe@company.com", "out of control", "Process 12A out of control at<br />

"||Format(today(), "d/m/y h:m:s"));<br />

Mail can also send an attachment with the e-mail. An optional fourth argument specifies the attachment.<br />

The attachment is transferred in binary format after its existence on the disk is verified. For example, to<br />

attach the Big Class.jmp data table, submit<br />

mail("JohnDoe@company.com", "Interesting Data Set", "Have a look at this class<br />

data.", "C:\myJMPData\Big Class.jmp");

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

Saved successfully!

Ooh no, something went wrong!