Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!hirchert From: hirchert@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: FORTRAN horrors (character init Message-ID: <50500046@uxe.cso.uiuc.edu> Date: 12 Apr 88 15:52:00 GMT References: <563@a.UUCP> Lines: 27 Nf-ID: #R:a.UUCP:563:uxe.cso.uiuc.edu:50500046:000:1034 Nf-From: uxe.cso.uiuc.edu!hirchert Apr 12 09:52:00 1988 >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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ No, it's not. FORTRAN 77 allows only operators in PARAMETER statements. The extension to allow intrinsic functions is in Fortran 8x. >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)). e.g. data (escseq=char(27)//'[C') Note that the syntax is entirely analogous with that of the PARAMETER statement. Note also that the current draft of Fortran 8x offers yet another (even less popular) alternative: character(3),data::escseq=char(27)//'[C' >J. Giles >Los Alamos Kurt W. Hirchert National Center for Supercomputing Applications