+-----------------------------------------------------------------+
| The Official FidoNet Quick Basic Echo's |
| (F)requently (A)sked (Q)uestions |
| CODE VERSION |
+-----------------------------------------------------------------+
Code Version 2.33
Release Date: 5/13/98
Edited by Robert Kohl of 1:109/921.66
(bobakohl@abq.com)
Credits to: Dave Shea & David Aukerman 1:2255/10
for the creation and maintainance of this CodeFAQ
Suggestions, questions, and answers from everyone in
QUIK_BAS, too many to list.
If you use code or ideas from here, make sure you give credit
where credit is due.
New in this FAQ:
No new topics this time. Sorry, it's early this time around.
Will post on the 15th next month, as expected. Computer problems!!
Topics covered in the Code FAQ:
0) Introduction
1) What are TYPEs, and how do I use them?
2) What are SUBs and FUNCTIONs, and how do I use them?
3) How can I produce a delay in my program independent of the
CPU speed?
4) What are INTERRUPTs, and how do I use them?
5) Can I use INTERRUPTs with QBasic?
6) How do I use the mouse in QB?
7) How can I check for the existance of a certain file?
8) How do I perform a cold/warm boot through QB?
9) How can I print text in a graphics mode without destroying
the background?
10) How can I animate sprites in QB?
11) Can I use VESA screen modes in QB?
12) Can I create a TSR in QB?
13) How can I make QB exit with an error level?
0) Introduction
This is the Code FAQ! Hopefully your most common questions will
be answered by this document. If not, go ahead and ask us at
the FidoNet QUIK_BAS echo, or e-mail me (Robert Kohl) and
I'll get an answer from them (or, less occasionally, from
myself).
All full program pieces of code in this FAQ are designated by
the [begin] and [end] markers. Just copy the code in between
these two lines into your QB program, and it's ready to go!
Note: Any time you see code with an underscore ("_") at the end
of a line of code, you may need to connect the two lines
surrounding it if QB doesn't do it for you automatically. For
instance:
PRINT "hello wo_
rld!"
Should be:
PRINT "hello world!"
One more thing: any time you see the use of INTERRUPTs in a
piece of code, be sure to load QB with the /L switch.
Example: qb newcode.bas /L qb.qlb
...Enjoy!
1) WHAT ARE TYPES, AND HOW DO I USE THEM?
The TYPE statement lets you create your own data type, in
addition to QB's integer, double precision, and string types,
to name a few. You create a name for this new data type,
and you can then make a list of normal variables that will
become sub-variables in your TYPE. Think of a TYPE as a
variable itself, and then the sub-variables as answering the
question, "which part of that TYPE?" TYPEs are very good
at organizing many different variables into one recognizable
area. Here's an example of a TYPE:
TYPE ScreenType
X AS INTEGER
Y AS INTEGER
Color AS INTEGER
Text AS STRING * 20
END TYPE
----------------- CodeFAQ ends part 1 of 11 ---------------------
Robert (Bob) Kohl Rio Rancho, New Mexico
Home Page: http://www.geocities.com/SiliconValley/Way/7854
http://members.tripod.com/~Bob_Kohl/index.html
Internet: bobakohl@abq.com bobakohl1@juno.com barbarianh@aol.com
--- Blue Wave/DOS v2.30
(1:301/45)
---------------
* Origin: * Binary illusions BBS * Albuquerque, NM * 505.897.8282 *
|