Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!munnari!murdu!u3369429 From: u3369429@murdu.OZ (Michael Bednarek) Newsgroups: comp.os.vms Subject: Re: Language question Message-ID: <1256@murdu.OZ> Date: Sun, 24-May-87 23:35:32 EDT Article-I.D.: murdu.1256 Posted: Sun May 24 23:35:32 1987 Date-Received: Tue, 26-May-87 01:30:42 EDT References: <8705221905.AA01082@sdag.cs.umd.edu> Reply-To: u3369429@murdu.UUCP (Michael Bednarek) Followup-To: comp.os.vms Distribution: world Organization: I.A.E.S.R., Melbourne University Lines: 34 In article <8705221905.AA01082@sdag.cs.umd.edu> ogud@SDAG.CS.UMD.EDU (Olafur Gudmundsson) writes: >The simple solution to your problem is to use equivalence statements >this way there is no overhead because of copying. >The only overhead is that you will have to use IF statments to pick the >right data to work with > >Example : > subroutine foo( arr, typ) > > int arr( *) , typ > real r4( 1) > integer*2 i2(1) > byte c1(1) > eqivalence (arr(1), r4(1) , i2(1) , c1(1)) > >c and in the subroutine you do > if( typ.eq. INT) then > > else if( typ .eq. REA4) then > > ... > > endif This is not only simple, it also doesn't work. I suspected that immediately, but I compiled the fragment above ... >Spelling mistakes make life more colorful [This is not funny] and got -F-MULDECNAM Multiple declaration of name, A name appears in two or more inconsistent declaration statements. Of course, the same approach within a main program will work. Michael Bednarek (u3369429@murdu.oz or U3369429@xvax.dn.mu.oz.au)