Scripting Index improvements

I'd like it if examples in the scripting index could be named.  For instance open() has 5 examples and I always forget which one is the one for excel.  It'd be great if it worked for New Custom Function() << Example as well.  

And if we had a way to have custom classes be shown with their methods broken out.  

 

 

Tracking Number:

Defect ID: S1559583

6 Comments

This is actually already available as the second argument to the Example message. However, it was not documented in time for the release of JMP 15. See example below.

myAdd = New Custom Function( "custom", "Add", Function( {x, y = 1}, x + y - 1 ) );
myAdd << Example( "Add(1, 2)", "Foo" );
myAdd << Example( "Add(1, 500)", "Bar" );
Add Custom Functions( {myAdd} );

2019-10-25_12-04-35.png

Super User

@Justin_Chilton repeatedly you're awesome. 

Super User

@Justin_Chilton , do you know if it's possible to extract the name after the fact? I'm trying to use so we can automatically use examples for hamcrest and was thinking of using this name as the label.  

No, it doesn't look like `Get Examples` includes the names of the examples. Also, the examples for Hamcrest include a re-definition of the global reporter, so I am not sure how useful it will be to run the examples.

Super User

I was more saying for our stuff, we want to take examples of custom functions and make hamcrest examples out of them.  

So if we have some markdown in the example it will create a hamcrest test for it.  

Contributor

Another improvement please :

 

  • Make text easily copied. Currently, if I want to copy the text explaining the function syntax and its explanation, I have to right click--> edit --> select  and then Ctrl+C or right click --> copy text. This way of doing things is quite old, the same the Windows command line! Could we have a one click solution? Like a button or just by making the text selectable directly with a left mouse click.
  • Make text easily pasted! After I copied text from the Scripting index, when I paste it in a text editor like word or Notepad, it contains a bunch of formatting code that looks like html or something. Can we have just plain text ?