I want to select a column of values from excel, copy to the clipboard, then paste that selection into a get where they are inserted into the get as either space or comma separated values. Where can I intercept what is on the clipboard to edit it to insert what I need into the get?
Robb
Paste into get
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Paste into get
Please try this program

Code: Select all | Expand
#include "fivewin.ch"
function Main()
local aText[ 3 ], aGet[ 3 ]
local oDlg, oFont, oClp
AFill( aText, Space( 40 ) )
SetGetColorFocus()
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 400,230 PIXEL TRUEPIXEL
DEFINE CLIPBOARD oClp OF oDlg FORMAT TEXT
@ 60,20 GET aGet[ 1 ] VAR aText[ 1 ] SIZE 360,26 PIXEL OF oDlg
@ 95,20 GET aGet[ 2 ] VAR aText[ 2 ] SIZE 360,26 PIXEL OF oDlg
@ 130,20 GET aGet[ 3 ] VAR aText[ 3 ] SIZE 360,26 PIXEL OF oDlg
@ 170,20 BUTTON "OK" SIZE 100,30 PIXEL OF oDlg ACTION oDlg:End()
AEval( aGet, { |oGet| oGet:bGotFocus := { |o|FnGotFocus( o, oClp ) } } )
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
XBROWSER aText
return nil
//----------------------------------------------------------------------------//
static function FnGotFocus( o, oClp )
local cText
if oClp:Open()
cText := oClp:GetText()
if cText != nil
if CHR( 10 ) $ cText
cText := StrTran( cText, CRLF, CHR(10) )
cText := StrTran( cText, CHR(10), ", " )
oClp:Clear()
oClp:SetText( cText )
endif
endif
oClp:Close()
endif
return nil
//----------------------------------------------------------------------------//

Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India