Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!ucbcad!ucbvax!KL.SRI.COM!STEINBERGER From: STEINBERGER@KL.SRI.COM.UUCP Newsgroups: comp.os.vms Subject: Language question Message-ID: <12304422133.12.STEINBERGER@KL.SRI.Com> Date: Fri, 22-May-87 11:29:28 EDT Article-I.D.: KL.12304422133.12.STEINBERGER Posted: Fri May 22 11:29:28 1987 Date-Received: Sat, 23-May-87 10:45:13 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 24 I have a question concerning a problem that Fortran does not handle well. I would like to write a subroutine that gets as arguments the following: (1) An array (2) The type of array (byte, integer*2, integer*4, real*4, etc.) In the subroutine I want to write to a file (or otherwise manipulate) data from the passed array. Fortran has an obvious problem with data typing. My (klutzy) solution was to use OTS$MOVE3 to copy the data from ARRAY to another array of the appropriate data type, then do the write. Of course this wastes a fair amount of space for duplicate data, and wastes some time to move the data bytes to the new array. But it did work. . . . I'm a bit rusty in C and Pascal. Can anyone tell me if either of these (or another HLL) allows the user to cast an array into an arbitrary type at runtime and then read/write or otherwise manipulate it as such? Do I have to use MACRO to do what I want? Thanks to all who reply. -Ric Steinberger steinberger@kl.sri.com -------