Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 05 FEB 1998 12:46:42PM Ron Hollar wrote:

I would like to be able to cut and/or copy the selected row from an edit table, then switch to another instance of the same child form and paste the row into it. This would be handy in my requisition entry application, the user could bring up an old order that had the item(s) that were ordered, and paste them into the new order without re-typing each column. Any ideas?


At 05 FEB 1998 02:03PM Cameron Revelation wrote:

Ron,

I would like to be able to cut and/or copy the selected row from an edit table, then switch to another instance of the same child form and paste the row into it. This would be handy in my requisition entry application, the user could bring up an old order that had the item(s) that were ordered, and paste them into the new order without re-typing each column. Any ideas?

See the Popup Designer as an example. Just put the data into the TEXT property of the CLIPBOARD object.

Cameron Purdy

info@revelation.com


At 05 FEB 1998 02:07PM Ron Hollar wrote:

Popup Designer? Is this on the works CD? Is there sample code?


At 06 FEB 1998 07:31AM Cameron Revelation wrote:

Ron,

Popup Designer? Is this on the works CD? Is there sample code?

No … I meant to run the Popup_Designer. Think about it this way … copying a row of an edit table is extracting the row and putting it onto the clip-board. Cutting a row of an edit table is copying it then deleting it. Pasting a row into an edit table is verifying that the clip-board contains an edit table row that can go into the desired edit table then inserting it.

Example:

<code>
**************************************
* cut the current row to the clipboard
**************************************
Cut:
  Values=Get_Property(Ctrl: @rm: Ctrl, "SELPOS": @rm: "LIMIT")
  Row   =field(Values, @rm, 1) 
  cRows =field(Values, @rm, 2) 

  if cRows then
    Item=Send_Message(Ctrl, "DELETE", Row)
    Set_Property("CLIPBOARD", "TEXT", Item)

   * set the focus back to the edit-table in the same position
    cRows -= 1
    if cRows then
      if Row ] cRows then
        Row=cRows
      end
      Set_Property(Ctrl: @rm: Ctrl, "FOCUS": @rm: "SELPOS", TRUE$: @rm: 1: @fm: Row)
    end
  end
return

***************************************
* copy the current row to the clipboard
***************************************
Copy:
  Values=Get_Property(Ctrl: @rm: Ctrl, "LIST": @rm: "SELPOS")
  List  =field(Values, @rm, 1)
  Row   =field(Values, @rm, 2) 

  if Row then
    Item=List
    Set_Property("CLIPBOARD": @rm: Ctrl: @rm: Ctrl, "TEXT": @rm: "FOCUS": @rm: "SELPOS", Item: @rm: TRUE$: @rm: 1: @fm: Row)
  end
return

******************************************
* paste the current row from the clipboard
******************************************
Paste:
  Values=Get_Property("CLIPBOARD": @rm: Ctrl: @rm: Ctrl, "TEXT": @rm: "SELPOS": @rm: "LIMIT")
  Item  =field(Values, @rm, 1)
  SelPos=field(Values, @rm, 2)
  Row   =SelPos
  cCols =field(Values, @rm, 1) 

  if len(Item) and (count(Item, @vm) + 1)=cCols then
    if Row else
      Row=1
    end

    Send_Message(Ctrl, "INSERT", Row, Item)
    Set_Property(Ctrl: @rm: Ctrl, "FOCUS": @rm: "SELPOS", TRUE$: @rm: 1: @fm: Row)
  end
return

</code>

Cameron Purdy

info@revelation.com

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/69c8125eb2267e8c852565a20061a923.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1