Ask Reuben – October 1, 2025

Clipboard Control-C vs Right-Click Copy

Why when I do a Copy and Paste using Control-C Copy is the output different from a right-click Copy?

This was an interesting question because when I researched it, I observed that the behaviour had been like this for a long time.

Consider the values in the following table, depending on how the form widget is displayed, the 4gl variable in the Genero application is different than what the user might see on the screen …

Code Snippet4GL Variable ValueWhat user sees
EDIT…, FORMAT=”###,##&.&&”987654.321987,654.32
EDIT…, FORMAT=”$$$,$$&.&&”12.34$12.34
COMBOBOX…, ITEMS=((“Y-Yes”,(“N”-No”)YY-Yes
RADIOGROUP…, ITEMS=((“Y-Yes”,(“N”-No”)Y(*) Yes ( ) No
CHECKBOX…, VALUECHECKED= “Y”, VALUEUNCHECKED=”N”, TEXT=”Selected”Y[X] Selected
IMAGEfa-plus+

… an EDIT might have some numerical and currency formatting, it might be truncated to a small number of digits.  GUI widgets such as COMBOBOX, RADIOGROUP might display a simple 4gl variables in a GUI view that gives more meaning to the simple 4gl variable value.  In the case of an IMAGE, instead of seeing an image filename, you will see that image.

Depending on the method used to perform a a copy and paste operation, the result of the paste might be what you see in the middle column or it mnight be what you see in the right hand column.

For an end-user doing a Copy and Paste do they want or expect to see what is in the middle column, the raw 4gl variable value or do they expect to see what is in the right hand column, the formatted GUI value they see on the screen?

For somone copying and pasting to Excel to do some data analysis, they might prefer to get the raw 4gl variable value.  For someone copying and pasting into an E-mail, they might prefer to get exactly what they can see on the screen.

For an understanding of why you might see the formatted value, remember our User Interface architecture with a front-and (gdc.exe, gbc.js etc) and a runtime system (the fglrun process).  If the Copy operation is local to the front-end, it will have the front-end view of the data.  If the Copy operation is a 4gl operation, it will have the runtime view of the data.

A program that uses ui.Dialog.selectionToString and the cbSet front-call to populate the clipboard will be giving you the runtime view of the data as the ui.Dialog method will be operating on the runtime view of the data.

To see an illustration of the difference, look at a program such as fgl_zoom which uses a technique I outlined here and pay attention to the value in the Price quantity as you use different methods to copy and paste.  Do you see it with a dollar sign or without.