cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Names

Started ‎11-08-2022 by
Modified ‎11-08-2022 by
View Fullscreen Exit Fullscreen

Names are important in JMP, and especially in scripting. In fact, everything in JMP has a name! This includes objects, menu commands, functions, and messages to objects. And the variables in your scripts also have names. Names have to follow certain rules or syntax. A name has to start with either an alphabetic character--A through Z, lowercase or uppercase--or an underscore. So, names can't begin with a numeral or any other character. Then, names can continue with more alphabetic characters, numeric digits, whitespace characters, or some special characters. Whitespace characters are spaces, tabs , or newlines. The special characters that are allowed are the pound sign, the period, the apostrophe, the percent sign, the underscore, and the backslash. Finally, names can also include Unicode characters for some mathematical symbols, such as Greek letters. So, that's the required syntax of names--it's simple, but it's also exact. But the style is not as strict. Let's look at a few examples to illustrate how you can work within these syntax rules to style your names. Fit Line is a name that follows all of the syntax rules. But you could style it in several other ways: FitLine, with each word capitalized but no space between the words. Or fitline, with no capital letters or spaces, or fit line, where the words are separated but not capitalized. These are all equivalent names in JMP, because while whitespace is allowed in names, JMP ignores that space when it evaluates the name. And, JMP ignores letter case. So you can style your names in any way that works for you, whether that makes the names easier to read, or makes a distinction between built-in names and user-defined names. Of course, we do recommend that you be consistent in your style throughout your scripts. Another thing about names is that JMP needs to be able to recognize every name and associate the name with the correct object. This process of name resolution is called scoping. And the rules of scoping determine how a name is resolved the first time it's encountered. There are two types of names that have special prefix characters, known as scoping operators. A single-colon prefix tells JMP that a name is referring to a data table column. A double colon prefix tells JMP that the name is referring to something called a global variable, and for the moment, just think of that as a variable defined by the user.