Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!romp!auschs!awdprime!heyman.austin.ibm.com!jerry From: jerry@heyman.austin.ibm.com (Jerry Heyman) Newsgroups: comp.lang.fortran Subject: Re: String manipulation. Summary: Characters and equivalences Message-ID: <4012@awdprime.UUCP> Date: 24 Oct 90 18:58:18 GMT References: Sender: news@awdprime.UUCP Distribution: comp Organization: IBM AWD, Austin Lines: 28 In article quan@sol.surv.utas.oz (Stephen Quan) writes: >I need to do some string manipulation with a type : character*128. >Can I do the following? > > character*128 str1 > character str2(128) > equivalence (str1,str2) > Having written string manipulation functions in FORTRAN (MS FORTRAN v3.1-3.3) I can say that the above will actually work with a single caveat. In your example, 'str1' CANNOT be a parameter. If necessary, declare a second variable to be a character*128 and do an assignment first. FORTRAN does NOT allow equivalences to parameters. As mentioned, this worked on MS-FORTRAN, and I have also implemented the same code on PRIMOS (rev 17.?) and on IBM mainframes using WATFIV. >-- >Stephen Quan >University of Tasmania jerry heyman -- Jerry Heyman IBM T-R: jerry@heyman.austin.ibm.com AWD Tools Development VNET : HEYMAN at AUSVMQ AWD Austin T/L : 793-3962 *** All opinions expressed are exactly that - my opinions and NOT IBM's