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.

3 Names, Data Types and Constants<br />

3.1 Symbolic Names<br />

Symbolic names are names that represent variables, arrays, functions, etc. Names are formed using any of<br />

the upper-case letters A-Z and the digits 0-9, the first of which must be a letter. Symbolic names are<br />

limited to 6 characters in length. The following are examples of symbolic names.<br />

AMOUNT<br />

AGE<br />

CUST73<br />

<strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> extends the allowable characters that can make up a symbolic name to<br />

include the lower-case letters a-z, the dollar sign ($) and the underscore (_). Note that the dollar sign and<br />

the underscore are treated as letters and are therefore allowed as the first letter of a symbolic name.<br />

Furthermore, <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> allows symbolic names of up to 32 characters. The following<br />

are examples of permissible symbolic names.<br />

Evaluate<br />

$Cheque<br />

ComputeAverage<br />

_device<br />

IO$ERROR<br />

student_total<br />

<strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> makes no distinction between upper and lower case letters. The following<br />

symbolic names are identical.<br />

Account<br />

ACCount<br />

ACCOUNT<br />

Spaces are allowed in symbolic names and are ignored. The following symbolic names are identical.<br />

C R E DIT<br />

CRE D I T<br />

<strong>FORTRAN</strong> <strong>77</strong> allows certain keywords such as WRITE to be used as symbolic names. In <strong>Open</strong> <strong>Watcom</strong><br />

<strong>FORTRAN</strong> <strong>77</strong>, all keywords satisfy the requirements of a symbolic name. A keyword is a sequence of<br />

letters that is interpreted in a special way by <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong>. Whether a string of characters<br />

is interpreted as a keyword or as a symbolic name depends on the context in which it is used. In the<br />

following example, the first statement is an assignment statement assigning the value 2 to the symbolic<br />

name DO10I. The second statement is the beginning of a DO-loop.<br />

Symbolic Names 151

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

Saved successfully!

Ooh no, something went wrong!