Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!ames!oliveb!sun!steved From: steved@sun.uucp (Steve Dever) Newsgroups: comp.lang.fortran Subject: Re: accessing character arrays... Message-ID: <10146@sun.uucp> Date: Thu, 4-Dec-86 14:34:36 EST Article-I.D.: sun.10146 Posted: Thu Dec 4 14:34:36 1986 Date-Received: Fri, 5-Dec-86 05:19:02 EST References: <1772@ncoast.UUCP> Reply-To: steved@sun.UUCP (Steve Dever) Organization: Sun Microsystems, Mountain View Lines: 31 In article <1772@ncoast.UUCP> btb@ncoast.UUCP (Brad Banko) writes: >how do you access characters in arrays of character*n? > >I am using Vax Fortran, and would like to access individual characters in >an array of character*n: > > character*n a(m) > >I want it to be "m lines of n character 'strings'", but fortran won't let >me access character y in "line" x with: > > a(x,y), or a(x)(y)... > Character substrings in FORTRAN are accessed as: c(f:l) where f is the position of the first character referenced and l is the position of the last character. For array references, the substring follows the subscript. So in your example, the reference would be written: a(x)(y:y) -- --------------------------- Steve Dever steved@Sun.COM or Sun Microsystems sun!steved