JSL Cookbook

It’s been a while – so, since it’s Friday, here is a collection of Friday’s Functions … some of my favourite user-defined functions.

The JMP website has introduced a similar theme, JSL Cookbook, so probably I will change the tag associated with these posts to be JSL Cookbook instead of Friday’s Functions.

Abbreviated File Path

Converts a full path into an abbreviated form for display purposes.  The abbreviated form looks like this: “. . . / Demo / Scripts”.

Column Exists

Before referring to a column its helpful to know that it exists.  This function takes two arguments: a reference to the data table and the string literal name of the column.

Copy Table Variables

Sometimes its useful to preserve table variables when creating a new table.  The function takes arguments that reference the source and destination data tables.

JMP Version Number

Sometimes code needs to be tweaked based on the version of JMP.  This function returns the JMP version as a number e.g. 13.2.

Get File Directory

Given a path to a file this function returns a path to the directory that contains the file.

Namespace Contains Variable

Once you start using namespaces its hard to know how you lived without them.  This utility allows me to check whether a namespace contains a specific variable.

Day Of Week As String

So you’ve got one of these weird numbers that is a datetime.  But what day of the week does it represent?

Long Date String

Creates a formatted date string e.g. Monday, 20 April 2018.  The argument monthFormat should be “long month” or “short month”.

Month Of Year As String

Another datetime utility.  The purpose of a function should be obvious from its name; hopefully that is true in this case.

Window Exists

Sometimes a user can upset your plans by closing a window that you are relying on to be open.  This function can help:

List Contains Item

Sometimes you think there should be an easier way of doing things …

One thought on “JSL Cookbook”

Leave a Reply

Your email address will not be published. Required fields are marked *