24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Language</strong> <strong>Reference</strong><br />

a<br />

(d)<br />

len<br />

is an array name.<br />

is that part of the array declarator defining the dimensions of the array.<br />

is called the length specification and is an unsigned positive integer constant or an integer<br />

constant expression enclosed in parentheses whose value is 1, 2 or 4.<br />

This form of the INTEGER statement is a <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> extension to the <strong>FORTRAN</strong> <strong>77</strong><br />

language. The length specification specifies the number of bytes of storage that will be allocated for the<br />

name appearing in the INTEGER statement. The default length specification is 4. A length specification of<br />

1 or 2 does not change the data type; it merely restricts the magnitude of the integer that can be represented.<br />

See the chapter entitled "Names, Data Types and Constants" on page 151 for more information.<br />

The length specification immediately following the word INTEGER is the length specification for each<br />

entity in the statement not having its own length specification. If a length specification is not specified the<br />

default length specification is used. An entity with its own specification overrides the default length<br />

specification or the length specification immediately following the word INTEGER. Note that for an array<br />

the length specification applies to each element of the array.<br />

Example:<br />

DIMENSION C(-5:5)<br />

INTEGER A, B*2(10), C*2<br />

INTEGER*1 X<br />

In the previous example, X is declared to be a variable of type integer and occupying 1 byte of storage, A is<br />

declared to be a variable of type integer and occupying 4 bytes of storage and B and C are declared to be<br />

arrays of type integer with each element of the array occupying 2 bytes.<br />

2.56.3 Extended INTEGER Statement: Data Initialization<br />

INTEGER[*len[,]] name [/cl/] [,name[/cl/]] ...<br />

where:<br />

name<br />

len<br />

cl<br />

is as described in the previous section.<br />

is as described in the previous section.<br />

is a list of the form:<br />

k [,k] ...<br />

k<br />

is one of the forms:<br />

c<br />

r*c (equivalent to r successive appearances of c)<br />

c<br />

is a constant or the symbolic name of a constant<br />

100 INTEGER Statement

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!