bb.donnay-software.com

Donnay Software Web Forums
It is currently Thu Jun 04, 2020 2:37 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Apr 03, 2020 8:23 am 
Offline

Joined: Thu Jan 28, 2010 3:08 am
Posts: 212
Location: Hersham, Surrey, UK
I have done some quick code that I thought would just work, but for some reason it doesn't.

Code:
   cText := Get_Report_As_Text()
   oClipBoard := XbpClipboard():new():create()
   oClipBoard:open()
   oClipBoard:setBuffer(cText,XBPCLPBRD_TEXT)
   if oClipBoard:getBuffer(XBPCLPBRD_TEXT) == cText
      lOk:=.t.
   endif
   oClipBoard:close()
   oClipBoard:destroy()
   my_alert("Text "+iif(lOk,"","cannot be ")+"copied to clipboard"+iif(lOk," Ok",""))


The Get_Report_As_Text() does return lines of text with carriage return + linefeed line endings (I checked that).

But when I run it and after the alert appears I go to my Notepad window and paste and instead of the text I was expecting I get some bit of code I copied earlier in the day.

Can anyone see anything wrong? Or am I wrong in assuming that the Xbase++ clipboard can be used by other Windows programs?

_________________
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com


Top
 Profile  
 
PostPosted: Fri Apr 03, 2020 9:03 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4127
Location: Boise, Idaho USA
I got it to work only after calling oClipboard:clear() after oClipBoard:open()

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Mon Apr 06, 2020 1:20 am 
Offline

Joined: Thu Jan 28, 2010 3:08 am
Posts: 212
Location: Hersham, Surrey, UK
rdonnay wrote:
I got it to work only after calling oClipboard:clear() after oClipBoard:open()

You the man! Thanks, Roger, works perfectly.

I wonder if Alaska acknowledged this as a problem? If so, I can't see any mention of it...

_________________
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group