From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Dialog box

Hi everyone, I would create a dialog box that lists scripts. How can I do that? 
And where do I have to list the scripts? ideas ?

 

0 Kudos
Message 1 of 5
(2,839 Views)

Hi,

Do you want to list scripts in a specific directory? Or opened scripts in DIAdem?

Here's an example that lists all script files in a directory and displays it using a normal MsgBox:

const FolderPath = "C:\Program Files (x86)\National Instruments\DIAdem 2015\Examples\Documents\"
dim i,ScriptPath, OutputTxt
for each ScriptPath in DirListGet(FolderPath, "*.vbs", "filename", "onlyFilenames")
	OutputTxt = OutputTxt & ScriptPath & vbcrlf
next
call MsgBox(OutputTxt)

You can use DirListGet command to receive a list of files with a specific extension in a specific directory.

You can also create a SUD dialog with a list box to show all files that were found.

Christian
CLA, CTA, CLED
0 Kudos
Message 2 of 5
(2,821 Views)
In fact, I normally do three analyzes, and  I have three corresponding 
scripts, the goal for me of the creation of the dialog box which allows in one
click to execute one of the scripts (according to our choice). I created the
dialog box attached. But when I click on the button it does not execute
anything, knowing that I have written the corresponding scripts to each button.
Is that correct? i'm a beginner.
 

 

0 Kudos
Message 3 of 5
(2,805 Views)

Here's an example of a SUDialog that shows all the VBScripts loaded in the SCRIPT panel.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Download All
0 Kudos
Message 4 of 5
(2,801 Views)

Thank you so much!

0 Kudos
Message 5 of 5
(2,770 Views)