In a script, you can add code folding markers that show the beginning and the end of the code block, enabling you to collapse and expand code inside stand-alone functions.
To turn on this feature, select 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.
Tip: To fold or expand all code in the entire script, press Shift+Ctrl and then click a code marker.
After you select this preference, Function and Expr expressions are foldable. See Add More Folding Keywords for more information about adding folding markers to other expressions.
Figure 4.7 Code Folding Markers Shown in a Script
By default, code does not remain collapsed after you save the script and restart JMP. To save the state of the folded code, select Save and restore document state information in the Script Editor preferences.
Custom code folding, as shown in the following example, is supported for other stand-alone functions:
{"If", "For", "For Each Row", "While", "Try", "New Window", "V List Box", "H List Box"}
JMP supports multiple keyword lists. A system administrator can define a set of keywords in jmpKeywords.jsl and save the script in C:\ProgramData\JMP\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.
On Windows, the following directories are examined in the order listed:
• C:\ProgramData\JMP\JMP\18\
• C:\ProgramData\JMP\JMP\
• C:\Users\<user>\AppData\Roaming\JMP\JMP\18\
• C:\Users\<user>\AppData\Roaming\JMP\JMP\
• C:\Users\<user>\Documents\
On macOS, the following directories are examined in the order listed:
• /Library/Application Support/JMP/18/
• /Library/Application Support/JMP/
• ~/Library/Application Support/JMP/18/
• ~/Library/Application Support/JMP/
• ~/Documents/
Note that jmpKeywords.jsl is stored in the designated JMP directory, even if you are using JMP Pro.
Notes:
• The list in jmpKeywords.jsl is case insensitive.
• Code folding is not supported for messages, platforms, user-defined functions, and comments.
• 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.