HANDS ON INSTRUCTIONS FOR QUICKBASIC
Click on the
QBasic option. Please follow the instructions on the screen. You
will be asked to insert your data diskette and press the enter key.
Read through
and do the exercises in the sections below. Read the screen, press enter for
help or press ESC to clear box and exit help.
A.
Entering your program
Type the following program in. The enter key is represented by <‑. If
you make a mistake backspace to erase it and retype the characters.
PRINT "START" <‑
PRINT "THE SUM OF 3 AND 7 IS "; 3+7 <‑
PRINT "DONE" <‑
B.
Executing the program
To run you program,
press Alt R (to get to the run menu)
type S (to start the execution)
you will be prompted to press any key to go back to the
editor
Note: A shorter way to execute a program is Shift and F5
For later use ‑ To stop execution of a program when in an endless loop,
press the Ctrl and Break keys.
To look at the output again
press Alt V (for View menu)
type O (for output screen)
Note: A shorter way to view the output again is to press F4
To print this output, press the Prnt Screen key. Make sure you are on the
output screen not the QBasic menu screen.
C.
Listing the program to the printer
Note: Before you try to print make sure you do the following:
1. turn printer on
2. switch the printer switch box to your computer
3. printer online light is on. If it is not press the online button.
Please check these three items again if you have a problem printing.
To print your hardcopy (source program) on the printer,
press Alt F (to go to the file
menu)
type P (to print your hardcopy)
your then press enter on the Entire Program
To get the paper out of the printer. Press formfeed (or line feed) to position
paper until you see the perforation. Do not use the knob. Then tear the paper
at the perforation.
D.
Making corrections to your program
Note: Do NOT position cursor by using the enter key. Use the cursor
keys.
1. To type over characters,
get out of the insert mode by pressing INSERT key (the cursor will now be a
blinking block), then position cursor and type over characters.
change all 3's to 8's and change all 7's to 9's in
line
PRINT "THE SUM OF 3 AND 7 IS "
3+7
giving .. PRINT "THE SUM OF 8 AND 9 IS " 8+9
2. To insert
characters,
get into insert mode by pressing the INSERT key (the cursor will not be a
blinking line) and position cursor and type the characters in.
insert the phrase
'WE ARE ' in line
PRINT "DONE"
giving .. PRINT "WE ARE
DONE"
3. To delete characters,
position cursor to characters to be deleted and press the DELETE key.
delete the characters 'THE' in line
PRINT "THE SUM OF 8 AND 9 IS "; 8+9
giving .. PRINT "SUM OF 8 AND 9 IS "; 8+9
4. To insert lines,
position cursor to beginning of line where new line is to go
before or to end of line where new line is to go after, and then press the
enter key.
insert the following line at the beginning of your
program
PRINT "type your name here"
5. To delete lines,
place cursor on line to be delete and press CTRL Y
delete the following
line PRINT "START"
E.
Saving program
To save a file,
type Alt F (for file menu)
type S (to save)
Note: If the file has been save previously then it will not prompt you for any
other information.
enter filename for program to be saved under press enter.
Save the program you have just written as NEWPRG.BAS
Note: there are no spaces in the filename
FILENAMES will consist of a drive letter colon (A: for left drive and B: for
right drive, if none given uses the default drive) then the filename
(consisting of 8 characters or less beginning with a letter, period and an
extension of BAS)
Note: If you want to change the name of the program later, use option A (Save
As) on the file menu. This option will allow you to save the file with a
new name.
F.
Clear Workspace for new program
To clear the workspace for a new program,
type Alt F (for file menu)
type press N (for new)
if the work file has changes which haven't been saved, it will prompt you to
either save or not save these changes before it clears the workspace. [Use the
tab key to move to correct response then press enter.]
G.
Load (open) old program
To load a previously created program,
type Alt F (for file menu)
type O (to open program)
next will appear File Name : *.bas
Note: Change *.bas to *.* if you want to see all the files.
tab down to file (the key over Ctrl with two arrows on it)
to pick from list use cursor keys (it
doesn't matter which cursor key you use) to position cursor to filename wanted
and press enter. The cursor keys are the keys with the numbers and arrows
on them. Load the file you created earlier NEWPRG.BAS
Note: Do not use press enter before you use the cursor keys
to pick the file, otherwise the command will not be accepted. If you do
this press the ESC key and try again.
H.
Exiting Quick BASIC
To exit Quick BASIC,
type Alt F (for file menu)
type X (to exit)
If the file hasn't been saved, you will be prompted to save it before exiting
Quick BASIC.
Sample
Exercise
See if you
can do the following assignment using the information you have just learned.
(You can look back at the previous information for help).
Since you
have exited QuickBasic take the menu option to start QBASIC again.
1. Type in
the following basic program.
LET A=2+2
PRINT "2+2=";A
END
2. Save the
program. Use the filename FIRST.BAS
3. Execute
the program and print it. (Print the output from the program)
4. Make a
hardcopy of your program. (Print the basic program)
5. Load the
program you created previously NEWPRG.BAS
6. Exit
QuickBASIC