Allow2010 Posted March 21, 2016 Posted March 21, 2016 Hello, i have a small issue with consoleread under win7. The following code works under win10, but does not work under Win7 (it simply does not get the input, it is bufferd and displayed when i exit the script with control-c). While 1 $input = ConsoleRead() If $input <> "" Then ConsoleWrite("Debug: " & $input & @CRLF) $input = StringStripWS($input, 8) ExitLoop Else Sleep(250) EndIf WEnd any idea what i am doing wrong here?
rudi Posted March 22, 2016 Posted March 22, 2016 Hi. What are you trying to achieve? I mean, what kind of input has to be processed for what pupose exactly? Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Allow2010 Posted March 22, 2016 Author Posted March 22, 2016 i just want to read in a number like this: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ConsoleWrite("Please enter a Number (0-9)" & @CRLF) While 1 $input = ConsoleRead() If $input > 0 And $input < 9 Then ExitLoop Else Sleep(250) EndIf WEnd ConsoleWrite("You entered: " & $input & @CRLF) (you need to compile it and run it in a command promt to see the output). It looks like this when i run it on win10 (press enter after the number) Quote test.exe Please enter a Number (0-9) 3 You entered: 3 This works fine on Win10 but not on Win7, i need to ctrl+C to exit the program und then the number i typed is written to the console... Quote test.exe Please enter a Number (0-9) ^C 5
Allow2010 Posted March 23, 2016 Author Posted March 23, 2016 any other ideas how i can read in input from the user in a console session?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now