@uiradio bug: Cancel button returns 1 not -1

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

jibe
Posts: 5
Joined: Thu Jul 23, 2015 7:52 am

@uiradio bug: Cancel button returns 1 not -1

Postby jibe » Tue Jan 09, 2018 3:33 am

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))

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11730
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Tue Jan 09, 2018 9:12 am

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
Follow us on Twitter @IHSEViews

jibe
Posts: 5
Joined: Thu Jul 23, 2015 7:52 am

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

Postby jibe » Wed Jan 24, 2018 1:02 am

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.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 5 guests