1. Pau Haro
  2. PowerBuilder
  3. Monday, 18 January 2021 11:57 AM UTC

Hello everyone, 

Im trying to do a copy field button inside a datawindow using (Clipboard) function, I let the code down below. It's not working for me, what should I do? It's the function (Clipboard) working as it should?

 

The code down below is placed on a buttonclicked event inside a datawindow on a window.

 

string ls_localitzador


CHOOSE CASE dwo.name
case "b_copiar_localitzador"
ls_localitzador = this.GetItemString(this.GetRow(), "refer_reserva")

Clipboard(ls_localitzador)

END CHOOSE

 

Regards

Accepted Answer
Pau Haro Accepted Answer Pending Moderation
  1. Monday, 18 January 2021 12:05 PM UTC
  2. PowerBuilder
  3. # Permalink

I found how to solve it. Don't know how it works but it works :D

 

https://www.rgagnon.com/pbdetails/pb-0251.html

 

Comment
  1. René Ullrich
  2. Monday, 18 January 2021 12:28 PM UTC
Explanation:

There is a datawindow function "clipboard" to copy a bitmap image of a datawindow graph control to clipboard. Parameter is the name of the graph control.

And there is a global function "clipboard" to copy a text to clipboard or get a text from clipboard.

If you call "clipboard" from a datawindow event it calls the datawindow function.

To call the global function from a datawindow event you have to call ::clipboard(text)
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 20 January 2021 06:10 AM UTC
Never realised that, always blindly used ::clipboard()

:)
  1. Helpful
  1. Pau Haro
  2. Wednesday, 20 January 2021 11:16 AM UTC
Thanks René for the explanation. :D
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.