CHAPTER
4
EXAMINING
A
FILE
The best way
to
start learning about Archive
IS
to
look through the demonstration
file
gazet, provided
on
the
Archive cartridge. This
is
a
file
which contains information about
various countries -
the
continent, the capital, the currency, the language,
the
population,
the land area and the gross domestic product per capita.
Most of the examples
in
chapters 4 and 5 refer
to
the "gazet"
file.
Before using
11,
you
should make a copy
of
It
uSing
the following procedure:
When you have loaded Archive, put a formatted
cartridge into M,crodrlve 2 and type:
backup
I ENTERI
mdv1_gazet_dbf
IENTER I
mdv2_gazet_dbf
IENTER I
Wait
until
the two Microdrives have stopped; be patient
as
the
file
is
qUite
long and can
take a while
to
copy.
Use the copy, now
on
the cartridge
in
M,crodrlve
2,
for
experimenting.
From now
on
we will
not
always
write ENTER
at
the end of every command but please
remember that
it
must
still
be used.
The look command opens a
file
so
that
you
may read
ItS
contents, but
you
are not able
to
make alterations
or
additions
to
the
file.
It
IS
a safer command than open
if
you
are
merely looking through a
file
because the
file
IS
protected against accidental modification.
You
can examine the copy of the 'gazet"
file
on
Microdrive 2 by typing:
Look
"
gaz
et
ll
e
•
DISPLAYING
A
RECORD
To
look
at
the
first
record type
- which displays the previous record,
~
which displays the first record,
- which shows the
last
record of the
file.
6
EXAMINING
OTHER
RECORDS
SEARCHING
A
FILE
Find
f;
rst
display
Don't forget
to
type ENTER alter each command and then the display
will
show the
first record of the
file.
Note the
first
line shows the logical name of the
file;
Archive automatically supplies the
name "main" for a single
file.
Logical
file
names are usually used when
you
are using
more than one
file
at
a time and are described later
Having looked
at
the
first
record of the
file,
you
may want
to
move
on
to
the following
record.
Type:
next
and the display shows the next record
In
fhe
file.
When
you
are typing single commands
alter a display command the display area
is
continuously updated
to
show the contents
of the current record.
You
can use the next command
to
step through the
file,
record
by record until
you
reach the end
(it
will
not pass the
last
record).
There are three other related commands which
you
can use
to
control which record
of the
file
is
displayed.
back
first
last
Try
uSing
these commands
to
move around the
file,
displaying any record
you
like.
Note
that the four commands first, last, next and back
do
not themselves display the record.
They merely move from record
to
record regardless of whether or not
you
have used
display command.
The
first
and Simplest search command
is
find. This
will
search from the beginning of
a
file,
looking
for
the
first
occurrence of a specified piece
of
text
in
any of the text fields.
12'84
•