How to get user input in BlitzPlus

BlitzPlus Forums/BlitzPlus Beginners Area/How to get user input in BlitzPlus

jogger(Posted 2006) [#1]
Just got BlitzPlus for my classroom and now the Blitz Basic input$ code in my programs opens in a separate window! My students code math games asking the user to input the correct answer. How can I refit the Basic code use of input$ to work in one window?


GfK(Posted 2006) [#2]
Input/Print etc all operate within a console in BlitzPlus. I don't have it any more but I'm pretty sure you need to be using the GUI commands to get user input. Have a look at CreateTextField or possible CreateTextArea.


Kuron(Posted 2006) [#3]
If you must use a graphics window, check the code archives on this site, there are a couple of different solutions that should work for you.


Grey Alien(Posted 2006) [#4]
Yeah I just added one with a full example of it working. Today is your luck day :-)
http://www.blitzbasic.com/codearcs/codearcs.php?code=1671

It's a bit complicated though.


robot(Posted 2006) [#5]
You could use the getkey() function, then convert the returned value to the cooriponding ASCII code using the chr() funciton. But this means you would have to change the numbers to strings so you could compare apples to apples.


jogger(Posted 2006) [#6]
Thank you all that replied and for your diligent additions to the code achives. My students are totally hooked on learning to code using Blitz. I just have to try to stay one step ahead of them.

Jogger