How to resolve the algorithm Keyboard input/Obtain a Y or N response step by step in the Microsoft Small Basic programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Keyboard input/Obtain a Y or N response step by step in the Microsoft Small Basic programming language
Table of Contents
Problem Statement
Obtain a valid Y or N response from the keyboard. The keyboard should be flushed, so that any outstanding key-presses are removed, preventing any existing Y or N key-press from being evaluated. The response should be obtained as soon as Y or N are pressed, and there should be no need to press an enter key.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Keyboard input/Obtain a Y or N response step by step in the Microsoft Small Basic programming language
Source code in the microsoft programming language
'From:
'Andy Oneill, 2-6-2015, "Small Basic: Key Input,
'" TechNet, https://social.technet.microsoft.com/wiki/contents/articles/29850.small-basic-key-input.aspx, accessed 3-19-2018
GraphicsWindow.DrawText(10, 10, "Hit any key to dump.")
GraphicsWindow.KeyDown = OnKeyDown
Sub OnKeyDown
TextWindow.WriteLine(GraphicsWindow.LastKey)
EndSub
You may also check:How to resolve the algorithm Elementary cellular automaton step by step in the C# programming language
You may also check:How to resolve the algorithm Intersecting number wheels step by step in the Haskell programming language
You may also check:How to resolve the algorithm Fusc sequence step by step in the Go programming language
You may also check:How to resolve the algorithm Mandelbrot set step by step in the UNIX Shell programming language
You may also check:How to resolve the algorithm Strip whitespace from a string/Top and tail step by step in the AutoHotkey programming language