Chapter 6. Making Changes To Your Programs; Correcting Keying Errors; Inserting New Lines - IBM 5110 Basic Introduction

Table of Contents

Advertisement

c
c
c'
c
Chapter 6. Making Changes to Your Programs
It is very important that you be able to make changes to your
programs. You may have to change a program to supply values for
variables, to make corrections, to add lines, or to remove lines. There
are several ways you can change a program, either as you write it or
after you write it.
CORRECTING KEYING ERRORS
If you make mistakes while entering your program statements or
commands, you already know how to fix them. As you catch the
errors, you can:
• Use the backspace or forward space key to position the cursor at
the incorrect character, then simply enter the correct character.
• Use the insert or delete function to insert or delete characters.
• Use the scroll up and scroll down keys to position a line to be
corrected.
• Press A TIN to delete all characters starting with and to the right of
the cursor position.
INSERTING NEW LINES
The following program, called phone, computes charges for local
telephone calls. The rate for local calls in this example is 10 cents for
the first three minutes or less, and 2 cents for each additional minute
or fraction of a minute. We'll write a general program, but we'll
purposely omit the actual length of any call. These are the variables
we'll use:
T
Total length of the call in whole minutes
T1
Amount of time over 3 minutes
C
Charge for the call
Making Changes to Your Programs
73
c
c
c'
c
Chapter 6. Making Changes to Your Programs
It is very important that you be able to make changes to your
programs. You may have to change a program to supply values for
variables, to make corrections, to add lines, or to remove lines. There
are several ways you can change a program, either as you write it or
after you write it.
CORRECTING KEYING ERRORS
If you make mistakes while entering your program statements or
commands, you already know how to fix them. As you catch the
errors, you can:
• Use the backspace or forward space key to position the cursor at
the incorrect character, then simply enter the correct character.
• Use the insert or delete function to insert or delete characters.
• Use the scroll up and scroll down keys to position a line to be
corrected.
• Press A TIN to delete all characters starting with and to the right of
the cursor position.
INSERTING NEW LINES
The following program, called phone, computes charges for local
telephone calls. The rate for local calls in this example is 10 cents for
the first three minutes or less, and 2 cents for each additional minute
or fraction of a minute. We'll write a general program, but we'll
purposely omit the actual length of any call. These are the variables
we'll use:
T
Total length of the call in whole minutes
T1
Amount of time over 3 minutes
C
Charge for the call
Making Changes to Your Programs
73

Advertisement

Table of Contents
loading

Table of Contents