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

Using the Log

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

So we've been making use of the log to look at the results of all of the lines of code that we've run. But we can also control what shows up in the log. So let me clear that and clear the Script Editor window. So one thing I could do, if I am working with global variables, which, of course, I have been, is I can type show globals open close parentheses. I don't have to have an argument, although I can specify individual globals that I want to see. But I'm just going to run and look for all of them. And I'll go ahead and make my log a little taller, so you can see that, and in fact, even see the piece of code that I ran, the function show globals. And then it shows all the ones I defined, as well as some that were part of that initial setup script. So I didn't necessarily create the dt variable and the tb variable. Those were part of initial setup, but the other ones that I've created are there. And it also gives me a list of how many global variables I currently have. Again, these will persist until I close JMP or unless I specifically use a function to delete them. So now, instead of show globals, I just want to use the show function. So I'll get rid of the word globals. And I want to show the variables a and b. So a, b as the arguments to show. And I'll run that. And the show function returns the variable names as well as the values that have been assigned to them. There's another function called print. So I'm going to replace show with print. And I'll run that. Print simply displays the values of the variables. Both of these, show and print, display on separate lines. And then we have the write function. So I'll replace print with w-r-i-t-e and run that. And the write function returns the values of its arguments, but it's on the same line. It doesn't put any spacing in. So we actually would want to add arguments to the write function. So I'm going to start with a character string. And the character string will say, Here the value of a is-- and I'll put a space and close my double quotation, type of comma. And I'll put a space around the arguments here as well, just to make that a little easier to read. Then I put a space after the comma that came after the a. And I open my double quotes again. This will start with a space. And the value of b is space close double quotes, add a comma, add a space just to make it a little easier to read. And when I run this line, the write function has returned this all in one line of the log and without the delimiters. So it just is a message in the log that you might supply for the user of your script. So that was just a brief tour through some of the basic elements of the scripting language.