Input without freezing - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: Input without freezing (/thread-9137.html) |
Input without freezing - speedlemon - 04-11-2006 This is what I have so far. I was wondering if 1) This is a bad way to do it, and 2) If there was a way to implement backspace better than it is here. Thanks Code: #INCLUDE "fbgfx.bi" Input without freezing - RyanKelly - 04-11-2006 It depends on the context you'll be using this in. You've grasped the concent of building an input string one character at a time, which is good. When you move on to implement such a scheme in an actual interface you'll come upon other ideas for a more sophiticated input routine. A few comments: You may have noticed that using the MULTIKEY function to check for a backspace results in a very touchy back space operation. The INKEY$ function returns a character for the backspace key, chr$(8), as well as for many other key strokes. Also, your code spends a lot of time clearing the screen and rewriting your string while it waits for the user to press a key. This consumes proccessor time. Here's a quick edit of your code demonstrating an different method. Code: #INCLUDE "fbgfx.bi" This isn't by any means the best way, because that will depend upon the rest of your program. Input without freezing - speedlemon - 04-11-2006 This is cool RyanKelly. I forgot that inkey$ would do that. Thanks again for the help. |