next up previous contents
Next: REAL and INTEGER variables Up: CHARACTER data Previous: CHARACTER data

Constants

Character constants consist of strings delimited by single quotes e.g. 'ABC'. It is possible to include the single quote character within the string but only by repeating it to show FORTRAN that it is a character of the string and not the terminating delimiter. e.g. the character constant DON'T would be coded 'DON''T'. Character constants have been shown in previous sections e.g. FORMAT and OPEN statements. There is a second type of constant called HOLLERITH. It has the form:- n H n-character-string where n is a character count for the string which immediately follows the H e.g. 5HDON'T. Use of this form of constant is declining - it should not be used in new programs.


n west (APC)
2000-03-08