Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : System Clipboard : Multiple-item data transfers : Data-based transfers
 
Data-based transfers
A typical data-based transfer differs from a widget-based transfer in that you directly reference the fields in a database (the record buffer) rather than the widgets visible on the display (the screen buffer). You might implement this type of transfer according to the following processing model:
1. The user chooses tables and fields from the database to participate in the selected operation.
2. The user indicates the operation (Cut, Copy, or Paste) to perform.
3. The procedure sets the CLIPBOARD handle MULTIPLE attribute to TRUE, and for Cut or Copy (write) operations, sets the ITEMS-PER-ROW attribute to the number of fields in each record participating in the transfer.
4. For a Cut/Copy operation, the procedure assigns each field to the VALUE attribute for each (selected) record in the table. For a Paste operation, the procedure assigns the VALUE attribute to the fields in each record created or updated in the table.
5. The procedure sets the MULTIPLE attribute to FALSE, ending the operation.
Note that for Cut/Copy operations on database fields you must access any noncharacter fields using the STRING function. For Paste (read) operations, your procedure must depend on the user to provide appropriately formatted data items in the clipboard. Your database validation functions can help to catch and respond to bad data in the clipboard.