I am building a library of functions that I would like to distribute as a single JSL file. But some of my functions reference image files. In this blog post I will explain the process I use for serialising the image file so that it can be embedded directly into my JSL script.
All posts by David Burnham
‘For-Each’ Iteration
One of the most important tasks that a computer can do it repetition of tasks. That’s why iteration is such an important element of JSL code. In version 16 of JMP, new syntax was introduced to describe the way we iterate over elements of structures such as lists and matrices.
Curve Fitting
Working with String Variables
In this post I take a look at how JSL can be used to perform string manipulation.
Working with Zip Files
Online Learning Zone
Transparency
Here’s a handy little function to apply a transparency effect to a solid (r,g,b) colour:
1 2 3 4 5 6 7 8 |
TransparentRGB = function({r,g,b,opacity=0.65},{default local}, red = opacity*r + (1-opacity); green = opacity*g + (1-opacity); blue = opacity*b + (1-opacity); return(RGBColor(red,green,blue)); ); |
File Handling
The JMP scripting language has a number of convenient functions for handling files external to JMP. Here’s an example:
1 2 3 4 5 6 7 8 |
// purge the temporary folder files = filesIndirectory(tmpDir); for (i=1,i<=nItems(files),i++, path = convertFilePath(files[i],base(tmpDir)); if (!isDirectory(path), deleteFile(path) ) ); |
Code Folding
Code folding allows you to collapse a block of code – you can use it to focus on high-level structure without getting lost in the detail.
To enable code folding enable to option under the Script Editor section of Preferences, found under the File menu.
I use it with my user-defined functions to give me an overview of contents within an include file. Combined with appropriately placed comments this helps to summarise the contents of a library of functions. Here is an example:
Reverse Process Capability
Process capability is a well-established technique for evaluating the degree to which a process is capable of delivering a product within specification. But what if the specifications are unknown or at best tentative?
The calculations of process capability analysis can be reversed so that for a given set of target capability values the associated specification limits can be generated. The calculation is straight-forward for a normal distribution but needs a bit more thought when it comes to asymmetric distributions.