Copy PRG contents to Clipboard

In VFP 9.0 PRG contents will be copied to clipboard in RTF format as well, if there's no 'X' in the _Vfp.EditorOptions.

The code uses Editor functions from Foxtools.fll. See George Tasker's Extended Foxtools Help Download #9333 on UT

for more info.

$SAMPLECODE$

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#DEFINE FO_READONLY	0

LOCAL ARRAY laEnv [25]
LOCAL lnHandle, lnResult
SET LIBRARY TO FoxTools ADDITIVE
* Open the VFP Editor
lnHandle = _EdOpenFil(lcFile, FO_READONLY)
lnResult = _EdGetEnv( lnHandle, @laEnv )
* [ 2 ]  File Size
* Select ALL
_EdSelect(lnHandle, 0, laEnv[2])

llOK = .T.
* Copy to clipboard
IF NOT _EdCopy(lnHandle)
	MESSAGEBOX("Couldn't Copy ")
	llOK = .F.
ENDIF	
* Close Editor window
= _Wclose(lnHandle)

Comments