![]() | DIAdem 2017 Help |
![]() | DIAdem 2018 Help |
![]() | DIAdem 2019 Help |
![]() | DIAdem 2020 Help |
![]() | DIAdem 2020 SP1 Help |
Use the GetArgument method to transfer a parameter to a user dialog box that you call in a script. The transfer parameter must be a VBS variable that you declare with Dim in the script. Use the SetArgument method to return the transfer parameter from the user dialog box to the calling script.
Complete the following steps to call a user dialog box with the oArray transfer parameter and to modify the parameter in the dialog box.
Select DIAdem SCRIPT.
Select Edit»Create Dialog Box.
Select View»Script View.
Click ... in the EventInitialize field on the Events tab.
Enter or copy the following text into the script editor:
Sub Dialog_EventInitialize(ByRef This) Dim oDlgParams, i oDlgParams = This.GetArgument() For i = lBound(oDlgParams) to uBound(oDlgParams) ' Fill listbox with text Call ListBox1.Items.Add(oDlgParams(i),i) Next End Sub
![]() | Note Add the above text to the lines generated automatically by the script editor. |
Select View»Script View to return to the dialog box.
Click the Listbox control on the Controls bar. The selection list displays the contents of the transfer parameter.
Drag open the control in the dialog box.
Click the Button control on the Controls bar.
Drag open the control in the dialog box.
Click the column to the right of the Text field in the Properties tab and enter and back. Button1 must be selected.
Click ... in the EventClick field on the Events tab. When you click the button, the contents of the transfer parameter changes.
Enter or copy the following text into the script editor:
Sub Button1_EventClick(ByRef This) Redim oDlgParams(2) ' redefine parameters oDlgParams(0) = "... and" oDlgParams(1) = "back" Dialog.SetArgument(oDlgParams) Dialog.Ok End Sub
![]() | Note Add the above text to the lines generated automatically by the script editor. |
Select File»Save As and save the file as Test.sud.
Close the dialog editor and switch to DIAdem SCRIPT.
Select File»New»VBS Script to create a new script.
Enter or copy the following text into the script editor:
Dim oArray Redim oArray (3) ' set transfer parameters oArray(0) = "Transport" oArray(1) = "Parameter to" oArray(2) = "SUD Dialog" Call SudDlgShow("Dlg1","Test",oArray) ' Dialog box call with parameter Dim i,sgT : sgT = "" For i = lBound(oArray) To UBound(oArray) ' combine parameter into Text sgT = sgT & oArray(i) & vbCrLf Next Call MsgBoxDisp(sgT)
Select Script»Run VBS Script to start the script.
The contents of the transfer parameters appear in the selection field.
Click the and back button to close the dialog box.
Confirm the message that displays the modified contents of the transfer parameter.
Analyzing and Displaying Channels Section by Section | Checking Dialog Box Entries | Dynamic User Dialog Box | Translating User Dialog Boxes | User Dialog Box for Entering Text and Numbers | User Dialog Box for Sequence Control | User Dialog Box in DIAdem VIEW | User Dialog Box in VIEW for the Calculation of the FFT and Harmonic Frequencies | User Dialog Box with Changing Background Color | User Dialog Box with Curve Preview | User Dialog Box with Extended Table | User Dialog Box with Internet Explorer | User Dialog Box with Scalable Table | User Dialog Box with Selection Lists | User Dialog Box with Selection Lists | User Dialog Box with Subdialog Boxes | User Dialog Box with Tables | User Dialog Box with Tree | Wizard for Tolerance Evaluation
Helpful
Not Helpful