***************** JKEY setting ****************************************
Place these lines in your head program
RESTORE FROM int_d437 ADDITIVE         && Code page (standard,US,and Europe)
SET LIBRARY TO jkey.FLL   ADDITIVE       && FOX/WIN version 2.53
_jdblclick = -1                                            && JKEY variable: see JKEY .doc file
***************************************************************************
You don't need this if your files are already open
SELECT 0
USE customer.DBF
SET INDEX TO cust.CDX
SET ORDER TO TAG company of cust.cdx
SELECT 0
USE offices
SET INDEX TO off.CDX
SET ORDER TO TAG ONO OF off.CDX
SELECT 1
SET RELATION TO ONO INTO OFFICES ADDITIVE
SELECT CUSTOMER

****************************************************************************
There is a more detailed description of each parameter (Array cell) at the end.

DIMENSION heads(30,2)           && holds all possible option names
	&&-------------------- Your DBF for BROWSE  <C>
heads( 1,2) = "CUSTOMER"
	&&-------------------- ALIAS <C>
heads( 2,2) = "customer"
	&&-------------------- CDX file name <C>
heads( 3,2) = "cust"
	&&-------------------- TAG <C>
heads( 4,2) = "company"
	&&-------------------- Buttons, horizontal or vertical  <L>
heads( 5,2) = .T.
	&&-------------------- upper left row of window <N>
heads( 6,2) = 0
	&&-------------------- upper left col of window <N>
heads( 7,2) = 0
	&&-------------------- number of rows for BROWSE <N>
heads( 8,2) =  12
	&&-------------------- Width of BROWSE  <N>
heads( 9,2) = 50
	&&-------------------- BROWSE command <C>
heads(10,2) = "FIELD company:15, contact,city "

The next 5 options intercommunicate.
	&&-------------------- Your edit screen with extension (.spr/.prg
	                       MODAL!)  <C>
heads(11,2) = "edit_rec.SPR"
	&&-------------------- Your delete program with extension (spr/prg) <C>
heads(12,2) = "del_rec.prg"
	&&-------------------- EDIT button .T. ENABLE, .F. DISABLE  <L>
heads(13,2) = .T.
	&&-------------------- NEW button .T. ENABLE, .F. DISABLE  <L>
heads(14,2) = .T.
	&&-------------------- DELETE button  .T. ENABLE, .F. DISABLE  <L>
heads(15,2) = .f.
	&&-------------------- Mouse dblclick speed,temporary, old will be
	                       restored  <N>
heads(16,2) = 0.40
	&&-------------------- EDIT field (MEMO) (omit the '@')  <C>
heads(17,2) = ""           &&1,30 EDIT text SIZE 4,20 COLOR SCHEME 10"
	&&-------------------- CENTER window (.T./.F.), overwrites ROW and COL
	                       <L>
heads(18,2) = .t.
	&&-------------------- RETURN field content, concatenated expression or
	                       UDF()  <C>
heads(19,2) = ""
	&&-------------------- save RECNO() (.T./.F.)  .T. restores old RECNO
	                       <L>
heads(20,2) = .f.
	&&-------------------- additional SAY lines under BROWSE (omit the '@')
	                       <C>
	                       && Ex:  "1,2 SAY 'Name: '+ customer.company"
heads(21,2) = ""
heads(22,2) = ""
heads(23,2) = ""
heads(24,2) = ""
heads(25,2) = ""
heads(26,2) = ""
heads(27,2) = ""
heads(28,2) = ""
heads(29,2) = ""
heads(30,2) = ""

When your parameters are set this is all you have to do
m.variable = wpickpop(@heads)                   && starts program
RELEASE heads

Detailed Description of all available options

DBF   heads(1,2)
If you don't pass a dbf name the program will use one from the current work area if it is not empty. Otherwise you will be notified to pass one.

ALIAS heads(2,2)
The ALIAS is not neccessary, but might be usefull if you work with relations and if you want field contents be RETURNed from other work areas.

CDX heads(3,2)
If there is no CDX file open already, you will be notified to pass one.

TAG heads(4,2)
If you don't fill out this one the first TAG of the available CDX file will be used.

Hints: For the sake of clarity and readabilty it is usefull to pass the above parameters.

Buttons heads(5,2)
Places buttons on the right or under the BROWSE. Placed under the BROWSE you gain more space for BROWSE colums.

ROW of Window  and COL of WINDOW heads(6,2) and heads(7,2)
If the window in not CENTERed it will be placed at specified coordinates. IF CENTER is .T. these values are overruled.

BROWSE rows heads(8,2)
Number of BROWSE rows or vertical length. MINIMUM when buttons are vertical is 12. With buttons horizontal 2

BROWSE width heads(9,2)
IF BROWSE width is 0 the BRWSE window size is derived from the length of the indexed field. Make use of this parameter to ajust the window to the size you need.

BROWSE command  heads(10,2)
CAUTION: Be carefull in using the double ( " ) and single ( ' )quotes. Strings within the expression are limited by SINGLE quotes.
Use the BROWSE command as usual. But you may not use all of the BROWSE paramaters.
I did not test the pick list with all available BROWSE parameters. Although some are pretty neat to apply.
Do not use these BROWSE parameters. They are allready in use or not available in this situation.
FREEZE,NOWAIT,NODELETE,NOAPPEND,NOEDIT,NOMODIFY,NOMENU,WHEN.WINDOW,
LAST,PREFERENCE.....

The next 5 options intercommunicate, that is they depend on each other

edit SCREEN.prg/spr  heads(11,2)
Place the name with extension of your own edit screen here. If the edit button is enabled pressing it will launch your edit screen. When you are done with changing the selected record you will return to the popup. Your edit screen MUST be MODAL!
You can have an edit screen name here with the EDIT button conditionally enabled/disabled.
That is, although you might have passed an edit screen name you cannot launch the edit program because the edit button (heads(13,2) is disabled.
This is also true for the NEW button.

DELETE program heads(12,2)
Pass the name of your delete program (extension!) here. It will be launched when you press the enabled (.T.) delete button.

EDIT,NEW,DELETE buttons heads(13-15,2)
Enables or disables these buttons. But remember, if you enable these buttons without having passed the appropriate program your choice will be neglected.

MOUSE double click speed  heads(16,2)
The value of the double click you pass is temporary. The old value will be restored.

EDIT field (MEMO) heads(17,2)
You can place a MEMO field within the popup window. ROW 1 is the first row under the browse "5,1 EDIT text SIZE 4,20 COLOR SCHEME 10" This MEMO will be placed 5 rows beneath the BROWSE window  starting at COL 1 with 4 lines and 20 cols width. Omit the "@"
If your MEMO edit region does not fit in the popup window you will be notified. Decrease size of MEMO or increase BROWSE width ->heads(9,2)

Center heads(18,2)
Defaults to .T. . Popup will be centered.

RETURN heads(18,2)
This is the important part. Here you specify what you want being returned if the user selected a record, that is he pressed the OK button. With ESC button pressed "" is returned. If empty RECNO() will be returned.

Examples:
RETURN ""       RECNO() will be returned when OK button is pressed. ESC
                returns null string "".
                
RETURN "firstname"   content of field firstname in current dbf will be
                     returned
                     
RETURN "offices.firstname" content of field firstname in OFFICES.DBF will be
                           returned. This might be a RELATED dbf .
                           
RETURN  "RTRIM(firstname)" + ', '+ RTRIM(lastname)"

RETURN  " 'Person searched for is: ' +RTRIM(lastname)"

RETURN "RTRIM(customer.company) +' '+ STR(offices.ytdsales)"   company name 
                             from customer.dbf and content of numeric field 
                             in offices.dbf.

RETURN "RTRIM(company) +' '+ STR(offices.ytdsales,9,2)+
                           ''+IIF(payed,'payed','did not pay')"
                  STRING- NUMERIC- and LOGICAL fields concatenated.

You might also use a UDF() that will return its result: RETURN 
                           "yourfunction()"

FUNCTION yourfunction
RETURN customer.cno +" "+contact

CAUTION: Be carefull in using the double ( " ) and single ( ' )quotes. Strings within the expression are limited by SINGLE quotes.

SAVE RECNO() heads(19,2)
Let us assume you have a CUSTOMER screen mask active. If you popup now the pick list with CUSTOMER and SAVE RECNO() is .T. you will return to the record you started off in the sreen mask.
With SAVE RECNO() .F. and OK is pressed in the pick list your sreen mask will show the selected record.
With related DBF's it works the same way:
Parent DBF is customer, child DBF is offices. You have CUSTOMER sreen active from which the pick list is called with data from OFFICES. If SAVE RECNO() is .T. then the record pointer stays on the selected record of the child dbf when you return to CUSTOMER.

SAY lines beneath BROWSE heads(20-30,2)
Besides the MEMO option you can have additional information on the screen preferably from related
DBF's by using 9 optional DETAIL lines. These are SAY expression you can apply as usual.

****************************************************************************There are many combinations possible. The most common are used in the DEMO.prg.