Hello everyone,
I was hoping someone could help me with this script. I would like the start date and the report name to update based upon what radio button is selected:
//rev 3-9-23
names default to here(1);
dtspec="J:\Public\Ti Process Control\Dashboard Files\JMP data for CC's\Limits\Master limits table rev 10-10-22.jmp";
//Get user name
dll = Load DLL( "mpr.dll" );
dll << DeclareFunction(
"WNetGetUserA",
Convention( STDCALL ),
Alias ( "GetUserName" ),
Arg( UInt8, "format", input ),
Arg( AnsiString, "username", output ),
Arg( UInt64, "length", update ),
Returns( UInt32 )
);
username = " ";
unlen = length(username);
result = dll << GetUserName(0, username, unlen);
rbstate="wkly";
/* Create a modal user dialog */
nw1=New Window( "Select Date Range for out of spec",<<Modal,
/* Arrange display boxes in two columns */
hlistbox(
panelbox("data length",
Lineup Box( N Col( 2 ),
rb = Radio Box( {"wkly", "mntly", "qtrly", "Custom"},rbstate=rb<<Get Selected;);
)),
panelbox("set up",
Lineup Box( N Col( 2 ), Spacing( 10 ),
/* Prompt for a report title */
Text Box( "Report Title:" ),
if(rbstate=="wkly",
teb = Text Edit Box( "WKLY Report "||char(Abbrev Date(today())) );,
weeksback=1;
rbstate=="mntly",
teb = Text Edit Box( "MNTLY Report "||char(Abbrev Date(today())) );,
weeksback=4;
rbstate=="qtrly",
teb = Text Edit Box( "QTRTLY Report "||char(Abbrev Date(today())) );,
weeksback=13;
rbstate=="Custom",
teb = Text Edit Box( "Cust. Report "||char(Abbrev Date(today())) );,
weeksback=26;
),
/* Prompt for start and end dates */
Text Box( "Start Date:" ),
Text Box( "End Date:" ),
/* Number Edit Box with a calendar pop-up */
nebs = Number Edit Box(
Today() - In Weeks( weeksback ),
12,
<<Set Format( Format( "m/d/y", 12 ) )
),
/* Number Edit Box with a calendar pop-up */
nebe = Number Edit Box(
(Today()-86400),
23,
<<Set Format( Format( "m/d/y", 12 ) )
),
cb=Check Box( "Make Project?" ),cb << Set( 1, 1 );,
/* OK button captures the values */
))
,
vlist box(
panelbox("spec table",
text = Text Edit Box( dtspec ),text << Set Wrap( 150 ),text << Get Wrap;
)
,
Button Box( "OK",
rtitle = teb << Get Text;
sdate = nebs << Get;
edate = nebe << Get;
cbstate=cb<<get;
fileloc=text<<Get Text();
)
)
)
);
If( nw1["button"] == -1,
Throw( "Cancelled!" );
);
I was thinking I need to use append somehow but not quite sure how to get there.
Any help is greatly appreciated.
Thanks !
Steve