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

Actually, hollerith constants are treated as character constants and can be used wherever a character<br />

constant can be used. Hollerith constants are different from character constants in that a quote is<br />

represented by two quotes in character constants and by a single quote in hollerith constants.<br />

The following are examples of hollerith constants.<br />

5HABCDEFG<br />

10h xxxxx ’44<br />

3.4.10 Hexadecimal Constants (Extension)<br />

Two forms of hexadecimal constant are supported. The first form can only be used in type declaration or<br />

DATA statements. The second form may be used anywhere an integer constant may be used.<br />

The first form of hexadecimal constant consists of the letter Z or z followed by a string of hexadecimal<br />

digits. A hexadecimal digit can be any digit or one of the letters A, B, C, D, E or F (the lower case of<br />

these letters is also acceptable). The actual data is the hexadecimal digits following the letter Z or z.<br />

Hexadecimal constants of this form can only be used in type declaration statements and DATA statements<br />

for initializing memory with binary patterns.<br />

The following are examples of the first form of hexadecimal constant.<br />

z1234<br />

Zac<br />

The first example is equivalent to the binary pattern 0001 0010 0011 0100. The second example is<br />

equivalent to the binary pattern 1010 1100.<br />

The second form of hexadecimal constant consists of an apostrophe followed by any string of hexadecimal<br />

digits followed by an apostrophe and then the letter X or x. A hexadecimal digit can be any digit or one of<br />

the letters A, B, C, D, E or F (the lower case of these letters is also acceptable). The actual data is the<br />

hexadecimal digits placed inside apostrophes.<br />

The following are examples of the second form of hexadecimal constant.<br />

’1234’x<br />

’ac’X<br />

The first example is equivalent to the binary pattern 0001 0010 0011 0100. The second example is<br />

equivalent to the binary pattern 1010 1100.<br />

3.4.11 Octal Constants (Extension)<br />

An octal constant consists of an apostrophe followed by any string of octal digits followed by an<br />

apostrophe and then the letter O or o. An octal digit can be any of the digits 0 through 7. The actual data<br />

is the octal digits placed inside apostrophes. An octal constant may be used anywhere an integer constant<br />

may be used.<br />

156 Constants

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

Saved successfully!

Ooh no, something went wrong!