292x Filetype PDF File size 0.32 MB Source: pittajarn.lpru.ac.th
Beginner's Programming Tutorial
in QBasic
This document is meant to get you started into programming, and assumes you
have some experience with computers and with Windows 95 (or 98, etc.).
Since this tutorial is written for people who don't like to read a lot of text, it
includes a number of examples. Therefore, you can do a lot of work in not much
time.
The more important chapters have a star ( ).
Feel free to distribute this tutorial, upload it to your website, link to it from your site, etc.
http://www.geocities.com/progsharehouse/qbtutor
Mirror: http://development.freeservers.com/qbtutor
Table of Contents
Part I: Q-Basics
Chapter 1: Before you start
Chapter 2: Your first program
Chapter 3: Variables
Chapter 4: Retrieving keyboard input from the user
Chapter 5: The IF and THEN commands
Chapter 6: Labels and the GOTO and GOSUB commands
Chapter 7: Loops
Chapter 8: What next?
Part II: Intermediate topics
Chapter 9: QBasic interface
Chapter 10: Adding documentation to your programs
Chapter 11: Reading and writing to files
Chapter 12: Displaying graphics
Chapter 13: Mathematics functions
Chapter 14: Getting the current date and time
Part III: Advanced topics
Chapter 15: Arrays
Chapter 16: Variable types
Chapter 17: Subroutines and functions
Chapter 18: Numbering systems
Chapter 19: Memory
Before you start
Before you can create a program in QBasic, you need the QBasic interpreter. It
is available from your Windows 95 (or 98) CD, or you can download it below.
To access QBasic from the Windows 95 CD:
1. Insert the CD into your CD-ROM drive.
"browse this CD"
2. Click (if the menu screen doesn't come up, then browse the CD from
My Computer
.
\OTHER\OLDMSDOS
3. Go to the directory.
4. Open a program called QBASIC.EXE (this is version 1.1 of the QBasic interpreter).
To access QBasic from the Windows 98 CD:
1. Insert the CD into your CD-ROM drive.
"browse this CD"
2. Click (if the menu screen doesn't come up, then browse the CD from
My Computer
.
\TOOLS\OLDMSDOS
3. Go to the directory.
4. Open a program called QBASIC.EXE (this is version 1.1 of the QBasic interpreter).
right-click "Save As")
Download it here ( and press :
QBASIC.ZIP
(323 KB) - QBasic 1.1 interpreter and sample programs
UNZIP32.EXE
(90 KB) - Extracts the ZIP file
To unzip the QBASIC.ZIP file with UNZIP32.EXE:
a. Go to the Start Menu
Run...
b. Click
c. Type the following (this loads MS-DOS):
command
C:\QBASIC
d. Enter the following in DOS (assuming you saved QBASIC.ZIP to ):
cd c:\qbasic
unzip32 -n qbasic.zip
Your first program
After launching the QBasic interpreter (see before you start), you might see a window requesting
Enter
a list of "parameters." If this window comes up, press the key to continue.
You should now see the QBasic interpreter, which has a blue background and displays a dialog
"Alt +
box at the center. (If the interpreter fills the entire screen, then you may want to press
Enter," to make it smaller.)
Press the Esc key to hide the dialog box.
QBasic interpreter - main screen
Type the following (including the quotation marks) in the QBasic interpreter:
PRINT "Hello World!"
F5 Hello World
Now press to run the program. You should now see a black screen, with at the
Press any key to continue
top, and at the bottom.
Press a key on the keyboard to return to the main screen.
no reviews yet
Please Login to review.