Place text into the MS Windows clipboard. ──────────────────────────────────────────────────────────────────────────────
Syntax
GT_CBPaste(<cText>) --> lPasted
Arguments:
<cText> is the text to place into the Windows clipboard.
Returns:
A logical value, .T. if the text was pasted, .F. if not.
Description:
GT_CBPaste() can be used to place text into the Windows clipboard when your application is running in a DOS window.
If the text is pasted into the clipboard the function will return true (.T.), if not, it will return false (.F.). For the function to fail to paste one of the following has to happen:
a) The application is not running under MS Windows. b) The DOS paste service is not available. c) The clipboard could not be opened.
The information used to write this function was taken from ``Hands On - Low Level'' in Personal Computer World - December 1992, Page 451. This article states that there is a problem using the described method with Windows 3.1. I have tested this function with Windows 3.1 and WFWG versions 3.1 and 3.11 and it appears to work fine.
You may also wish to note that changes will need to be made to this function before it will work in protected mode.
Examples:
// Function to take a customers address details and paste them // Into the Windows clipboard.
#define CR_LF chr(13)+chr(10)
function AddresToClip() if GT_CBPaste(alltrim(Customer->Address1)+CR_LF+; alltrim(Customer->Address2)+CR_LF+; alltrim(Customer->Address3)+CR_LF+; alltrim(Customer->Address4)+CR_LF+; alltrim(Customer->Address5)+CR_LF)