I have a script written to get user input on a start/stop date and time for production data. In the window, there are two buttons, an OK and Cancel. Everything associated with the output after entering the data and clicking OK is okay. The problems are with the Cancel button. For one, I was reading that Throw() will exit out of the script. If you run the example below, clicking cancel will output the "PressedCancel" date to the log, but it will also output the "ContinueDateTime" and correct "ButtonPressed" data, which should be ignored due to the throw.
Another "problem" is the ability to change the spelling of the word cancel (i.e. cancelll) and the button no longer works. If you click it, nothing happens. Not that this is a big deal, just strange and something I can't explain.
Anyway, below is a sampling of my code; any and all assistance is greatly appreciated.
New Window( "Report Dates and Times", <<Modal,
V List Box(
V List Box(
Text Box (" Select Beginning and Ending Dates and Times "),
Text Box (""),
Text Box (" Date Format YYYY-MM-DD "),
Text Box (" Time Format HH-MI-SS-ss ") ),
H List Box(
V List Box(
Text Box (""),
Text Box ("Beginning Date "),
date1 = Text Edit Box ( "2013-04-01" ) ),
V List Box(
Text Box (""),
Text Box ("Ending Date"),
date2 = Text Edit Box( "2013-04-05" ) ) ),
H List Box(
V List Box(
Text Box (""),
Text Box ("Beginning Time "),
time1 = Radio Box( {" 5:00 AM ", " 5:00 PM ",
" First Item ", " Manual "} ),
time1m = Text Edit Box ( "05-00-00-00" ),
Text Box ("") ),
V List Box(
Text Box (""),
Text Box ("Ending Time "),
time2 = Radio Box( {" 5:00 AM ", " 5:00 PM ",
" Last Item ", " Manual "} ),
time2m = Text Edit Box ( "17-00-00-00" ),
Text Box ("") ) ), ),
H List Box( Text Box ( " " ),
Button Box( "OK",
PressedOkay = MDYHMS( Today() );
show ( PressedOkay);
ButtonPressed = "Pressed the OK Button"; ),
Button Box( "Cancel",
PressedCancel = MDYHMS( Today() );
show ( PressedCancel);
ButtonPressed = "Pressed the Cancel Button";,
Throw( ); ) ) );
ContinueDateTime = MDYHMS( Today() );
show( ContinueDateTime );
show( ButtonPressed );