Intel fortran-80 Laptop User Manual


 
FORTRAN
Concepts
2-6
The
possibleJorms
of
aninteger
constant are:
[s]d"
.
or
[sl#d
... b
where:
s
is
an
optional
+ or
-.
sign
d
is
a digitor.one
of
the letters
A~F
b designates the number base
and
is
one
of
the letters
D,B,O;
Q,
or
H
lfthe
numher base specjfier
is
absent or is the letter
>'D/thecharacler
string
'd
... '
can
contain
only
the
digitsO~9artdjsinterpretedas
a
decimal
number
..
If
the
base
specifier
'8'
is
present,
the
character
stringm
ust contain only the digits o and 1
and
is interpreted
asa
binary number.
leo'
or
'Q'
is specified as
thebase,
the
numper
can·contain
only the digits· 0-7 and is
interpreted
as
an
octal number
..
If
'H'
is
spe¢ifiedas
the
base, the number
can
contain the digits 0-9
or
the
lettersA~Fand
is
interpreted as a hexadecimal number.
The
following
are valid
integer
constants:
o
23
+64101
-#14010
#100010108
-#100010108
-#4567Q
+#AF2CH
2.2.3 Arrays
Frequently,
the
programmer
will
want
to
refer
to
a
group
of
data
by
one
name
and
still be
able
to
refer
individually
to
elements
in
the
group
as
necessary.
Such
a
group
is called
an
array.
An
array name is
the
symbolic
name
assigned
the
array
when
it
is
defined
in a
DIMENSION
statement,
type
statement,
or
COMMON
statement
(Chapter
3).
An
array element is
one
member
in
the
group
of
data.
An
array element name is
an
ar~
ray
name
qualified
by
a subscript
enclosed
in
parentheses.
The
following
table
could
be
produced
by
rewriting
the
program
in
Figure
1
~
1
to
generate
four
1
~dimensional
arrays.
The
table
lists
three
players,
times
at
bat,
hits,
and
batting
averages.
Thus
the
array
definitions
for
these
four
arrays
could
be
PNAME(3),
AB(3),
HITS(3),
and
A VG(3).
PNAME
GEHRIG
OTT
RUTH
AB
49
60
54
HITS
14
21
18
AVG
.286
.350
.333
We
can
refer
to
any
element
in
these
arrays
by
using a
subscript.
For
example,
the
hits
for
'OTT'
can
be
referenced
as
HITS(2)
and
the
batting
average
for
RUTH
as
AVG(3).
FORTRAN-SO