Thank you, Karen.
Don't mind at all; glad it's useful!

Doug
Go Packers!

On 10/17/2021 8:46 AM, 'Karen Tellef' via RBASE-L wrote:
I think that's a nice way of doing it.  I'm going to keep this solution in my notes if you don't mind!

Karen



-----Original Message-----
From: Doug Hamilton <[email protected]>
To: R:Base List <[email protected]>
Sent: Sat, Oct 16, 2021 5:17 pm
Subject: [RBASE-L] - How to copy from a DBGrid cell? Update

Javier, based in your example, I've decided to move the Variable Edit from being hidden behind the DBGrid to above the grid with an explanation. The Item Code of both the current row and the copied-to-clipboard values are displayed.



Clicking the green "Copy to Clipboard" button and then manually going another row results in:



The "Copy to Clipboard" caption is generated in an OnRowEntry EEP:

--OnRowEntry; form PartStatusDisplay
SET VAR vCaption = (.vItem + (CHAR(013)) + 'Copy to Clipboard')
PROPERTY cidCopyToClipboard CAPTION .vCaption
RETURN

vItem is generated in a variable expression: vItem = Item   (pretty straightforward).

The Copy to Clipboard button has the code:
--copy item code to clipboard
SET CLIPBOARD .vItem
SET VAR vclipboard = .vItem
RECALC VARIABLES
RETURN

I've copied the controls (push button, static text and variable edit) to the scrapbook so that adding this to other forms is a breeze. I've got an RMD with the code snippets so it's a matter of quickly copying/pasting where needed.

Doug


On 10/13/2021 12:56 PM, [email protected] <mailto:[email protected]> wrote:
A little late to the game but I am doing exactly what you want. I have an application where we are merging small segments into larger ones and we need to constantly look at the GIS map to see how they fit geometrically together. I have column on the table (OBJECTID shown in the form as INDEX) that holds an index value which we use to locate the specific segment in the GIS map and display the exact location. r
This Is what I do:
I create a variable equal to the column I need to capture:
So whichever row I am in, the variable will hold the value of the columns in question. Now, in my form, I have a Speed Button that whenever I click, transfers the value of the columns in the current row to the clipboard. Here is a portion of the form:
The code for the speed button is super simple:
SET VAR vClipboard TEXT = .vOBJECTID0
SET CLIPBOARD .vClipboard
RETURN
Now, whenever the button is clicked. the value of OBJECTID/IDEX is transferred to the clipboard and we can go to the GIS map and use Ctrl-V or right click>Paste in the proper location and the segment is displayed; really easy and pretty fool proof. Actually, you can assign the variable .vOBJECTID directly to the clipboard and eliminate the first line of code. You can use the same code with a single click or a double click instead of the Speed Button, I simply use the Speed Button because it is more intuitive/obvious to the end user.
Javier,
Javier Valencia, PE
913-915-3137
*From:*[email protected] <mailto:[email protected]> <[email protected]> <mailto:[email protected]> *On Behalf Of *Doug Hamilton
*Sent:* Tuesday, October 12, 2021 11:11 AM
*To:* [email protected] <mailto:[email protected]>
*Subject:* Re: [RBASE-L] - How to copy from a DBGrid cell?
Well, I think that puts the cell value into a _variable_, not the clipboard, which is where it ultimately needs to be.
And that's the first step of what Buddy suggested also.
Then, per Buddy: "Have an variable edit control for the getproperty varname then copy to clipboard."

So at this point it look like a two step process.

A possible alternative to the first step is to define a variable expression, vItem = Item, display vItem in a variable edit control and then use PROPERTY <Component ID> COPYTOCLIPBOARD 'TRUE' in an on-click EEP in the DBgrid.

I placed a variable edit for vItem on the form and it displays the item code of the focused row (good) but but the PROPERTY did not copy it to the clipboard.

Back to the drawing board.
Doug
On 10/12/2021 10:33 AM, Bruce Chitiea wrote:

    If it does what it looks like it does, gonna be needing this myself:
    *GETPROPERTY cid_grid_exampleName CURRENTCELLVALUE 'varname'*
    (R:DOCS)
    b
    Bruce A. Chitiea | SafeSectors, Inc.
    112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
    /[email protected] <mailto:[email protected]>/ | +011
    (909) 238-9012 c | +011 (909) 912-8678 f
    ------ Original Message ------
    From: "Doug Hamilton" <[email protected] <mailto:[email protected]>>
    To: "R:Base List" <[email protected]
    <mailto:[email protected]>>
    Sent: 10/11/2021 9:43:24 PM
    Subject: [RBASE-L] - How to copy from a DBGrid cell?

        How do I copy a text value from a DBGrid cell to the clipboard?
        Equivalent to Ctrl-C so it can be pasted into another window
        for mainframe inquiry.
        PROPERTY <Component ID> COPYTOCLIPBOARD 'SELECTED' only works
        for  Edit, Memo, Image, and Rich Text controls.
        Doug
        -- This email has been checked for viruses by Avast antivirus
        software.
        https://www.avast.com/antivirus <https://www.avast.com/antivirus>
        -- For group guidelines, visit
        http://www.rbase.com/support/usersgroup_guidelines.php
        <http://www.rbase.com/support/usersgroup_guidelines.php>
        --- You received this message because you are subscribed to
        the Google Groups "RBASE-L" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to [email protected]
        <mailto:[email protected]>.
        To view this discussion on the web visit
        
https://groups.google.com/d/msgid/rbase-l/473b7da7-76f9-b77f-7b49-f9175caaf412%40wi.rr.com
        
<https://groups.google.com/d/msgid/rbase-l/473b7da7-76f9-b77f-7b49-f9175caaf412%40wi.rr.com>.

-- For group guidelines, visit
    http://www.rbase.com/support/usersgroup_guidelines.php
    <http://www.rbase.com/support/usersgroup_guidelines.php>
    ---
    You received this message because you are subscribed to the
    Google Groups "RBASE-L" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected]
    <mailto:[email protected]>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/rbase-l/em05c8b539-02b3-4861-8092-b391c921397a%40pathfinder
    
<https://groups.google.com/d/msgid/rbase-l/em05c8b539-02b3-4861-8092-b391c921397a%40pathfinder?utm_medium=email&utm_source=footer>.

------------------------------------------------------------------------
Avast logo <https://www.avast.com/antivirus>
        
This email has been checked for viruses by Avast antivirus software.
www.avast.com <https://www.avast.com/antivirus>



--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php <http://www.rbase.com/support/usersgroup_guidelines.php>
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/6e3bbafe-90b7-edb0-95ee-3493b4f2695a%40wi.rr.com <https://groups.google.com/d/msgid/rbase-l/6e3bbafe-90b7-edb0-95ee-3493b4f2695a%40wi.rr.com?utm_medium=email&utm_source=footer>.
--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php <http://www.rbase.com/support/usersgroup_guidelines.php>
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/!%26!AAAAAAAAAAAYAAAAAAAAAG1gU%2BA71stIig71BAFnx9iihQAAEAAAAOstKO//ZJpIomuHP19F4ZUBAAAAAA%3D%3D%40vtgonline.com <https://groups.google.com/d/msgid/rbase-l/!%26!AAAAAAAAAAAYAAAAAAAAAG1gU%2BA71stIig71BAFnx9iihQAAEAAAAOstKO//ZJpIomuHP19F4ZUBAAAAAA%3D%3D%40vtgonline.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/08d94375-c005-8721-26f3-8a7a5e97aa5f%40wi.rr.com <https://groups.google.com/d/msgid/rbase-l/08d94375-c005-8721-26f3-8a7a5e97aa5f%40wi.rr.com?utm_medium=email&utm_source=footer>.
--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/1170053411.2868209.1634478396291%40mail.yahoo.com <https://groups.google.com/d/msgid/rbase-l/1170053411.2868209.1634478396291%40mail.yahoo.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/ccd0b2db-c123-be71-f204-ec6bba1c0651%40wi.rr.com.

Reply via email to