Page 1 of 1

@uiradio bug: Cancel button returns 1 not -1

Posted: Tue Jan 09, 2018 3:33 am
by jibe
Hello,

The Command Reference on @uiradio reads
"The dialog shows an OK and Cancel button, and will return an integer representing the button clicked: Cancel (-1), OK (0)."

However, the Cancel button returns 1 not -1

scalar selection = 0
@uiradio(selection, "Please select an item:", "Item1 Item2 Item3")
@uiprompt(@str(selection))

Re: @uiradio bug: Cancel button returns 1 not -1

Posted: Tue Jan 09, 2018 9:12 am
by EViews Gareth
I just checked it, and it does return -1.

Code: Select all

scalar selection=1
scalar retval = @uiradio(selection, "Please select an item:", "Item1 Item2 Item3")
show retval

Re: @uiradio bug: Cancel button returns 1 not -1

Posted: Wed Jan 24, 2018 1:02 am
by jibe
Thanks. I had not understood that there are two scalars involved, one to store the selection and the other to store the return value.
It would be helpful if both scalars could appear in the example in the help.