QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: hanness on September 01, 2021, 04:38:46 pm
-
I have program that displays information to the user and gets input from the user entirely in a console window. There is a lot of data that gets collected from the user, requiring a good amount of typing. However, I have noticed that if I place all the responses to the program in notepad and then copy / paste to the console window, all my responses will be buffered and played back into the program from the keyboard buffer.
This has me wondering: Is there a way to inject data into the keyboard buffer from within a QB64 program?
-
If you are already using copy and paste then you should look at _CLIPBOARD$ (https://www.qb64.org/wiki/CLIPBOARD$) and _CLIPBOARD$(statement) (https://www.qb64.org/wiki/CLIPBOARD$_(statement))
-
There's http://www.qb64.org/wiki/SCREENPRINT
-
Wow, _ScreenPrint is precisely what I need. Just ran a small test program and this works great.
My plan was to grab responses from a user and save them all to a text file so that these could be played back as a script at a later without the user having to re-input all these responses again. The code to save all responses is easy, but then I would also need for every single input statement that first checked to see if there was a script file, then open the file, grab the appropriate line, stuff it into the input variable and bypass the prompt to the user since a script is present.
By simply stuffing all the previous responses into the keyboard buffer like this I won't need all that additional code.
This is brilliant!
As always, thanks for the help.