Sharp OZ-707 Operation Manual - Page 73

Example, Format, Purpose, Remarks

Page 73 highlights

Specify an ambiguous filename to list directory information on groups of files with common name forms. There are two wildcard characters available for this purpose. The asterisk"*,, stands for any number of characters (including none) in the filename. The question mark "?" stands for a single character in a filename. The following are examples of the use of wildcard characters: File specification TEST? T??T S?MPLE A????? R* Files listed TEST, TESTS, TEST1, TESTA TEST, TEXT, TORT, TXYT SIMPLE, SAMPLE, S2MPLE ABCDEF, APPEND, A12345 RATES,R1, RETURNS, RAND2,R If the ICeCE Ior 00 key is pressed, or if the last filename is being displayed and the IENTER I key is pressed, the entry prompt "'>" is displayed, and the Card waits for the next command. FILES has no effect if the specified files do not exist on the specified device. EXAMPLE: FILES"E:DATA" Displays information about the file DATA on RAM disk E. FILES"E:???1" Lists all files on RAM disk E that have 4-letter names ending in 1. FOR ... NEXT p FORMAT: FOR fixed numeric variable } _ { single-precision simple numeric variable - expression 1 TO expression 2 [STEP expression 3] ~ fiXed numeric variable }] NEXT [{single-precision simple numeric variable Abbreviation: F. N. STE. See Also: PURPOSE: In combination with NEXT, repeats a series of operations a specified number of times. REMARKS: FOR and NEXT are used in pairs to enclose a group of statements that are to be repeated. If the variable following NEXT is omitted, the variable following FOR is assumed. The first time this group of statements is executed the loop variable (the variable named immediately following FOR) is assigned its initial value (expression 1). When execution reaches the NEXT statement, the loop variable is increased by the STEP value (expression 3) and then this value is tested against the final value (expression 2). If the value of the loop variable is less than or equal to the final value, the enclosed group of statements is executed again, starting with the statement following FOR. If expression 3 for step size is omitted, the increment becomes 1. If the value of the loop variable is greater than the final value, execution continues with the statement that immediately follows NEXT. Because the comparison is made at the end, the statements within a FOR. .. NEXT pair are always executed at least once. When the increment is zero, FOR. .. NEXT will continue in an infinite loop. 134 135

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128

Specify
an
ambiguous filename
to
list directory information
on
groups
of files
with
common
name
forms.
There
are
two
wildcard
characters
available for
this
purpose.
The
asterisk"*,, stands for
any
number
of
characters (including none)
in
the
filename.
The
question mark
"?"
stands for a single character
in
a
filename.
The
following
are
examples
of the
use
of
wildcard
characters:
File
specification
TEST?
T??T
S?MPLE
A?????
R*
Files
listed
TEST,
TESTS,
TEST1,
TESTA
TEST, TEXT,
TORT,
TXYT
SIMPLE,
SAMPLE,
S2MPLE
ABCDEF,
APPEND,
A12345
RATES,R1,
RETURNS,
RAND2,R
If
the
I
CeCE
I
or
00
key
is
pressed,
or
if
the
last
filename
is
being
displayed
and
the
I
ENTER
I
key
is
pressed,
the entry
prompt
"'>"
is
displayed,
and
the
Card
waits
for
the
next
command.
FILES
has
no
effect
if
the specified
files
do
not
exist
on
the
specified
device.
EXAMPLE:
FILES"E:DATA"
Displays
information
about
the
file
DATA
on
RAM
disk
E.
FILES"E:???1"
Lists
all
files
on
RAM
disk
E that
have
4-letter
names
ending
in
1.
134
FOR ... NEXT
FORMAT:
FOR
~
{
fixed
numeric variable
} _
single-precision
simple
numeric variable -
expression
1
TO
expression 2 [STEP expression
3]
[{
fiXed
numeric
variable
}]
NEXT
single-precision
simple
numeric variable
Abbreviation:
F.
N.
STE.
See
Also:
PURPOSE:
In
combination
with
NEXT,
repeats a
series
of
operations a specified
number
of times.
REMARKS:
FOR
and
NEXT
are
used
in
pairs
to
enclose
a group of statements
that
are
to
be
repeated.
If
the
variable following NEXT
is
omitted, the
variable following
FOR
is
assumed.
The
first time this group
of
statements
is
executed
the
loop variable
(the
variable
named
immediately following
FOR)
is
assigned
its
initial value (expression
1).
When
execution
reaches
the
NEXT
statement,
the loop variable
is
increased by the
STEP
value
(expression
3)
and
then this
value
is
tested
against
the
final
value
(expression
2).
If
the value
of
the
loop
variable
is
less
than
or
equal
to
the
final
value,
the enclosed group of
statements
is
executed
again,
starting
with
the
statement following
FOR.
If
expression 3
for
step size
is
omitted,
the increment
becomes
1.
If
the
value of
the
loop
variable
is
greater
than
the final
value,
execution continues
with
the
statement that immediately
follows
NEXT.
Because
the comparison
is
made
at
the
end,
the statements within a
FOR.
..
NEXT pair
are
always
executed
at
least once.
When
the
increment
is
zero,
FOR.
..
NEXT
will
continue
in
an
infinite
loop.
135
p