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 />

2.11 CHARACTER Statement<br />

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

character. 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 character, it cannot appear in another<br />

type declaration statement.<br />

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

2.11.1 Standard CHARACTER Statement<br />

<br />

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

where:<br />

name<br />

is one of the following forms:<br />

v[*len]<br />

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

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

v<br />

a<br />

(d)<br />

len<br />

is a variable name, symbolic name of a constant, function name or dummy procedure name.<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 the length (number of characters) of a character variable,<br />

character array element, symbolic character constant or character function. It has one of the<br />

following forms:<br />

(1) An unsigned positive integer constant.<br />

(2) A positive integer constant expression enclosed in parentheses.<br />

(3) An asterisk in parentheses (*).<br />

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

entity in the statement not having its own length specification. If omitted, the default is 1. An entity with<br />

its own length specification overrides the default length specification or the length specification<br />

immediately following the word CHARACTER. Note that for an array the length specification applies to<br />

each element of the array.<br />

26 CHARACTER Statement

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

Saved successfully!

Ooh no, something went wrong!