EasyManua.ls Logo

Commodore 1541-II - Pattern Matching and Wild Cards

Commodore 1541-II
104 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
LOAD"$0:*
=
S",8
will
load a
directory
of
all
sequential
files,
while
the
Basic
3.5
command:
DIRECTORY,4
4A*
=
R"
will
display
a
directory
consisting
only of
relative
files
beginning
with
the
letter
"A".
The
possible
file
types,
and
their
abbreviations
for
this
use
are:
P
=
Program
S
=
Sequential
R
=
Relative
U
=
User
D
=
Deleted
A
=
Append
M
=
Modify
PATTERN
MATCHING
AND
WILD
CARDS
Just
as
cassette
users
can
load
programs
without
giving
a
full
name,
disk
users
can
use
special pattern
matching
characters
to
load a
program
from
a
partial
name.
The
same
characters
can
also
be
used
to
provide
selective
directories.
The
two
special
characters
used
in
pattern
matching
are
the
asterisk
(*)
and
the
question
mark
(?).
They
act
something
like
a
wild
card
in
a
game
of
cards.
The
difference
between
the
two
is
that
the
asterisk
makes
all
characters
in
and
beyond
its
position
wild,
while
the
question
mark
only
makes
its
own
character
position
wild.
Here
are
some
examples,
and
their
results:
LOAD
"A*",8
loads
the
first
file
on
disk
that
begins
with
an
"A",
regardless
of
what
follows.
"ARTIST",
"ARTERY",
and
"AZURE"
would
all
qualify,
but
"BARRY"
wouldn't,
even
though
it
has
an
"A"
elsewhere
in
its
name.
DLOAD
"SM7TH"
(Basic
3.5)
loads
the
first
program
that
starts
with
"SM",
ends
with
"TH",
and
has
one
other
character
between.
This
would
load
"SMITH"
or
"SMYTH",
but
not
"SMYTHE"
OPEN
8,8,2;4R?C*,S,R"
We'll
study
Open
in
Chapter
5,
but
the
pattern
used
here
means
that
the
selected
file
will
begin
with
an
"R"
and
have
a
"C"
in
the
third
character
of
its
name.
DIRECTORY,"Q*"
(Basic
3.5)
will
load
a
directory
of
files
whose
names
begin
with
"Q".
LOAD
"*",8
and
DLOAD
"*"
are
special
cases.
When
an
asterisk
is
used
alone
as
a
name,
it
matches
the
last
file
used.
If
none
have
been
used
yet
on
the
current
diskette
since
turning
on
the
drive,
using
the
asterisk
alone
loads
the
first
program
on
the
diskette.
10
INPUT
A$:LOAD
A$+"*",8
loads
any
file
whose
name
starts
with
the
characters
entered
in
A$.
22

Table of Contents

Related product manuals