User`s guide

LOAD"$0:*
=
S"
,8
will load a directory
of
all sequential files, while the Basic 3.5 command:
DIRECTORY,"
A*=
R''
will display a directaF¥ 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
"SM?TH"
(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,"R?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
FORMAT
FOR PATTERN MATCHING:
EXAMPLES:
"expression*"
"C-64*"
or
"expression?expression''
"C?64
WEDGE"
or
'expression?expression*''
"C-64?WED*"
Use any
of
the above patterns in any
of
the disk commands whose format includes a
pattern. This applies to Load, Dload, Directory, Open, Scratch, and to the source file in
the Copy and Rename commands. More than one
"?"
can appear
in
the same pattern.
As you might expect, their use
in
pattern matching means you
can't
use the asterisk
or question mark in a file name when saving or writing a file (see next chapter.)
23