cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Recall Function Library

A set of functions that support the Recall and Reset capabilities in JSL GUI's.  The library is discussed here: Total Recall: A new strategy for recall support in JMP applications.

 

  • 28Mar2023 - updated to v2 thanks to contributions by @hogi 
    • Support for checkboxes
    • Support to set selected entries
    • Uses the same function for default and user settings
  • 29Sep2024 - updated to v3 thanks to contributions by @hogi 
    • Documentation available to all users via Scripting Index
    • Included in Script Editor Auto-complete function.
Comments
gzmorgan0

M,

This is interesting, however,  wouldn't all be lost if a script executed the following command? 

Delete Symbols();

Maybe I missed something. 

 

We decided to use a named namespace associative array to implement recall in our example application created with application builder, and our example JSLC version of Fit Y by X; both done for our book, JSL Companion 2nd ed., chapters 10 and 7, respectively.

 

@gzmorgan0

 

True - Delete Symbols() would trash any implementation of a named namespace - yours and mine included.  IMO, it's a bit sloppy to use Delete Symbols() outside of debugging - it makes the assumption that your variables are the only important ones in memory - but there's not much you could do to stop it... A colleague gave me some thoughts on a strategy to put things outside of memory that I'm working on implementing.  This alternate should be robust to that issue.  

 

That said, the point of the library was (as this blog post indicates: Link to Blog) to make a resource to simplify the workflow of setting up a recall function because it's such a useful and important feature to users.  It was never to make something foolproof.

msharp

 I found my way here from: https://community.jmp.com/t5/JMP-Wish-List/Add-builtin-quot-Recall-quot-message-to-all-Windows-creat...

 

Awesome code.  Really appreciate the work you put in.  Definately looks like valuable piece of script.

 

Just a couple comments.  I feel you over complicated this, which makes it harder for someone else to utilize/make sense of the code.  You don't need a resetRoles, a use could always just close the window and reopen it.  If you want to save them a click, you could create a button to do this for them.  Once that is gone, you could also get rid of genArrays and stick the key logic into storeRoles, since the only time you need to store information is in this function.  This would leave you with two functions, storeRoles() that a user would plug into their OK buttons, and recallRoles.  A user would just need to feed storeRoles the display boxes, what they are, and a namespace to store the values.  The recallRoles would then be even simplier where you would just need to feed it the namespace and it would do the rest.

 

Lastly, verbose should always default to off.

@msharp

 

It's easy to set up verbose to off by just putting a varable at the start of your script: 

verbose = 0;

and then using that in commands.  This is what I do.  You can then turn it on or off at will.  As I said in the blog post, I prefer chatty functions, so I leave verbose on until I'm sure I've got the recall functions working correctly, then I turn it off.  

 

On your other point, I'd submit it's a matter of personal preference.  The workflow that you describe (having to close and reopen an addin) would drive me nuts.  Having a reset button just feels more elegant to me - there's no break the workflow, you just reset the gui (like in Graph Builder).  Setting up a reset function just a matter of copying and pasting.  The UI set up is also work that you're going to have to do anyway so why not just use the reset function to do both?

 

M

Recommended Articles