support: Customer Portal
Focused on delivering choice, investment protection and flexibility to organizations with valuable COBOL assets
 

Veryant Knowledge Base
Home > All Categories > isCOBOL General > User Interface > How to copy data from the clipboard
Question Title How to copy data from the clipboard

If an isCOBOL program needs to use the current data from the clipboard, and that isCOBOL program has an active screen, it is simple to do using the action-paste action of an entry-field.
The basic code to place the data from the Clipboard into an entry-field and then get it from the entry-field to a variable is as follows:

       initialize ws-clipboard
       modify  ef-clipboard value  spaces
       modify  ef-clipboard action action-paste 
       inquire ef-clipboard value  ws-clipboard
       .

The variable ws-clipboard would be defined as:

       01 ws-clipboard pic x any length.

And the ef-clipboard entry-field would be defined with the property visible 0 to be invisible.
The screen might look like this.

For example, if you copy text (ctrl-c) from a file you are editing in notepad and then you press the push-button on the screen, the clipboard data will be written to ws-clipboard using the code above.
Then you can display to a message box (or use for any needed business logic in a real program).

You can download the complete sample program attached below that demonstrates this functionality.

Compile it with this command line:

   iscc  -sp="%iscobol%sampleisdef" copyfromclipboard.cbl

Run it with this command line:

   iscrun COPYFROMCLIPBOARD
Authored by: Veryant Support This question has been viewed 1101 times so far.
Click Here to View all the questions in User Interface category.
File Attachments File Attachments
How helpful was this article to you?
User Comments User Comments Add Comment
There are no user comments for this question. Be the first to post a comment. Click Here
Related Questions Related Questions
  1. How do I center a window on the desktop?
  2. Does isCOBOL provide GUI design support?
  3. iscobol.font.default and DEFAULT-FONT
  4. What are the specific fonts that isCOBOL uses by default?
  5. Can I have an entry-field that more or less works the same as Google Search? So I would like to be able to change the contents of the list while the user is typing...
  6. Does isCOBOL provide Graph modules to show statistics?
  7. Did you know isCOBOL has the Accordion control?
  8. Is it possible to sort dates in a grid control?
  9. Working with a grid control is there a way to get the double-click event?
  10. How can I refresh the current contents of the paged grid?
  11. Is there a way to show leading zeros when numeric data items are displayed on a character based screen?
  12. How can I show an animated gif with isCOBOL?
  13. Did you know isCOBOL supports a tip inside the entry-field and combo-box controls when they are empty?
  14. Is it possible to configure the color of the read-only entry-fields?
  15. Did you know how to customize color of the borders of some controls?
  16. UNC Paths with Browser Control don't work. What can I do to solve it?
  17. Did you know that you can protect a Grid from editing without coding any event?
  18. How to detect if a computer has more than one monitor and use any of them?
  19. Gradient effects
  20. How may I display a notification window that requires no user intervention?
  21. Do isCOBOL GUI Screens have resizing capabilities?
  22. How to add pages and GUI controls inside them to a tab control dynamically?
Article Information Additional Information
Article Number: 313
Created: 2020-07-10 10:10 AM
Rating: No Rating
 
Article Options Article Options
Print Question Print this Question
Email Question Email Question to Friend
Export to Adobe PDF Export to PDF File
Export to MS Word Export to MS Word
Bookmark Article
Subscribe to Article Subscribe to Article
 
Search Knowledge Base Search Knowledge Base



 
 

© Veryant - All Rights Reserved
Veryant and isCOBOL are trademarks or registered marks of Veryant in the United States and other countries. All other marks are the property of their respective owners.