11-12-2012 06:35 AM - edited 11-12-2012 06:37 AM
Hello,
I woud like to execute my main script.vbs
And in the same time keep a dialog box open with one button changing a global variable.
how can i do that?
Best regards,
fmanuel
11-12-2012 07:51 AM
Hi fmanuel
Is your global variable declared in the main script??. If it so, you should create a SUD which calls the main script in the Initialize Event, and modify the global variable using the events for the button control. Once you have the SUD you should call it using the Call SUDDlgShow function.
Cheers
11-12-2012 08:43 AM
How should i call the main script?
11-13-2012 02:52 AM
Hi frmanuel,
remember to call a not modal dialog so that the Mainb script can run further while keeping the SUD Dialog opened.
http://zone.ni.com/reference/en-XX/help/370859J-01/comoff/suddlgcreate/
Best regard
Andre
11-13-2012 07:00 AM - edited 11-13-2012 07:01 AM
Thanks for help, i did it this way:
If NothingisSudNonModalDlgLst("Dlg2") Then
Set profile_search_dialog_box = SUDDlgCreate("Dlg2",MyFolders(1)&"profile_search_dialog_box.SUD",NULL)
Else
Set profile_search_dialog_box = SudNonModalDlgLst("Dlg2")
End If
Call profile_search_dialog_box.Show
But now I can not act anymore on my buttons.
I did use:
Call InteractionOn
Then my Dialogbox became active and my script stop working
How can I have both: Script.vbs runníng and in the same time buttons working?
Best regards,
fmanuel
11-13-2012 07:16 AM
Unfortunately not.
VBScript doesn't seem to embrace a straight forward notion of multithreading, so there will be no way to execute these tasks (main script and dialog) in parallel.
Andrea