The script editor provides a friendly environment for writing and reading JSL scripts. The Script Editor shows basic features such as syntax coloring, inline commenting, and automatic formatting. Other common programming options are described later in this section.
The Script Editor
Type //! on the first line.
Include Run JSL(1) in the Open() statement:
To stop the script, press ESC on Windows (or COMMAND-PERIOD on Macintosh). You can also select Edit > Stop Script. On Macintosh, Edit > Stop Script is available only when the script is running.
Suppose that you want to clear your JSL variables, but do not remember the command. You can type clear and then press CTRL-SPACE, to see a list of possible clear commands. Select the command that you want to insert.
Autocomplete Example
Tooltip for a JSL Function
To turn off function tooltips, deselect Preferences > Script Editor > Show Operator Tips.
Example of Splitting a Window Horizontally
The script editor helps you match fences (or parentheses, square brackets, and curly braces) in the following ways:
Each Step in Matching Fences
Select a rectangular portion beginning with Y. When you paste, you get the following code:
Basic regular expressions such as ^ and $ (which match the start of line and end of line) and \n (which matches a carriage return) are also supported.
See the Using JMP book for details about the Search options.
To turn on this feature, select JSL code folding in the Script Editor preferences. Then you can expand and collapse blocks of code by right-clicking on a script and selecting Advanced > Expand All or Collapse All.
After you select this preference, Function and Expr expressions are foldable. See Add More Folding Keywords for details about adding folding markers to other expressions.
Code Folding Markers Shown in a Script
JMP supports multiple keyword lists. A system administrator can define a set of keywords in jmpKeywords.jsl and save the script in C:\ProgramData\SAS\JMP\ or designated directory listed below. You save your version of jmpKeywords.jsl in your C:\Users\<user>\Documents\ folder. JMP merges all keyword lists from the designated directories.
Note that jmpKeywords.jsl is stored in the designated JMP directory, even if you are using JMP Pro.
The list in jmpKeywords.jsl is case insensitive.
After you edit and save the list in jmpKeywords.jsl, turn the Allow additional code folding keywords preference off and then back on for the changes to take effect. Messages in the log indicate that the keywords were loaded.
Select File > Preferences.
Select the Fonts group.
Click Mono to set the font for the script editor.
Changing the Font Properties for Script Windows
Select File > Preferences > Script Editor to further customize the editor.
Select this option to use code folding markers in the script editor, which mark the opening and closing of Function() and Expr() expressions. You can expand and collapse these marked blocks of code. This option is off by default.
Select Allow additional code folding keywords to enable using additional keywords for folding markers in the script editor. See Add More Folding Keywords for details.