Copy Listbox Column Data to Clipboard

I would be interest to hear any suggested methods (brief description is fine) for copying data from the highlighted record in a browse to the clipboard. Because my user might want data from 1 of 3 different columns, I am wondering how best to present the column choice to the user. Requiring the user to open the form in order to copy is to be avoided.

You can add COLUMN to the LIST to let the user see just a column selected. PROP:Column gives the number.

Even w/o COLUMN you can tell what Cell they clicked as below. Do this in Event:NewSelected:

 IF KeyCode()=MouseRight THEN
    GET(ListQ,CHOICE(?List)) ; IF ERRORCODE() THEN CYCLE.
    ListColNo=?List{PROPList:MouseDownField}    !This is really Column and NOT Q Field
    QFieldNo=?List{PROPLIST:FieldNo,ListColNo}  !Now we have Queue Field to use with WHO()
    QFieldRef &= WHAT(ListQ,QFieldNo)
    IF 1=POPUP('Copy field') THEN 
        SETCLIPBOARD(QFieldRef)
    END
1 Like

Carl, thanks for the prompt reply. Something like this was my first inclination. However, with only 3 out 8 columns available to copy, I’m wondering if my users will get used to the “column selection” concept for MouseDown. One other alternative I was considering was a submenu to a Copy popup that listed the 3 columns by name. While perhaps more clear, it seems a bit clunky to me.

I’ve done that and it makes it easy that the user right-clicks anywhere on the line and gets all his choices:

EXECUTE POPUP('Copy File Name' & |              !#1
              '|Copy Path' & |                  !#2
              '|Copy Path and File Name' & |    !#3
              '')
BEGIN ; END       ! # 1  Copy File Name
BEGIN ; END       ! # 2  Copy Path
BEGIN ; END       ! # 3  Copy Path and File Name
ELSE
    ASSERT(0,'POPUP exceeded')
END !EXECUTE Popup

…And your customer feedback ratings for: :wink: :grinning:
Method One - column click
Method Two - popup menu

You could use Styles to “highlight” multiple columns as they click on them. The process the columns with the styles set to the selected value. JAT

Interesting idea. Combined with Carl’s original suggestion I might be able to get my users to go along. Thanks.

It would help to understand if you would post a screen capture of your Browse / Form and highlight the fields you want to copy.

I don’t expect any problem with the code. It is more a question of what might go over best with users. In the program, there are only a couple of instances where a copy from a list is useful. This is the first time I’ve had to consider a choice from from multiple columns.