Transferring a Parameter to a User Dialog Box

DIAdem 2018 Help


Edition Date: June 2018
Part Number: 370858P-01
View Product Info

DOWNLOAD (Windows Only)


DIAdem 2015 Help
DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help
DIAdem 2020 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.

  1. Select DIAdem SCRIPT.

  1. Select Edit»Create Dialog Box.

  2. Select View»Script View.

  3. Click ... in the EventInitialize field on the Events tab.

  4. 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.
  1. Select View»Script View to return to the dialog box.

  2. Click the Listbox control on the Controls bar. The selection list displays the contents of the transfer parameter.

  3. Drag open the control in the dialog box.

  4. Click the Button control on the Controls bar.

  5. Drag open the control in the dialog box.

  6. Click the column to the right of the Text field in the Properties tab and enter and back. Button1 must be selected.

  7. Click ... in the EventClick field on the Events tab. When you click the button, the contents of the transfer parameter changes.

  8. 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.
  9. Select File»Save As and save the file as Test.sud.

  10. Close the dialog editor and switch to DIAdem SCRIPT.

  11. Select File»New»VBS Script to create a new script.

  12. 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)
  13. Select Script»Run VBS Script to start the script.

    The contents of the transfer parameters appear in the selection field.

  14. Click the and back button to close the dialog box.

    Confirm the message that displays the modified contents of the transfer parameter.

Examples

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

WAS THIS ARTICLE HELPFUL?

Not Helpful