BookmarkSubscribeRSS Feed
EdD
Calcite | Level 5 EdD
Calcite | Level 5
Hi everyone. I am a beginning AF programmer although I do have a few years in base SAS. I am trying to use a LISTBOX to present choices for a user to select one by tabbing, clicking, or scrolling to. Since I am porting this to a mainframe, I must be able to capture the enter key being used to know when a selection is made. I have been playing with the EVENT() capture and can't seem to get that to work right. Does anyone have any suggestions?

Thanks, Ed
7 REPLIES 7
SASKiwi
PROC Star
It would be helpful if you could provide your SCL code so we can see what you are trying to do.
EdD
Calcite | Level 5 EdD
Calcite | Level 5
The SCL code is what I am trying to create. I have a listbox on a frame. I populated the listbox and can see movement when I use the mouse or cursor. I want to execute a specific group of SAS code based on the selection from the listbox. How can I know the user 'selected' one of the entries rather than scrolled down using the cursor control?
ballardw
Super User
I don't have references for AF currently but I would look at the methods associated with listboxes. I vaguely remember being able to do something like:

rc =get_selected(listboxidentifier);

But I think the RC was the list item identfier not the actual value displayed in the box.

It didn't matter if you used a mouse or key strokes to navigate the list.
tbellmer
Fluorite | Level 6
If your listbox is named lstbox then use this code in a labeled section:

lstbox:
value = lstbox.selecteditem ;
put value = ;
return ;
EdD
Calcite | Level 5 EdD
Calcite | Level 5
I have tried both methods and I can get the return code along with the value, however it does not matter if I use the tab or down arrow on the keyboard it appears as if the item was selected when in reality it was just scrolled past. I have tried to capture the enter key being pressed as an EVENT(), but that does not seem to work either.
tbellmer
Fluorite | Level 6
Try http://support.sas.com - then click on submit a problem. The SAS/AF tech support group is exceptionally good.
ballardw
Super User
Again, I haven't worked in a multiple OS environment such as you currently have for a long time, but some of the mainframes differentiate between HIGHLIGHTING, moving through a list with keys, and then SELECTING the highlighted one. I vaguely remember tabing through lists and then using a + key to select in CMS for example. It may be that the selection hasn't happened.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1456 views
  • 0 likes
  • 4 in conversation