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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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