New call-to-action
Results 1 to 13 of 13

Thread: Copy Paste Buttons

  1. #1
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    343

    Default Copy Paste Buttons

    Using the example provided, I would like to copy selected text from the directions field and paste the "copied" text in the next record using the "copy" & "paste" buttons. Can anyone please show me how this is done. Thank you in advance

  2. #2
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Copy Paste Buttons

    Hi Jon,

    What is wrong with using right mouse click, select copy, create new record and then right mouse click select paste?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  3. #3
    Guest
    Real Name
    Mark Pearson
    Join Date
    May 2009
    Location
    Townsville, Queensland, Australia
    Posts
    223

    Default Re: Copy Paste Buttons

    Your zip list does not have the adb file for the database.

    But you can do this by also selecting ctrl+c and then ctrl+v

    You can also look at field rules default value and set the field based on the 'use previous value'

  4. #4
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Copy Paste Buttons

    Hi Mark,

    To copy the entire text would be very straight forward, as you have pointed out.

    Just in case you missed Jon's question
    copy selected text from the directions field
    So I dont think Previous Values would help in this situation.

    Unfortunately I dont have a better answer.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  5. #5
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    343

    Default Re: Copy Paste Buttons

    Keith and Mark, thank you for your replies. I appreciate and I'm familiar with both your solutions but was hoping there was a way to place a button on the form that when pressed would copy selected text, the user would then create a new or an open an existing record, press the paste button and the previously copied text would be pasted.
    Last edited by jbk; 10-31-2009 at 10:30 AM.

  6. #6
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Copy Paste Buttons

    Jon,

    How is the user to select the text you want copied? If they are highlighting the text with a mouse, then why cant they use right click?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  7. #7
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Copy Paste Buttons

    Jon,

    How is the user to select the text you want copied?

    If they are highlighting the text with a mouse, then why cant they use right click?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  8. #8
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    Dave Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    6,047

    Default Re: Copy Paste Buttons

    try this onpush buttons

    ctext defined in form variables. I don't know how large a text block can be handled.


    Code:
    var->ctext = parentform:directions.value  'copy button
    parentform:directions.value = var->ctext  'paste button
    Dave Mason
    dave@aldadesktop.com
    Skype is dave.mason46

  9. #9
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Copy Paste Buttons

    Since the 'Directions' field is a memo type..... I typed memo in the help index and the first subitem is Copying selected text

    Using the example code I came up with this for the copy button
    Code:
    dim ptr as P
    
    Directions.activate()
    ptr = ui_editor_get()
    ptr.copy()
    and this for the paste button
    Code:
    dim ptr as P
    
    Directions.activate()
    ptr = ui_editor_get()
    ptr.paste()
    This works for memo fields because it seems that the memo editor remembers what is selected. For regular fields when you reactivate them from within the button code (needed because the button takes the focus when you push it) the portion that was selected is not remembered.

    But then again you could always use right click ... oh wait, that has already been mentioned ;)
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  10. #10
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Copy Paste Buttons

    Hi Tim,

    Would the paste command also work for text that was selected from another source? eg An email.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  11. #11
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Copy Paste Buttons

    The paste() will paste what ever happens to be on the clipboard.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  12. #12
    Member
    Real Name
    Jon
    Join Date
    Jan 2009
    Posts
    343

    Default Re: Copy Paste Buttons

    Thanks Tim for the code. I added an single line of code for the copy button and it seems to work just fine. I know that the user could just right click, but our memo fields sometimes have alot of info and by placing a button so select all with a press of a button is should we say more convenient or lazy... Thanks

    dim ptr as P

    Directions.activate()
    topparent.select_text(1,9999999)
    ptr = ui_editor_get()
    ptr.copy()

  13. #13
    Member
    Real Name
    John Kukuda
    Join Date
    Dec 2004
    Location
    Tampa, FL
    Posts
    488

    Default Re: Copy Paste Buttons

    Search the help file for clipboard. It has everything you need.

Similar Threads

  1. Cant copy and paste from A5V7
    By Keith Hubert in forum Alpha Five Version 7
    Replies: 7
    Last Post: 09-07-2008, 12:58 PM
  2. Copy And Paste
    By BOB SULLIVAN in forum Alpha Five Version 6
    Replies: 2
    Last Post: 02-10-2006, 06:56 AM
  3. Copy one paste many
    By Ed Edgar in forum Alpha Five Version 4
    Replies: 13
    Last Post: 10-13-2001, 07:23 AM
  4. Copy and Paste
    By JohnZaleski in forum Alpha Five Version 4
    Replies: 1
    Last Post: 04-14-2001, 07:54 AM
  5. Copy / Paste
    By Bill W.F. Greenberg in forum Alpha Five Version 4
    Replies: 2
    Last Post: 11-24-2000, 12:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •