Hi, I'm new to JMP scripting and recently we are going to migrate from JMP12 to JMP15.
I'm having problems with some of the scripts that used to work in JMP12, but don't work now in JMP15.
I understand from some of the posts here that it could be because the data is cleared when the modal window is closed and the information is gone.
However I'm not sure how to edit the script such that it can work in JMP15.
Any help is appreciated.
The script is as below:
Clear globals();
Clear log();
//constants
secondsInDay = 24*60*60;
secondsInWeek = secondsInDay*7;
linecount = 8;
Linename = {"1D2-CTA1","1D2-CTB1","1D2-CTA2","1D2-CTB2","1D2-CTA3","1D2-CTB3","1D2-CTA4","1D2-CTB4"};
db = New Window ("HJT Testers Data",
<< Modal,
Line up Box(
NCol(2),
Text Box("Start Date MM/DD/YYYY"),
sd = Text Edit Box (mdyhms(Today()-1*24*60*60)),
Text Box("End Date MM/DD/YYYY"),
ed = Text Edit Box (mdyhms(Today()))
),
Line up Box(
NCol(2),
Text Box ("Line"),
lineAll = Checkbox("+/- all", 0 , if(LineAll<<get(1),For(i = 1, i <= lineCount,i++,line<<set(i,1));,For(i = 1, i <= lineCount, i++ , line<<set(i,0));)),
line = Checkbox(Linename, <<Set(6, 1));
),
Line up Box (
NCol(3),
Button Box("Last 2 Hours",sd<<Set Text(Format(Date Increment(Today(),"Hour",-2,"Actual"),"m/d/y h:m:s"));ed<<Set Text(Format(Today(),"m/d/y h:m:s"));),
Button Box("Last 4 Hours",sd<<Set Text(Format(Date Increment(Today(),"Hour",-4,"Actual"),"m/d/y h:m:s"));ed<<Set Text(Format(Today(),"m/d/y h:m:s"));),
Button Box("Last 24 Hours Day Report",sd<<Set Text(Format(Date Increment(Date Increment(Today(),"Day",-1),"Hour",8),"m/d/y h:m:s"));ed<<Set Text(Format(Date Increment(Date Increment(Today(),"Day",0),"Hour",8),"m/d/y h:m:s"));),
Button Box("Today",sd<<Set Text(Format(Date Increment(Today(),"Day",0),"m/d/y h:m:s"));ed<<Set Text(Format(Date Increment(Today(), "Day", 1),"m/d/y h:m:s"));),
Button Box("Yesterday",sd<<Set Text(Format(Date Increment(Today(), "Day", -1),"m/d/y h:m:s"));ed<<Set Text(Format(Date Increment(Today(),"Day",0),"m/d/y h:m:s"));),
Button Box("Past 7 Days Report",sd<<Set Text(Format(Date Increment(Date Increment(Today(),"Day",-7),"Hour",8),"m/d/y h:m:s"));ed<<Set Text(Format(Date Increment(Date Increment(Today(),"Day",0),"Hour",8),"m/d/y h:m:s"));),
),
Button Box( "OK",
startdate = sd << gettext;
enddate = ed << gettext;
),
bbC = Button Box( "Cancel"
);
);
If(db == {Button(-1)}, Throw("User cancelled script."));
lineString = "";
//define the line
For(i = 1, i <= lineCount, i++, If(line << get(i), if(lineString == "",lineString = lineString||" and ([EquipmentID] = '"||linename[i]||"' ", lineString = lineString||" or [EquipmentID] = '"||linename[i]||"' ")));
if (lineString == "", lineString = "", lineString = lineString ||")");
//An SQL query string that is always selected.
standardDataString = "select *";
//filter for time range
timeFilterTableName = "[ms_creationdate]";
timeRangeString =timeFilterTableName||" > '"||startdate||"' and "||timeFilterTableName||" < '"||enddate||"'";After this, the script will then perform a SQL query to get information using the aforementioned standardDataString, timeRangeString, and lineString.
Thanks in advance!