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
csoon1
Level III

Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

I am processing hundreds of thousands of rows and I wanted something "visual" to tell the user that the script is doing something. I appreciate any hints or tricks to achieve this.

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

I use the caption function to let the user know what's going on.  You have to use it in conjunction with the wait() function to force JMP to catch up.  Here's a simple example:

caption("Processing data.  Please be patient.");

wait(0);

d = 0;

for (i = 1, i <= 10000000, i++,

      d = d + i;

      if (mod(i, 10000) == 0,

            caption("Processed " || char(i) || " values");

            wait(0);

      )

);

caption(remove);

wait(0);

View solution in original post

14 REPLIES 14
txnelson
Super User

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

JMP supplies a spinning wheel, etc. when it is processing a JSL script.

Jim
pmroz
Super User

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

I use the caption function to let the user know what's going on.  You have to use it in conjunction with the wait() function to force JMP to catch up.  Here's a simple example:

caption("Processing data.  Please be patient.");

wait(0);

d = 0;

for (i = 1, i <= 10000000, i++,

      d = d + i;

      if (mod(i, 10000) == 0,

            caption("Processed " || char(i) || " values");

            wait(0);

      )

);

caption(remove);

wait(0);

csoon1
Level III

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

@PMRoz thank you very much! I find this as the most intuitive way of showing the status of what I am doing. Just a follow-up question though... would you happen to know how to position the caption at the center of the screen? I know it's a different topic so I'll just lookup if there is a way to get the display resolution from jmp... and work from there.

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

Starting with JMP 11, there is a JSL function to create a spinning wheel:

New Window( "Example", Busy Light( <<automatic ) );

Messages for the busylightbox it creates are Advance, Disable, automatic, size, and RPM.

Automatic turns it on so that it spins by itself. Automatic(0) stops the spin.

If you don't turn it on, you can use advance, perhaps in a while loop.

Disable hides the busylightbox. You can't get it back. Might be useful just to hide once your operation is finished, if it's in a window you continue to use.

Size only works as an argument to the Busy Light function. Size takes 2 comma-separated arguments - x and y in pixels. I don't recommend going very large, as it's just a little picture and gets very bitmapped at larger sizes.

RPM controls how fast the wheel spins when on automatic.

You can't change the colors - it's just a little picture.

Example:

New Window( "Example",

  blb = Busy Light( <<automatic, size(30, 30) )

);

11082_pastedImage_6.png

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

I open View:Log to see what is going on behind the scenes.

csoon1
Level III

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

This is useful as well and actually also works as intended. i just find the caption suggestion more applicable to my application. Thanks for this suggestion though as I'm planning to use this on a separate script.

msharp
Super User (Alumni)

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

This is very helpful thankyou!  I discovered this feature several months ago, but the documentation on it is rather bare.  I always felt the default size was too small and glad to see you can increase it (even at risk of pixelation).

If you are looking for a loading bar instead of a busy indicator, you can use my code attached.

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

Busy wheel does not spin when creating lots of formula in datatable. busy wheels failed.

Craige_Hales
Super User

Re: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?

Made a post Progress Bar

Craige