Skip to main content

task.ValueType set from dialog

In some functions of IDEA some tasks are set with TRUE of FALSE and one (task.ValueType is set as  POSITIVE_VALUES or NEGATIVE_VALUES). I would like to set this in the script based on the input of the user. I got a button with both variants from which the user needs to select one. But i can't get it working. What sort of code do i need to use?

Brian Element Mon, 08/20/2018 - 07:30

Hi Robert,

I used the Radio Buttons to do this, here is what my dialog looks like:

I then get the information and place it in a globla variable, in this scenario Postive will return 0 and Negative will return 1.  Depending on the task you might need an if statement to change the values into what the IDEA task is expecting.

Here is the code and I have attached the full code with the dialog:


vDim iValueType As Integer

Sub Main
	Call menu()
End Sub

Function menu()
	Dim dlg As NewDialog
	Dim button As Integer
	button = Dialog(dlg)
	iValueType = dlg.OptionButtonGroup1
	MsgBox iValueType
End Function

Brian Element Tue, 08/21/2018 - 12:01

In reply to by Robert van den…

Actually if you look at the history you will probably see these two lines:

POSITIVE_VALUES = 0

NEGATIVE_VALUES = 1

So it is expecting a number but the history uses a constant instead, so you can use the contant so long as you have made sure to define it or use a number, in my example I used the number because I was lazy and didn't want to write any additional code :-)

Brian