- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Continue or abort based on user input.
Below is a small script to check user input (below) which I plan to place in another main script. I want to proceed with the rest of the main script if the user selects OK and abort if the user clicks Cancel in the user input script. How to achieve this?.
mywin1 = new window("YOU HAVE SELECTED:", << modal,
//ID = "part123";
//flavour = "Red";
//TestYear = "2021";
//LimFileName = "EVTeg";
text box("Wafer ID: "||ID||" \!nProduct Type: "||flavour||" \!nTest year: "||TestYear||" \!nLimts File: "||LimFileName||" \!nDo you wish to continue?"),
button box("Yes", which_button = "OK"),
button box("No", which_button = "Cancel"),
);
The commented lines were just to test this piece of code. These would be supplied from the main script above the test user input script.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Continue or abort based on user input.
One option would be to use <<return result with <<modal and then check the value of mywin1["Button"] after modal is closed
Names Default To Here(1);
ID = "part123";
flavour = "Red";
TestYear = "2021";
LimFileName = "EVTeg";
mywin1 = New Window("YOU HAVE SELECTED:",
<<modal,
<<Return Result,
Text Box(
"Wafer ID: " || ID || " \!nProduct Type: " || flavour || " \!nTest year: " || TestYear ||
" \!nLimts File: " || LimFileName || " \!nDo you wish to continue?"
),
Button Box("Yes", which_button = "OK"),
Button Box("No", which_button = "Cancel"),
);
show(mywin1); //debug print
If(mywin1["Button"] != 1,
Show("cancel");
throw("cancel pressed");
//stop();
);
Show("ok");
Show("continue execution");
Also <<On validate(expr) and << On Close(expr) might be helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Continue or abort based on user input.
One option would be to use <<return result with <<modal and then check the value of mywin1["Button"] after modal is closed
Names Default To Here(1);
ID = "part123";
flavour = "Red";
TestYear = "2021";
LimFileName = "EVTeg";
mywin1 = New Window("YOU HAVE SELECTED:",
<<modal,
<<Return Result,
Text Box(
"Wafer ID: " || ID || " \!nProduct Type: " || flavour || " \!nTest year: " || TestYear ||
" \!nLimts File: " || LimFileName || " \!nDo you wish to continue?"
),
Button Box("Yes", which_button = "OK"),
Button Box("No", which_button = "Cancel"),
);
show(mywin1); //debug print
If(mywin1["Button"] != 1,
Show("cancel");
throw("cancel pressed");
//stop();
);
Show("ok");
Show("continue execution");
Also <<On validate(expr) and << On Close(expr) might be helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Continue or abort based on user input.
Thanks. This seems to be working.
While I test the actual code I have one more question (not related to the OP). How do I make the following text bold?
YOU HAVE SELETED:
Wafer ID:
Product Type:
Test year:
Limts File:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Continue or abort based on user input.
Use the Set Font Style message....see below
Names Default To Here(1);
ID = "part123";
flavour = "Red";
TestYear = "2021";
LimFileName = "EVTeg";
mywin1 = New Window("YOU HAVE SELECTED:",
<<modal,
<<Return Result,
tb = Text Box(
"Wafer ID: " || ID || " \!nProduct Type: " || flavour || " \!nTest year: " || TestYear ||
" \!nLimts File: " || LimFileName || " \!nDo you wish to continue?"
),
Button Box("Yes", which_button = "OK"),
Button Box("No", which_button = "Cancel"),
tb << set font style("bold");
);
show(mywin1); //debug print
If(mywin1["Button"] != 1,
Show("cancel");
throw("cancel pressed");
//stop();
);
Show("ok");
Show("continue execution");
All of the messages that can be sent to the various objects are defined in the Scripting Index.