BBS: Inland Empire Archive Date: 02-05-93 (01:34) Number: 396 From: RAYMOND KEITH Refer#: NONE To: ERIC MAYS Recvd: NO Subj: Re: Data Input Editor to Conf: (2) Quik_Bas
> How can I repplace all theinput and line input statements... Input? Line Input? Those BASIC commands can really stink up a good piece of code. Wouldn't it be nice if there was a basic input command that didn't allow users to Ctrl-Break out, one that didn't allow a user to type past a certain length, making a mess out of your menus. One that was a bit more configurable that you could just call when you needed the user to enter in some information? Sorry to report there isn't one. On a brighter note without too much work you can write your own "Data Input Editor" that does all the above and more. You will need to replace the INPUT and LINE INPUT with a routine that handles each keypress individualy. It's a lot more work than using INPUT but the results are worth it. I'll give you a general description of the routine I wrote for data input then give you some code in the next couple messages which may give you some ideas on how to write your own. My "Data Input Editor" is a one size fits all type of routine. Whenever I need the user to type something in, I call this one routine. It handles different length strings, dates, numbers, currency, etc. The user cannot type more characters than is allowed, therefore your menus don't get all messed up. The user can only type those keys active for a particular type of field. Date for example only accepts the numbers 0 to 9 and the / character. My input editor is written for VGA mode 12 so is a bit more complicated than would be needed for a text mode program. I think you could modify it rather easily for use in text mode though. All the regular editing functions are supported. Insert and Overwrite modes, left/right cursoring, delete/backspace, Home/End to jump to the beggining/end of the field, and hot key to clear the field. The mouse is also supported in a couple ways. First since my menu's are very much like what you see in a Windows program, my users must be able to click on buttons and areas of the screen. The second mouse function my input editor supports regards a status line. As the user moves the mouse cursor over different buttons and areas of the screen, a status line at the bottom of the screen describes the area or button the mouse pointer is over. Well thats the general overview. I built this editor over a short period of time. As new needs arise I modify it as needed. See the next couple of messages for some code to look over. Raymond --- DB 1.51/003468 * Origin: R/E Northwest (1:105/224)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET