Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!beta!a!jlg From: jlg@a.UUCP (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: FORTRAN horrors (character init) Message-ID: <563@a.UUCP> Date: 11 Apr 88 21:08:08 GMT Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 26 Summary: Init chars > Fortran 77 DOES have one VERY serious problem with strings: it > is impossible to initialize them with non-printing characters. You can, > of course, kludge it by installing things in after initialization: > > > character*3 escseq > data escseq/' [C'/ > > ... > escseq(1:1) = char(27) Why not do: character*3 escseq parameter (escseq=char(27)//'[C') This is Fortran 77 standard. Or, if you insist that escseq needs to be a variable, then do: character*3 escseq,pescsq parameter (pescsq=char(27)//'[C') data escseq/pesc/ This also is standard Fortran 77. This second is admittedly clumsy, but it works. Note that the 'fix' for this problem in Fortran 8x is not very popular (Object-Oriented Data statements (5.2.6.2)). J. Giles Los Alamos