LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 1999, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 29 Nov 1999 20:50:41 -0600
Reply-To:     shiling@math.wayne.edu
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Shiling Zhang <shiling@MATH.WAYNE.EDU>
Organization: Wayne State University
Subject:      Re: SAS FRAME "List Box" Question
Comments: To: Robin baker <rdbaker@SYMPATICO.CA>
Content-Type: text/plain; charset=us-ascii

Robin,

If you just want to display a user selected items as a message, then you can read out the selected 'value' or 'text' one by one and concatenate them. If you also need to manipulate these items, you may consider dumpping the selected items into a slist first. A slist is very flexable and is easy to handle. The following example is a list box with items 'a' ---'h'. Hope it gives you some ideas.

*sample codes; length nsel 8 text $8 sel_text $200; init: sel_text =''; datalist=makelist(); return;

listbox1: return;

term: *first get the total number of selected rows; call notify('listbox1', '_GET_NSELECT_',nsel);

*loop over nsel to get strings and put them into a slist; do i = 1 to nsel; call notify('listbox1', '_SELECTED_',i,rowid); call notify('listbox1', '_GET_TEXT_',rowid,text); sel_text =sel_text ||' '|| text; rc=insertc(datalist,text,-1); end;

put sel_text; call putlist(datalist);

rc=sortlist(datalist); call putlist(datalist); return;

*here is the result in message window; NOTE: Compiling LISTBOX.FRAME (SASUSER.APP.LISTBOX.SCL). WARNING: [Line 25] Variable RC is defined but not used

NOTE: Code generated for LISTBOX.FRAME. Code size=891. a h f d ('a' 'h' 'f' 'd' )[1937] ('a' 'd' 'f' 'h' )[1937]

Robin baker wrote:

> I have a requirement to return from a "list box" the order the items > were selected. The user could chose one or more items. I am using > _GET_VALUE_ which is the correct way to start, I think. Now how do I > retrieve the list so I could display it in a message on screen. The > true use is to build a sort string based on the order the user > selected the items. If I could display it I could probably figure the > rest out. > Some general additional information follows. > I am using FRAME, with SCL, SAS 6.12 and I don't have to cross into > any other screens with the information. I am building the code to pass > into SUBMIT CONTINUE, when the user presses a GO button. This builds a > file and brings up FSVIEW or FSEDIT. > It is a simple problem I am sure. Any help would be appreciated.


Back to: Top of message | Previous page | Main SAS-L page