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.

Expressions<br />

7.2.3 Character Constant Expressions<br />

A character constant expression is a character expression in which all primaries are one of the following.<br />

1. character constant<br />

2. symbolic character constant<br />

3. ( character constant expression )<br />

As an extension to the <strong>FORTRAN</strong> <strong>77</strong> language, <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> supports the use of the<br />

intrinsic function CHAR in a character constant expression.<br />

Example:<br />

CHARACTER*6 HELLO, WORLD<br />

PARAMETER (HELLO = ’Hello’//CHAR(0))<br />

PARAMETER (WORLD = ’world’//CHAR(7))<br />

PRINT *, HELLO, WORLD<br />

END<br />

7.3 Relational Expressions<br />

A relational expression is used to compare two arithmetic expressions or two character expressions. It is<br />

not possible to compare a character expression to an arithmetic expression. Evaluation of a relational<br />

expression produces a result of type logical.<br />

7.3.1 Relational Operators<br />

The following table lists the relational operators and the operation they perform.<br />

<br />

Operator<br />

.LT.<br />

.LE.<br />

.EQ.<br />

.NE.<br />

.GT.<br />

.GE.<br />

Relational Operation<br />

Less than<br />

Less than or equal<br />

Equal<br />

Not equal<br />

Greater than<br />

Greater than or equal<br />

7.3.2 Form of a Relational Expression<br />

The form of a relational expression is as follows.<br />

<br />

e1 relop e2<br />

Relational Expressions 179

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

Saved successfully!

Ooh no, something went wrong!