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>FORTRAN</strong> Statements<br />

2.58 LOGICAL Statement<br />

The LOGICAL statement is a type declaration statement and can be used to declare a name to be of type<br />

logical. The implicit type of the name, whether defined by the "first letter rule" (see the chapter entitled<br />

"Names, Data Types and Constants" on page 151) or by an IMPLICIT statement, is either confirmed or<br />

overridden. However, once a name has been declared to be of type logical, it cannot appear in another type<br />

declaration statement.<br />

There are various forms of the LOGICAL statement. The following sections describe them.<br />

2.58.1 Standard LOGICAL Statement<br />

<br />

LOGICAL name [,name] ...<br />

where:<br />

name<br />

is a variable name, array name, array declarator, symbolic name of a constant, function name or<br />

dummy procedure name.<br />

This form is the standard form of the LOGICAL statement.<br />

Example:<br />

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

LOGICAL A, B(10), C<br />

In the previous example, A is defined to be a variable of type logical and B and C are defined to be arrays of<br />

type logical.<br />

2.58.2 Extended LOGICAL Statement: Length Specification<br />

LOGICAL[*len[,]] name [,name] ...<br />

where:<br />

name<br />

is one of the following forms:<br />

v[*len]<br />

a[*len](d)<br />

a(d)[*len]<br />

v<br />

is a variable name, array name, symbolic name of a constant, function name or dummy<br />

procedure name.<br />

LOGICAL Statement 103

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

Saved successfully!

Ooh no, something went wrong!