Author Topic: Make the contents of the output window copy-able to the clipboard?  (Read 2940 times)

0 Members and 1 Guest are viewing this topic.

Offline GTC

  • Newbie
  • Posts: 49
  • Programmer's motto: *This* time it will work.
    • View Profile
Would it be possible to make the contents of the output (DOS type) window copy-able to the clipboard?

Maybe add Copy to the menu at top left of the window?

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Do you  thing how copy the text program output window to the clipboard?

Code: QB64: [Select]
  1. 'generate random text
  2. FOR Text = 1 TO 150
  3.     char = 32 + RND * 95
  4.     char$ = char$ + CHR$(char)
  5. output$ = TIME$ + char$
  6. 'way 1 how copy char$ to clipboard:
  7.  
  8. 'now run windows wordpad and press Ctrl + V
  9. 'END
  10.  
  11.  
  12. 'or if you  have text output but none variable, create it:
  13. Height = _HEIGHT
  14.  
  15. FOR y = 1 TO Height
  16.     FOR x = 1 TO Width
  17.         text$ = text$ + CHR$(SCREEN(y, x))
  18. NEXT x, y
  19. _CLIPBOARD$ = text$
  20.  

Or copy the graphical preview of the window to the clipboard?

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. CIRCLE (400, 300), 250
  3.  
  4.  
  5.  
Or just your own graphic output?

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. CIRCLE (400, 300), 250
  3.  
  4.  
  5.  

« Last Edit: May 17, 2019, 10:47:44 am by Petr »

Offline GTC

  • Newbie
  • Posts: 49
  • Programmer's motto: *This* time it will work.
    • View Profile
Thanks. I guess I was looking for an every time solution to when I run some quick and dirty code to test a something and like the output.

_CLIPBOARD$ is probably the thing, as long as I remember to include it.

Offline Jack002

  • Forum Regular
  • Posts: 123
  • Boss, l wanna talk about arrays
    • View Profile
You need to copy from a DOS screen? I assume windows 10?
I do this.
Click the upper left corner
then do edit, mark
drag your mouse over the text
press enter
Now the text is copied to your keyboard buffer
QB64 is the best!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Rats! ChezPete beat me to the punch again! Hey, I'm going to start spiking that punch from now on! All great methods, nothing to add but the funny. It's really neat how versatile this language is.

@Jack: Yes, that's old school. We used that method to copy programming text into the QBasic IDE, too. It was slow, though. It did like a simulated typing, instead of just dumping it all in and being done with t. Still, it was better than typing in a screen or so of code.


Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/