cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
euge
Level III

A JSL scripting question: JMP alert Please select the rows to be deleted

Has anyone seen this pop up box come up while trying to delete rows?  I pasted the code that I'm using below.

On several of my scripts, I've seen this pop up box show up - there's no option except "Ok", and once you click it, the script continues as normal.  It's part of an iterative loop, and strangely it doesn't happen on every iteration.

At first I thought it happened because the row selection in the code was null, but when I replaced the "checkweek<<delete rows" line with

if (nrows(checkweek<<get selected rows)>0, checkweek<<delete rows(),wait(0));

I started getting errors from JMP saying it couldn't resolve the next line.

FBListWeek=:Cause<<get values;

I've even added a checkweek<<data table window to try and make sure JMP knows this is the table I want to work with.  The odd thing is, when I click on checkweek to make it active, and then copy just the single line of code (FBListweek=:Cause<<get values;) into a separate script window, it has no problems (not to mention the fact that when I didn't have the if statement, it worked fine minus having to click ok).

I'm running JMP 9 on a windows 7 Enterprise machine that has 32GB of RAM, and there's nothing remarkable with the table except for the fact that it's very large (over 1 million rows).

Thanks in advance,

Eugene.

Code:

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

current data table(week);

paretoweek = Pareto Plot( Cause( :FB ), Per Unit Rates( 1 ), Where( :PKG == eval(pkgnames) & :Sort_Config == eval(sortconfignames) ) );

rparetoweek=paretoweek<<report;

rparetoweek[tablebox(1)]<<make data table("checkweek");

checkweek=data table("checkweek");

checkweek<<Select where(rate<0.001);

checkweek<<delete rows;

checkweek<<select where(cause=="Pooled Total");

checkweek<<delete rows;

FBListWeek=:Cause<<get values;

1 ACCEPTED SOLUTION

Accepted Solutions
euge
Level III

Re: A JSL scripting question: JMP alert Please select the rows to be deleted

I sent an email to the help desk, and it turns out that this is the solution:

It sounds like the popup message may be generated because there are no rows selected.  If you were running the script from a JSL file, the message would be sent to the log and the script would continue.  However if the script was being called from a button, then JMP is no longer in batch mode and will issue messages interactively.  This can be handled either of the following two ways:

a.  Add the Batch Interactive function to the button script to set the runtime environment to batch at the beginning of the button

          script and turns it off at the end of the button script:

             Batch Interactive( 1 );  //Batch mode

               <JSL commands>

             Batch Interactive( 0 );  //Reverts to previous mode

b (it turns out this option didn't work for me, which is to put the conditional null row selection check).

View solution in original post

2 REPLIES 2
wiebepo
Level III

Re: A JSL scripting question: JMP alert Please select the rows to be deleted

Euge,

I have found that in JMP 9 and greater, a more robust way to delete rows is to use the 'delete rows' with an embedded 'get rows where'.

This avoids trying to pass a reference to a table with a change in the selected row state into a susequent command, which may or may not be the root of the issue.

For example:

dt=currentdatatable();

dt<<delete rows(dt<<getrowswhere(:my_column=="Some Value"));

I am no sure if it is the issue in your example, but consider trying.

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

current data table(week);

paretoweek = Pareto Plot( Cause( :FB ), Per Unit Rates( 1 ), Where( :PKG == eval(pkgnames) & :Sort_Config == eval(sortconfignames) ) );

rparetoweek=paretoweek<<report;

rparetoweek[tablebox(1)]<<make data table("checkweek");

//consider here also adding a wait(0), so the table is created before there is an attempt to delete rows from it

wait(0);

checkweek=data table("checkweek");

checkweek<<deleterows(checkweek<<get rows where(:rate<0.001));

checkweek<<detelerows(checkweek<<get rows where(:cause=="Pooled Total");

FBListWeek=:Cause<<get values;

-Peter

euge
Level III

Re: A JSL scripting question: JMP alert Please select the rows to be deleted

I sent an email to the help desk, and it turns out that this is the solution:

It sounds like the popup message may be generated because there are no rows selected.  If you were running the script from a JSL file, the message would be sent to the log and the script would continue.  However if the script was being called from a button, then JMP is no longer in batch mode and will issue messages interactively.  This can be handled either of the following two ways:

a.  Add the Batch Interactive function to the button script to set the runtime environment to batch at the beginning of the button

          script and turns it off at the end of the button script:

             Batch Interactive( 1 );  //Batch mode

               <JSL commands>

             Batch Interactive( 0 );  //Reverts to previous mode

b (it turns out this option didn't work for me, which is to put the conditional null row selection check).