For the latest version of JMP Help, visit JMP.com/help.


Publication date: 04/21/2023

Local Namespaces

Putting variables in the global namespace can cause conflicts. When two JSL scripts have variables with the same names, the value of the variable in the last script that you run last overwrites the variable’s value in the first script.

To prevent this problem, we recommend that you begin each script with the following line:

Names Default To Here( 1 );

The Names Default To Here( 1 ); function makes all unscoped variables in the script local to that script and does not affect the global variable namespace. See Advanced Scoping and Namespaces.

Notes:

The Names Default to Here setting is true by default for custom menus and toolbar buttons. A script that runs when you select a custom menu item or click a custom toolbar button does not affect global variables.

The Names Default to Here setting is false by default for table scripts. If a table script specifies Names Default to Here(1), this setting lasts only as long as the table script runs. After the script finishes running, the setting is reset to whatever it was before the script ran.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).