qbasic programing

 BBS: Inland Empire Archive
Date: 04-20-92 (05:26)             Number: 186
From: MIKE PHILLIPS                Refer#: NONE
  To: ANTHONY CORSA                 Recvd: NO  
Subj: qbasic programing              Conf: (3) Dr_Debug

AC> I am teaching my self to program in qbasic but There AC> was no book that came with it when I bought my AC> computor with dos 5.0. AC> There is a help file but I can not figure out how to grab a char AC> and move it around with the arrow keys. I think I'm AC> suppose to use the GET and PUT funtions but I'm not AC> sure. The GET statement (in graphics application) snags a rectangle of screen and stores it into an array (memory). The PUT statement displays the captured image at a specific location on the screen. In order to cause the image to move at a keypress, you must XOR the image on the screen (reverses all the bits, making the image disappear,without impacting the background, if done correctly, i.e. the first XOR incorporates the image into the existing background. A second XOR erases the image, leaving the screen area just as it was before the first XOR. Once you have figured out how to move an image on the screen, then you merely develop a CASE SELECT construct to identify which key is being pressed, and move the image dependent upon the user input. You have to trap for keys using scan codes (the help has a list of possibilities). For coding examples, please join us in the QUIK_BAS echo (available to you here on your first call) where 'real' experts are gathered, or download the QuickBASIC News (available to you here on your first call) which has tremendous teaching tools incorporated (some of which are only for QuickBASIC and not for Qbasic (the former includes a compiler, the latter is bundled with DOS). There are also some good second party books for QuickBASIC which will help you enormously. I hope this has been of some help. I don't have any coding examples that move a character based on a key press, but I hope I have given you a clue. --- Maximus 2.01wb # Origin: The Catacombs (317)525-7164 *9600HST* (8:74/1) * Origin: FamilyNet Intl. Echogate [708] 887-7685 (1:11/50)
Outer Court
Echo Basic Postings

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