- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Bug when runing add in at JMP home page directly
Hi JMP community:
I save 2 scripts into add-ins, and bug will happen in certain situation, the scripts work as following:
- The first add-in will create a new table and create several new columns, let's call this new table as "calculate table"
- Next I will run the second add-in in "calculate table", it will require to open another existing file (let's call it "raw data table"), then get data from "raw data table" and input something into the "calculate table"
//This is the first script
Names Default To Here( 1 );
New Table( "Calculate table");
dt = current data table();
newcolumn = {"X", "Y"};
for each({colval},newcolumn,
dt << new column(colval);
);
//This is the starting lines of 2nd script
Names Default To Here( 1 );
dt = current data table();
file = Pick file( "Select raw data table" );
if(is empty(file),
show("No file selected");
stop();
);
Try(
dt2 = open(file);
,
show("No file selected");
stop();
); // The following code are not shown here
Situation without bug:
- If I open any data table, run the 1st add-in, then run 2nd add-in in the new table, it works
Situation with bug:
- If I run the 1st add-in directly in JMP home page, then run 2nd add-in, the 2nd add-in will have bug
Basically what the 2nd add-in does is to get data and column formula from "raw data table", and input into "calculate table", then create a new window with slider box. The slider box won't work when bug happen, but get data and formula still works
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Bug when runing add in at JMP home page directly
I did as you said, print dt & dt2, and they are correct.
Then I realized when I call columns in slider box, I did not specify which data table, so I put dt: before the column
I also add one more current data table(dt) again in the middle of code after I close dt2
Now it works well.
lubPP = Lineup box(NCol(1),
PPtb = Text Box( "PP: " || Char( PPmin ) ),
PPsb = Slider Box(
PPmin, PPmax, PPValue,
PPb << Set Text( "PP: " || Char( PPValue ) );
:PP << set each value(PPValue); // I should use dt:PP here
new = dt:NewPP << get values;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Bug when runing add in at JMP home page directly
Making a guess: the current data table isn't what you expect. Maybe print it to the log to verify. I think the current data table is in a context that often belongs to a window and the home window is adding another context. By running the addin from the table, you probably (1) make sure that table is current by touching it and (2) get the context which has that table as the current one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Bug when runing add in at JMP home page directly
I did as you said, print dt & dt2, and they are correct.
Then I realized when I call columns in slider box, I did not specify which data table, so I put dt: before the column
I also add one more current data table(dt) again in the middle of code after I close dt2
Now it works well.
lubPP = Lineup box(NCol(1),
PPtb = Text Box( "PP: " || Char( PPmin ) ),
PPsb = Slider Box(
PPmin, PPmax, PPValue,
PPb << Set Text( "PP: " || Char( PPValue ) );
:PP << set each value(PPValue); // I should use dt:PP here
new = dt:NewPP << get values;