10-18-2013 02:59 PM
The problem I have is I open the dialog box and push my button to call another script to run. But if there is an error the error is hid behind the dialog box. I would like to Call the dialog box, push button and then close my dialog box before the script runs. Can that be done.
So far I have tried this and can get it to do what I want.
SubButton4_EventClick(ByRef This) 'Created Event Handler
CallUIAutoRefreshSet(0)
Call dialog.cancel
Callscriptinclude ("D:\_Calterm_Configuration_Files\Technical_Information\DIAdem_Scripts\Insite_DataLog_FileLoader.VBS")
CallUIAutoRefreshSet(1)
End Sub
Solved! Go to Solution.
10-19-2013 09:57 AM
Hi J,
If you're willing to have the SUDialog close to unubstruct the view of a potential error dialog, then why not conditionally call the next script right after the SudDlgShow() command in the script that calls the SUDialog? If the user closes the dialog with the Cancel action, you don't run the script, but if they close with the Ok action, you do-- like this:
Response = SudDlgShow("MyDialog", CurrentScriptPath & "MyDialogFile.SUD") IF Response = "IDOk" THEN Call ScriptStart("MyScriptPath")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-19-2013 05:33 PM
10-19-2013 08:29 PM
Hi J,
Which command are you using to launch your SUDialog?
SudDlgShow()
SudDlgCreate()
The code you posted was for the Dialog.Cancel callback-- do you NOT want to close the SUDialog after all?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-21-2013 06:11 AM
Brad,
I am using "Call SuddlgShow() once that dialog box opens, the user picks a button and that buttonstarts a script to load a set of data. and the way it runs now the dialog box does not close until after the script runs successfully. I want to change that so once the button is choosen the dialog box closes and then runs the choosen script. Sorry for the confusion hope that makes more sense.
10-21-2013 09:46 AM
Hi J,
In that case I revert back to my original suggestion. If you want the script to be run after the dialog closes, why not run the script with ScriptStart or ScriptInclude in the next line of code after SudDlgShow()?
Brad Turpin
DIAdem Product Support Engineer
National Instruments