From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

SUD ComboBox with list of options from variable

Hi, I have been searching this forum for any thread regarding my question but maybe it is too simple to be asked?

 

I have a VBS-script in DIAdem2021 performing some calculations. I have another VBS-file with all the variables used in my VBS-script (in old DIAdem, this was a VAS-file).

I have a SUD-file with a ComboBox where I would like to get a list of selectable options that will be returned to the VBS-script after selection and 'OK' click.

In the old VAS-file setup my variable looked like: 

vehicle_ : A ('Volvo','SAAB','Audi')<'Audi'>

What variable type shall I use now, how shall it be defined and how would the SUD-file be arranged to get this ComboBox working?

 

Thanks in advance!

/Mikael 

0 Kudos
Message 1 of 2
(555 Views)

If you want the dialog to access your own script variables, it is best to use an object that contains all the settings. In the best case, you already have a suitable class object in your script that you pass when calling the dialog:

call SudDlgShow("DlgMain", CurrentScriptPath & "Vehicles2021.sud", VehicleObj)


In the attached files I have implemented a small VBS class that takes the choosed value of the car brand, the name of the car brand and a comment. When the dialog is closed with OK, the calling script displays the entered values.

0 Kudos
Message 2 of 2
(417 Views)