Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!ucbvax!HNYKUN53.BITNET!SCHOMAKE From: SCHOMAKE@HNYKUN53.BITNET.UUCP Newsgroups: comp.os.vms Subject: Last? Re: Language Question. Message-ID: <8705260950.AA21275@ucbvax.Berkeley.EDU> Date: Tue, 26-May-87 05:35:00 EDT Article-I.D.: ucbvax.8705260950.AA21275 Posted: Tue May 26 05:35:00 1987 Date-Received: Wed, 27-May-87 01:55:53 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 57 The following example is meant to close this discussion. It is simple, does no copying, and needs no equivalence, common or structure. Furthermore it is tested. Subroutine Work(data,n,dtype) c c Jacket routine. Just get the array reference: c byte data(*) integer n,dtype c c And pass it to the correct subroutine: c if(dtype.eq.1)then call B1work(data,n) else if(dtype.eq.2)then call I2work(data,n) else if(dtype.eq.4)then call I4work(data,n) else if(dtype.eq.5)then call R4work(data,n) else if(dtype.eq.6)then call R8work(data,n) else write(*,*) '%WORK, illegal data type code: ',dtype call exit endif return end Subroutine B1work(data,n) byte data(*) integer n c do i=1,n c (byte work) enddo return end Subroutine I2work(data,n) integer*2 data(*) integer n c do i=1,n c (i*2 work) enddo return end etc. for I4work, R4work and R8work. * ^^^^^ KKKKKUUUUNNNNN KKK UUUU NNNN Lambert Schomaker K UUUU NNN SCHOMAKE@HNYKUN53.BITNET KKK UUUU NN Nijmegen, The Netherlands. KKKKK UU N