02-08-2013 04:36 AM
Hello there,
I have a script which runs on a group in the data portal. To use it the user has to set the line "usingGroup = 1" to be the value they want.
What would be better would be if when the script starts it pops up a dialog box which contains a combox control enumerated with the list of groups in the data portal. The user would just select the one they want and click okay.
I've been looking at the examples but I just don't get how to do this. Does anybody have an example they could point me to plesae?
Thank you,
Martin
02-08-2013 06:44 AM
Hello MartinMcD,
Please try the attached example.
Greetings
Walter
02-08-2013 06:46 AM
Hi MartinMcD
Use this small Script and the attached dialog.
Dim oGroup Call SUDDlgShow("Main","GroupSelect",oGroup) Call MsgBox(oGroup.Name)
The dialog shows a List of all group names and returns the selected group object
Winfried
02-08-2013 07:21 AM
Wonderful, thank you both very much for such speedy help.
Martin
07-24-2013 04:41 AM
Hello,
I too would need to select different groups through some box, I found this thread which exactly deals with my problem. However I'm not used to SUD files at all, and when I try Winfried's solution, I get some error message : Cannot find ".........." file (I checked, the file is there)
Does this have something to do with the fact that I only have DIAdem 2011 ?
Thanks
07-29-2013 07:56 PM
Hi Near,
I just tried this in DIAdem 2011, and you're right that it doesn't work, but not because of DIAdem 2011. The Dialog initialization callback was broken in the dialog-- I removed it, and now everything works. Note that you should always pass the full path to the dialog in the SudDlgShow() command, and the easiest way to do that is with the AutoActPath or CurrentScriptPath variables. But that only works if you save the below script to a *.vbs file in the same folder as the SudDialog.
Dim oGroup Call SudDlgShow("Main", AutoActPath & "GroupSelect",oGroup) Call MsgBox(oGroup.Name)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
07-30-2013 02:01 AM
Thanks Brad, that is much clearer now! (Many answers recently... vacations over? )
Everything works perfectly now.