DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

SUD GetArgument Error: Object Required

Solved!
Go to solution

Hello All,

 

This is my first serious attempt at creating an SUD dialog box (modal). I did things according to the manual, but get the following error:

 

---------------------------
Dialog Editor (SUD)
---------------------------
Error in <20121112_M1545_postexfacto_DDMcomp.SUD,Dlg1> (Line: 14,Column: 2):

SUD event context:

  Dialog_EventInitialize(...)

  ...



Objekt erforderlich: 'This.GetArgument()'
---------------------------
OK   
---------------------------

 The underlying code is this:

Sub Dialog_EventInitialize(ByRef This) 'Created Event Handler
	Set parameterList = This.GetArgument()
	Call File1Input.RunInitialize
	Call File2Input.RunInitialize
	Call ResultFileInput.RunInitialize
End Sub

 It is the second line of the Sub that generates the error. I would be very grateful if you could tell me what I am doing wrong.

Leo Zschokke
Test Engineer C-EPS
ThyssenKrupp Presta AG
0 Kudos
Message 1 of 4
(5,939 Views)
Solution
Accepted by topic author ledz

Hi Leo,

 

I assume that you didn't use the object "parameterList" as parameter in the command line which calls the dialog in your script.

 

call SUDDlgShow("DialogName", CurrentScriptPath & "SUDFileName", ObjectName)

Greetings

Walter

 

0 Kudos
Message 2 of 4
(5,937 Views)

I did pass an argument, but it was an array (which did not work). I now created a class with three public properties, each of which should be returned by the dialog box.

Class M1545_TTRcomp_parameters
	Public file1Path, file2Path, resultFile
End Class

 The properties are set by filling three text fields in the dialog, which are read when the OK button is clicked:

Sub OK_EventClick(ByRef This) 'Created Event Handler
	parameterList.file1Path = File1Input.GetSelectedText
	parameterList.file2Path = File2Input.GetSelectedText
	parameterList.resultFile = ResultFileInput.GetSelectedText
	Call Dialog.OK
End Sub

 When I now call the dialog box and display each property, it shows that only the first contains anything:

Dim testObject

Set testObject = New M1545_TTRcomp_parameters

If SUDDlgShow("Dlg1","20121112_M1545_postexfacto_DDMcomp.SUD",testObject) = "IDOk" Then
	Call MsgBoxDisp("Success!")
	call MsgBoxDisp(testObject.file1Path)
	Call MsgBoxDisp(testObject.file2Path)
	Call MsgBoxDisp(testObject.resultFile)
Else
	Call MsgBoxDisp("Failure.")
End If

 So obviously it works to some extent, but I am preventing all input to get through.

Leo Zschokke
Test Engineer C-EPS
ThyssenKrupp Presta AG
0 Kudos
Message 3 of 4
(5,932 Views)

The problem has been solved; I used "GetSelectedText" to retrieve the contents of the text input boxes, instead of "Text". It works now; thank you for your help, Walter!

Leo Zschokke
Test Engineer C-EPS
ThyssenKrupp Presta AG
0 Kudos
Message 4 of 4
(5,927 Views)