Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving contents of clipboard

Status
Not open for further replies.

wilfranz

Technical User
Oct 4, 2003
122
US
Hello friends,

How does one programmatically retrieve the clipboard contents?

Thanks

willvv
 
Hi wilvv,

I think _cliptext is what you're looking for.

Regards,

Mike
 
to add to sir mike's post, _CLIPTEXT stores only the most recent character expression (strings if you may call it) that have been selected with Ctrl+C or Copy.

hope this helps. peace! [peace]

kilroy [trooper]
philippines

"If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get one million miles to the gallon, and explode once a year, killing everyone inside."
 
Thanks Fellas,

That is indeed what I was looking for. Thanks for the help.

Bill
 
Bill,

This may not apply to what you're doing, but you do need to be careful when using _CLIPTEXT in an application. _CLIPTEXT is not just confined to VFP but the whole of windows, which can cause problems -
[ol]Say the user sets a routine going in your application and then goes to do a letter in Word. If they should copy some text between the time that your routine copies text and then uses it, _CLIPTEXT will get changed.[/ol]
I had a report that took a minute or so to run and kept getting unexpected results. These were because the user was copying text while the report was running.

I got around this by immediately copying _CLIPTEXT to a variable.

Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Stewart is absolutely correct. We store values into a form var (thisform.mytext=_cliptext) and only issue _cliptext=thisform.mytext immediately before issuing KEYBOARD '{CTRL+V}' when pasting

Bob Palmer
The most common solution is H2O!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top