[small]
//I'm going to cut out what you don't need to use it as a when function.
function v_fel //Name of function - can be in any module
//(prg file) of your application
xc:=col()-len(mfelony) //memvar xc holds the column number of
//the first column in the get because the
//col() function returns the current
//screen column, which is the cursor
//position after the get is printed.
xr:=row() //memvar xr holds the current screen row.
declare wch[4] //memvar wch is an array with 4 rows
wch[1]:='F - Felony' //row one of wch, stores a text string.
wch[2]:='? - Unknown' //row two of wch, stores a text string.
wch[3]:='N - None' //row three of wch, stores a text string.
wch[4]:='B - Both' //row four of wch, stores a text string.
save screen to vfel_scr //Saves the contents of the screen where
//the popup will display to memvar vfel_scr
scroll(12,30,17,50,0) //sets a scrolling area where popup
//will display
@ 12,30 to 17,50 double //draws douple line box on area where popup
//will display.
vfel:=achoice(13,31,16,49,wch) //achoice lets you pass top,left,bottom,right
//screen coordinates notice coordinates are
//inside of the screen save and the box
//the 5th parameter is a memvar (vfel) that
//will hold the pick list row the user
//selected, or zero if they hit escape.
if vfel==0 //if they hit escape
restore screen from vfel_scr //restore screen to previous state
return .f. //abandon function and sent .f. to the get
//handler; this should make the previous get
//active. Test it and see... if not it will
//simply re-launch this function. Let me know
//if the behavoir at this point works for you.
endif
mfelony:=left(wch[vfel],1) //set value of the get variable to the first
//character of the row selected
restore screen from vfel_scr //restore screen to previous state
@ xr,xc say mfelony //at the screen positions of the get print
//the first character of the row selected
return .t. //return .t. to the get stack. this will make
//the mfelony get in focus with the
//pre-validation satisfied.
[/small]