BBC BASIC for Windows
« Copy/paste output from BBC BASIC »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:49pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Copy/paste output from BBC BASIC  (Read 158 times)
simong42
New Member
Image


member is offline

Avatar




PM


Posts: 14
xx Copy/paste output from BBC BASIC
« Thread started on: Feb 16th, 2018, 6:49pm »

Any way in which the output from a PRINT statement can be copied into the paste buffer for use elsewhere?

Use case : decrypt and output the contents of a password file, for use in online logins.
User IP Logged

michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Re: Copy/paste output from BBC BASIC
« Reply #1 on: Feb 17th, 2018, 01:26am »

I was experimenting with this code I found in help docs.

1) execute the program
2) after it ends, right click an empty spot in your editor and select paste

AND BEHOLD!

Code:
      text$ = "The five boxing wizards jump quickly"+CHR$13+CHR$10
      SYS "GlobalAlloc", &2000, LEN(text$)+1 TO hdata%
      SYS "GlobalLock", hdata% TO tmp%
      $$tmp% = text$
      SYS "GlobalUnlock", hdata%
      SYS "OpenClipboard", @hwnd%
      SYS "EmptyClipboard"
      SYS "SetClipboardData", 1, hdata%
      SYS "CloseClipboard"
      QUIT

      REM SYS "IsClipboardFormatAvailable", 1 TO res%

      REM  SYS "OpenClipboard", @hwnd%
      REM SYS "GetClipboardData", 1 TO hdata%
      REM IF hdata% THEN
      REM SYS "GlobalLock", hdata% TO tmp%
      REM text$ = $$tmp%
      REM SYS "GlobalUnlock", hdata%
      REM PRINT text$
      REM ENDIF
      REM SYS "CloseClipboard"



 
User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls