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 9459 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. UNC Paths with Browser Control don't work. What can I do to solve it?
  3. Does isCOBOL provide GUI design support?
  4. iscobol.font.default and DEFAULT-FONT
  5. What are the specific fonts that isCOBOL uses by default?
  6. 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...
  7. Did you know isCOBOL has the Accordion control?
  8. Does isCOBOL provide Graph modules to show statistics?
  9. Is it possible to sort dates in a grid control?
  10. Working with a grid control is there a way to get the double-click event?
  11. How can I show an animated gif with isCOBOL?
  12. How can I refresh the current contents of the paged grid?
  13. Is there a way to show leading zeros when numeric data items are displayed on a character based screen?
  14. Did you know isCOBOL supports a tip inside the entry-field and combo-box controls when they are empty?
  15. Did you know how to customize color of the borders of some controls?
  16. Is it possible to configure the color of the read-only entry-fields?
  17. Did you know that you can protect a Grid from editing without coding any event?
  18. Gradient effects
  19. How to detect if a computer has more than one monitor and use any of them?
  20. Do isCOBOL GUI Screens have resizing capabilities?
  21. How to add pages and GUI controls inside them to a tab control dynamically?
  22. How may I display a notification window that requires no user intervention?
  23. How to deploy bitmaps when running in application server
  24. Can I modify the GUI controls of a Screen program from a called routine?
  25. Modernizing your COBOL application by using isCOBOL Compiler code injection
  26. How to use font-based icons in isCOBOL GUI programs
  27. Modernize your character application
  28. How to adjust program screens to different screen resolutions.
  29. How to add helpful options to the Status-Bar control
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.