# 1.4 Character Set

Compaq Fortran 77 supports the following characters:

- The Fortran character set: all uppercase and lowercase letters (A through Z, and a through z), the numerals 0 through 9, and the following special characters:

  Character | Name | Character | Name
  --- | --- | --- | ---
  blank or <TAB> | Blank (space) or tab | `'` | Apostrophe
  = | Equal sign | " | Quotation mark
  + | Plus sign | $ | Dollar sign
  - | Minus sign | _ | Underscore
  * | Asterisk | ! | Exclamation point
  / | Slash | : | Colon
  ( | Left parenthesis | < | Left angle bracket
  ) | Right parenthesis | > | Right angle bracket
  , | Comma | % | Percent sign
  . | Period | & | Ampersand

- Other printable characters, which may appear in comments and character and Hollerith constants.

- Nonprintable characters.

You can use the space character to improve the legibility of a Fortran statement. The compiler ignores all spaces in a statement field except those within a character constant or Hollerith constant; for example, GO TO and GOTO are equivalent.

Printable characters include the tab character (09 hex), those ASCII characters with codes in the range 20(hex) through 7E(hex), and those characters in the DEC Multinational Extension to the ASCII Character Set with codes in the range A1(hex) through FE(hex).

Printable characters that are not in the Fortran character set can only appear in comments, character constants, and Hollerith constants.

The form-feed character (0C hex) is treated as a blank and no diagnostic message is issued. If a source record of length 1 contains a form-feed character, the compilation source listing begins on a new page.

A source record of length 1 containing a Ctrl/Z character (1A hex) is treated as a blank line. Such a record can be created by the ENDFILE statement.

Other nonprintable characters are interpreted as follows:

- On Alpha processors, all other control characters are valid except 00(hex) and 01(hex).

- On VAX processors, if the nonprintable characters 00 (hex) through 04 (hex) appear anywhere in a Fortran source line or comment, the compiler issues a warning diagnostic and the nonprintable character is replaced with a blank in both the compiled source and the listing.

If you must use a nonprintable character in a character constant, use the CHAR intrinsic function (in conjunction with the concatenation operator, if necessary); for example:

    CHARACTER*(*) ESC_BRACKET

    PARAMETER (ESC_BRACKET = CHAR(27)//'[')

Normally, uppercase and lowercase letters are treated as equivalent when used to specify program behavior (except in character constants and Hollerith constants). However, on Alpha processors, you can use the compiler option NAMES if you want the compiler to distinguish between uppercase and lowercase letters in external names (such as names of COMMON blocks and subprograms).

For More Information:

- On the CHAR function, see Section 6.3.2.1.

- On printable characters and the Fortran character set, see Appendix B.

- On names of compiler options used in this manual, see Section E.4.

Previous Page Next Page Table of Contents