HDTenEightyP/NetNews huggingface dataset:
From: jumper@garfield.catt.ncsu.edu (Michael Lanham)
Subject: Help With Named common blocks...again
Organization: North Carolina State University
Distribution: comp
Date: Wed, 16 Dec 1992 03:19:54 GMT

It has been pointed out to me that the original post I created for this group
was ambiguous.  

Let me start over.  I have a program that has several source files.  The data
module consists entirely of a BLOCK DATA segment.

In that data module there is a COMMON block that looks like the following.

      BLOCK DATA
      IMPLICIT INTEGER(A-Z)
      COMMON/SHARE1/TABLE(1770),NOPU(54),FLHS(54),UNUSE0(122),
     -           XLATE(127),KWT1(50),KWT2(50),STACK1(50),STACK2(50),
     -           SYMBOL(8),VALUE(8),UNUSE5(16),CHAR(80),VALUXY(12),
     -           LISTX(61),INTERX(70),SYNTAB(2,26),CHARX(26),TAG(50),
     -           NEWSPT(58),ROWSYM(131),COLSYM(50)


In most of the other files the subroutines that access this common block are
declared the same way.  

Now I find in a file separate from the data file (the first one to declare what
SHARE1 is like) a use of SHARE1 entirely different.  This is in the first
SUBROUTINE in this src file that uses SHARE1 and every other routine that uses
SHARE1 in this file also follows the convention below. 

      IMPLICIT INTEGER(A-Z)
      COMMON/SHARE1/NSVT(1000),OSVT(1000),
     -             OPND(3),LINE(133),UNUSE3(574),
     -             OUTTAB(50,4),SUPP(100,2),SYMBL(2),UNUSE2(18)


My original question still stands.  Since these declarations are not the same
length nor (obviously) the same size arrays, is the second set of definitions
concatenated to the first?  Or, because they are in separate files, and
because in the second file(the odd man out file) the first declaration of
SHARE1 is _not_ like the datafile definition, they are pointing to the same
address space(ie TABLE(1) = NSVT(1) and OSVT(1) = TABLE(1001)

BTW, I am using a DECstation with Ultrix 4.3 and I am trying to stay as
portable as possible. 


He who will not reason, is a bigot; he who cannot is a fool;
and he who dares not is a slave.      --- Sir William Drummond

Michael Lanham       mjlanham@eos.ncsu.edu   &  jumper@catt.ncsu.edu
Newsgroups: comp.lang.fortran
From: dnl@convex.is.macsch.com (David Lombard)
Subject: Re: Variable-sized square matrices
Organization: MacNeal-Schwendler Corp.
Date: Tue, 15 Dec 92 01:02:55 GMT

In article <1992Dec11.000919.1@camins.camosun.bc.ca> alumni107@camins.camosun.bc.ca writes:
>I am working with a set of functions that operate on variable-sized
>square matrices. Currently, I pass a one-dimensional array to these
>functions filled/accessed in the order that a 2D array would be
>filled. Is this portable and safe ? 
>
>Alternately, I could modify all the functions to accept square 
>matrices of a fixed size, with an additional parameter to specify the 
>current size. 
>

Either one is portable and safe.  I much prefer the first because of the space
savings and the need to only store the actual `dimensions' of the matrix (as
opposed to a `leading dimension' too).  But, if you need to work with the
arrays in the callers of the functions, the latter may be preferred.



Regards,
DNL

                 MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;

David N. Lombard    The first thing we do,         The MacNeal-Schwendler Corp
dnl@macsch.com      Let's kill all the lawyers.    815 Colorado Blvd
(213) 259-4911      II Henry VI, IV.ii             Los Angeles, CA  90041
Newsgroups: comp.lang.fortran
From: matt@grafted.UUCP (Matthew D. Sprout)
Subject: Re: elapsed time
Organization: GRAFTED, Central Indiana's Usenet BBS 317-881-4369
Date: Wed, 16 Dec 92 10:52:20 CST

Yeah!  I've got the function at home.  I'll see if I can find it.
If I remember right it is accurate to the 7th decimal place.  we
used it to test different ways of computing a formula and which
one took the longest!  Worked Great!  

              < God Bless >

                                [12/16/92]
                                Matt
sangwook@leland.Stanford.EDU (Sang Wook Sihn) writes:

> Hi.
> Does anyone know what the time functions are in fortran?
> I want to know the elasped time when I run the program.
> Thanks in advance.
> 
> Sangwook
> 
> 


--
Matthew D. Sprout
The Grafted Branch BBS
317-881-4369
internet: matt@grafted.UUCP
uucp: ..!uunet!grafted.UUCP!matt
 = = Grafted Branch BBS (317) 889-6997 2 Gig on-line = =
Newsgroups: comp.lang.fortran
From: syswtr@iowasp.physics.uiowa.edu
Subject: Re: Real Programmers
Organization: Department of Physics and Astronomy, University of Iowa
Date: Wed, 16 Dec 1992 20:37:43 GMT

In article <gay.724466320@sfu.ca>, gay@selkirk.sfu.ca (Ian D. Gay) writes:
> dodd@mycenae.cchem.berkeley.edu (Lawrence R. Dodd) writes:
> 
> 
>>>>>>> "James" == James Davies <jrbd@craycos.com> writes:
> 
>>  James> In article <DODD.92Dec15053719@mycenae.cchem.berkeley.edu> dodd@roebling.poly.edu writes:
>>>
>>>>>>>> "Doctor" == Doctor FORTRAN <jsvrc@rc.rit.edu> writes:
>>>
>>>  Doctor>   101 Format (100 (' :-)'), /, ' For the Humor-impared.')
>>>  Doctor>       Write (Kout, 101)
>>>
>>> line 2: Error: attempt to use undefined variable "kout"
>>> line 2: Error: bad unit specifier type in write statement
>>> Compilation failed
> 
>>  James> Real FORTRAN programmers always write to unit 6, and then bitch about
>>  James> the compiler being broken when it doesn't work.  write(*,101) is for
>>  James> sissies :-)
> 
>>Real FORTRAN programmers don't use lowercase letters, no excess space, no
>>commas unless the compiler complains, and no unit number that can be
>>remembered. so
> 
>> 85367 FORMAT(100(':-)')/'FOR THE HUMOR-IMPARED.')
>>       WRITE(6,85367)
>>       
> 
> Don't real programmers say 3H:-) etc?
  Only those that grew up on word machines...
From: shoppa@almach.caltech.edu (TIM SHOPPA)
Newsgroups: comp.lang.fortran
Subject: Re: getting system time (runtime) in fortran
Date: 15 Dec 1992 15:32 PST
Organization: California Institute of Technology
Distribution: world
NNTP-Posting-Host: almach.caltech.edu
News-Software: VAX/VMS VNEWS 1.41    

In article <swood.724386338@vela>, swood@vela.acs.oakland.edu (Scott Wood - EVENSONG) writes...
>I have an assignment that I would like to do in fortran (don't ask me why)
>but I need to be able to get run time to monitor the efficiency of the program.
> 
>I am compiling on a VAX system running a VMS OS (don't ask me why).
> 
>If you can help me out, please send me mail asap.
> 
>Thanks
> 
>swood
> 
Hi,
	Here is a function that does what you want in VMS Fortran.  I'm
posting it as well as sending it to you because it might come in handy
for others too.  I think it is quite self-explanatory.

					Tim (shoppa@erin.caltech.edu)

      INTEGER*4 FUNCTION ITCPU( )
C****
C****
C**** SYSTEM SERVICES ROUTINE IS USED TO OBTAIN CPU TIME USED
C**** TIME IS MEASURED IN UNITS OF 10msec TICKS
C****
C****
      EXTERNAL JPI$_CPUTIM
      INTEGER*4 SYS$GETGPI
      INTEGER*4 ICPU
      INTEGER*4 ITEMLIST(4)
      INTEGER*2 ITEMLST(8)
      EQUIVALENCE( ITEMLIST(1), ITEMLST(1) )
C****
C****
      ITEMLST(1)  = 4
      ITEMLST(2)  = %LOC(JPI$_CPUTIM)
      ITEMLST(7)  = 4
      ITEMLST(8)  = 0
      ITEMLIST(2) = %LOC(ICPU)
      ITEMLIST(3) = 0
C****
C****
      CALL SYS$GETJPI( , , , ITEMLIST, , , )
      ITCPU = ICPU
      RETURN
      END
From: dodd@mycenae.cchem.berkeley.edu (Lawrence R. Dodd)
Newsgroups: comp.lang.fortran
Subject: Re: Real Programmers
Date: 16 Dec 92 08:58:20
Organization: Dept of Chemical Engineering, Polytechnic Univ, NY, USA
	<DODD.92Dec15142737@mycenae.cchem.berkeley.edu> <gay.724466320@sfu.ca>
	<1992Dec16.025109.24541@coe.montana.edu>
	<DODD.92Dec16060307@mycenae.cchem.berkeley.edu>
	<FX.92Dec16152012@dlpx1.dl.ac.uk>
NNTP-Posting-Host: mycenae.cchem.berkeley.edu
In-reply-to: D.Love@daresbury.ac.uk's message of 16 Dec 92 15:20:12 GMT

>>>>> "Dave" == Dave Love <D.Love@daresbury.ac.uk> writes:

>>>>> On 16 Dec 92 14:03:07 GMT, dodd@mycenae.cchem.berkeley.edu (Lawrence R. Dodd) said:

 > so are we agreed that the final version would be the following?

 > 85367 FORMAT(100(3H:-))/22HFOR THE HUMOR-IMPARED.)
 >       WRITE(6,85367)

  Dave> No.
  Dave> 24HFOR THE HUMOUR-IMPAIRED.

OK I'll go with the blank in first column suggestion by
ig25@fg70.rz.uni-karlsruhe.de (Thomas Koenig) and will accept the spelling
correction for `IMPARED' (I was so caught up in the FORTRAN I could see the
English words for the syntax!)

So we have

85367 FORMAT(1H 100(3H:-))/1H 23HFOR THE HUMOR-IMPAIRED.)
      WRITE(6,85367)

as the final entry in the US and

85367 FORMAT(1H 100(3H:-))/1H 24HFOR THE HUMOUR-IMPAIRED.)
      WRITE(6,85367)

as the final entry in the England
 
now if everyone else would program that way I wouldn't have trouble debugging
code (i.e., patching the object files).

Xref: sparky comp.lang.fortran:4796 comp.os.vms:19479
Newsgroups: comp.lang.fortran,comp.os.vms
Subject: "FORTRAN tools for VMS", Source code availability?
From: mdlcpgs@lhn.gns.cri.nz
Date: Thu, 17 Dec 92 20:57:55 GMT  
Organization: Institute of Gelogical & Nuclear Sciences, New Zealand.

Has anyone actually got the source code on electronic media
from the Jones and Crabtree book, "FORTRAN tools for VAX/VMS and MSDOS"?
I had a rush to get a copy of the book after being told that it was
going out of print, sent for the source and am concerned that I have
heard nothing. Anyone know the poop?
	Phil
Newsgroups: comp.lang.fortran,comp.lang.c++,comp.lang.c
From: moudgill@cs.cornell.edu ( Mayan Moudgill)
Subject: Needed Fortran I/O format routines written in C/C++
Followup-To: comp.lang.c++
Keywords: Fortran 77, I/O, Format
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Mon, 14 Dec 1992 20:21:07 GMT


I'm looking for C/ ANSI C/ C++ routines that implement Fortan 77 I/O.
Has anyone got any?
It would be a bonus if they were ANSI FORTRAN X3.9-1978 compliant, and
handled corner cases like reading '3 6+ 8' with format 3PF6.1 is 30.6e5
(At least I think so!)

Could you  please e-mail me? I will summarize, and post.
:)
Mayan
Newsgroups: comp.lang.fortran
From: jumper@fritz.catt.ncsu.edu (Michael Lanham)
Subject: Need help with named common blocks
Organization: North Carolina State University
Distribution: comp
Date: Mon, 14 Dec 1992 03:43:35 GMT

Hi,

I need a moderate tutorial on named common blocks. Let me describe what I have
and then you can tell me how to think of it.

I have several program src files.  In the file with the BLOCK DATA segment,
the COMMON block is named and shaped as follows:

      IMPLICIT INTEGER (A-Z)
      COMMON/SHARE1/TABLE(1770),NOPU(54),FLHS(54),UNUSE0(122),
     -           XLATE(127),KWT1(50),KWT2(50),STACK1(50),STACK2(50),
     -           SYMBOL(8),VALUE(8),UNUSE5(16),CHAR(80),VALUXY(12),
     -           LISTX(61),INTERX(70),SYNTAB(2,26),CHARX(26),TAG(50),
     -           (50)



In most of the other modules the common block share1 is entered the same way.
Now I found an additional SHARE1 that is different.

      COMMON/SHARE1/NSVT(1000),OSVT(1000),
     -             OPND(3),LINE(133),UNUSE3(574),
     -             OUTTAB(50,4),SUPP(100,2),SYMBL(2),UNUSE2(18)

Is an accurate way of thinking of SHARE1 is the first declaration plus the
second concatenated to the end of the second?  I need to know this so I can
correctly build my union in C to accurately reflect the SHARE1 structure.

Please help...

He who will not reason, is a bigot; he who cannot is a fool;
and he who dares not is a slave.      --- Sir William Drummond

Michael Lanham       mjlanham@eos.ncsu.edu   &  jumper@catt.ncsu.edu
Newsgroups: comp.lang.fortran
From: wkwong@kalman.eng.ohio-state.edu (Waihon Andrew Kwong)
Subject: FORTRAN <--> C Translator??
Organization: The Ohio State University Dept of Electrical Engineering
Date: Fri, 18 Dec 1992 05:49:05 GMT

Greetings,

Is it possible to translate codes from Fortran to C back and forth?
I have a fortran program and I would like it to be translated into C
code. Is it possible??

Does anybody know a program will do this??

Any comments and info are welcome.
Thanks in advance,
Andy
From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgoup)
Newsgroups: comp.lang.fortran
Subject: faq: proposed response: various vendors f90 status
Date: 16 Dec 92 18:30:54
Organization: SunPro
Distribution: world
NNTP-Posting-Host: chiba


I would appreciate those with relevent information to email me
directly. I'll fold the responses into the Jan edition of the faq. It
is best if the information is authortative, however, rumors will be
marked as such.

Q29) What are the various compiler vendors doing about Fortran 90?

This is by no means a definitive listing <khb>

IBM's xlf 2.3 compiler for the RS6000 has partial Fortran 90 included.
Some features are implemented in the base compiler others are
implemented via preprocessor support (user has choice of KAP or VAST).

DEC has publically claimed '93 as a target for a Fortran 90 + HPF
product. 

SunPro has publically announced a technology agreement with NAG; the
result to be an integration of the NAG front end with the SunPro
optimizer, backend, and programming environment.

CRI has not, to this author's knowledge (khb), provided dates for
their Fortran product; however they have discussed the product with a
wide range of users.

HP has publically announced a phased implementation approach; the
order of feature implementation to be customer driven.

NAG has a full implementation, which functions via a translation step
to C. It is available on a variety of platforms. See "Q2 above".

Lahey has a Fortran 90 front end project, a final compiler has not
been announced.

PSR's VAST-90 is available (see Q2 above).

Kuck and Associates is said to have a translator (evidence, it is
included as part of xlf 2.3) to f77. 

Parasoft (see Q2 above).
--
----------------------------------------------------------------
Keith H. Bierman    keith.bierman@Sun.COM| khb@chiba.Eng.Sun.COM
SunPro 2550 Garcia MTV 12-40             | (415 336 2648) fax 964 0946
Mountain View, CA 94043  <speaking for myself, not Sun*> Copyright 1992

Newsgroups: comp.lang.fortran
From: cflatter@nrao.edu (Chris Flatters)
Subject: Re: SunPro f90 plans made public
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Thu, 17 Dec 1992 17:44:27 GMT

In article 92Dec16182531@chiba.Eng.Sun.COM, khb@chiba.Eng.Sun.COM (Keith Bierman fpgoup) writes:
>
>Complete text of the press release available upon request:
>
>SUNPRO ANNOUNCES FORTRAN 90 TECHNOLOGY AGREEMENT WITH THE NUMERICAL
>ALGORITHMS GROUP, LTD.

Could you forward me a copy please?

	Chris Flatters
	cflatter@nrao.edu
From: dodd@mycenae.cchem.berkeley.edu (Lawrence R. Dodd)
Newsgroups: comp.lang.fortran
Subject: Re: Real Programmers
Date: 13 Dec 92 06:41:12
Organization: Dept of Chemical Engineering, Polytechnic Univ, NY, USA
Reply-To: dodd@roebling.poly.edu
NNTP-Posting-Host: mycenae.cchem.berkeley.edu
In-reply-to: toon@moene.indiv.nluug.nl's message of 12 Dec 92 19:12:16 GMT


>>>>> "Toon" == Toon Moene <toon@moene.indiv.nluug.nl> writes:

> Has anyone out there thought about updating RP?  I mean the term Trash80 
> is so old it brings back a flood of memories and tears to my eyes.  I 
> recall my first computer, a Sinclair.

> One could put an appendix on the end with new references pointing out 
> the newly discovered virtues of FORTRAN.

  Toon> The problem is not so much with the outdated hardware (spacecraft,  
  Toon> microcomputers) alluded to, as with the target itself: FORTRAN as of 1991  
  Toon> is a language with semicolons ;-)

But it is still column based! And as RP says: "but every one of them
[compilers] has a way of converting itself back into a FORTRAN 66 compiler at
the drop of an option card -- to compile DO loops like God meant them to be."

(it doesn't really have semi-colons -- does it?)

Newsgroups: comp.lang.fortran,comp.lang.c++,comp.lang.c
From: froehle@pepper.ra.anl.gov (P Froehle RE/207/xxx 4882)
Subject: Re: Examples in Documentation
Organization: Argonne National Laboratory, Argonne IL
Date: Wed, 16 Dec 1992 21:10:43 GMT

In article <1992Dec16.090900.12289@thunder.mcrcim.mcgill.edu> mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
>In article <1gdm89INN6bj@gazette.bcm.tmc.edu>, rick@crick.ssctr.bcm.tmc.edu (Richard H. Miller) writes:
>
>[A bunch of stuff, most of which I agree with, but...]
>
>> One other point, electronic documentation is great for reference
>> manuals but there will always be a need to paper manuals especially
>> when one is developing some of these more complicated things. It is
>> easier to have that manual open and be able to flip it depending on
>> how things do, It is also useful to have the manual at the side or on
>> your lap rather than have to switch screens to look at the manual and
>> back to look at your code.
>
>Speak for yourself.  I much prefer online text for reference, because I
>don't have to look away from the screen, don't have to try to keep five
>different places at once in a paper document, etc, and most especially
>can snarf-&-barf examples or declarations or sometimes even running
>text from the docs into what I'm working on.  (If the online
>documentation is in a form that makes this impossible, such as
>PostScript that I have to run GhostScript to look at, it is at best
>marginally better and often significantly worse than paper.)
>
>					der Mouse
>
>			    mouse@larry.mcrcim.mcgill.edu

If a program cannot be run from the documentation available on the screen,
it is not worth the money you pay for it.  This is my personal criteria
for buying programs.

..paul ... phfroehle@anl.gov

Newsgroups: comp.lang.fortran
From: prener@watson.ibm.com (Dan Prener)
Subject: Re: Help With Named common blocks...again
Date: Wed, 16 Dec 1992 04:43:58 GMT
Distribution: comp
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM T.J. Watson Research Center, Hawthorne, New York

In article <jumper.724475994@garfield.catt.ncsu.edu> jumper@garfield.catt.ncsu.edu (Michael Lanham) writes:

> It has been pointed out to me that the original post I created for this group
> was ambiguous.  

> Let me start over.  I have a program that has several source files.  The data
> module consists entirely of a BLOCK DATA segment.

> In that data module there is a COMMON block that looks like the following.

>       BLOCK DATA
>       IMPLICIT INTEGER(A-Z)
>       COMMON/SHARE1/TABLE(1770),NOPU(54),FLHS(54),UNUSE0(122),
>      -           XLATE(127),KWT1(50),KWT2(50),STACK1(50),STACK2(50),
>      -           SYMBOL(8),VALUE(8),UNUSE5(16),CHAR(80),VALUXY(12),
>      -           LISTX(61),INTERX(70),SYNTAB(2,26),CHARX(26),TAG(50),
>      -           NEWSPT(58),ROWSYM(131),COLSYM(50)


> In most of the other files the subroutines that access this common block are
> declared the same way.  

> Now I find in a file separate from the data file (the first one to declare what
> SHARE1 is like) a use of SHARE1 entirely different.  This is in the first
> SUBROUTINE in this src file that uses SHARE1 and every other routine that uses
> SHARE1 in this file also follows the convention below. 

>       IMPLICIT INTEGER(A-Z)
>       COMMON/SHARE1/NSVT(1000),OSVT(1000),
>      -             OPND(3),LINE(133),UNUSE3(574),
>      -             OUTTAB(50,4),SUPP(100,2),SYMBL(2),UNUSE2(18)


> My original question still stands.  Since these declarations are not the same
> length nor (obviously) the same size arrays, is the second set of definitions
> concatenated to the first?  Or, because they are in separate files, and
> because in the second file(the odd man out file) the first declaration of
> SHARE1 is _not_ like the datafile definition, they are pointing to the same
> address space(ie TABLE(1) = NSVT(1) and OSVT(1) = TABLE(1001)

It is the latter.  Because they are in separate files, they are pointing
to the same memory.
--
                                   Dan Prener (prener@watson.ibm.com)
Newsgroups: comp.lang.fortran
From: fairfield@slacvx.slac.stanford.edu
Subject: Re: Need help with named common blocks
Organization: Stanford Linear Accelerator Center
Distribution: comp
Date: Tue, 15 Dec 1992 18:34:28 GMT

In article <Bz9xzs.F9n@news.cso.uiuc.edu>, ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi) writes:
> In article <1992Dec13.211623.1@slacvx.slac.stanford.edu>, fairfield@slacvx.slac.stanford.edu
> writes:
> |> [...]
> |>... something like CHAR(80) is most likely declared later to be
> |>of type CHARACTER*1 (or BYTE or INTEGER*1 or LOGICAL*1)...  
> 
> I think that the standard does not allow mixing character and non-character
> variables in the same common block. Correct me if I am wrong.

    Yes, non-standard, but the original poster was converting code from 
Fortran to C.  The issue of whether the exsting code was standard conforming
is moot.

    Others have pointed out that the original query could be interpreted in
two ways: different (single) declarations of a given named common in 
different program sections (my brash interpretation) versus a second
COMMON statement for the same named common in a single program section.
It would be nice if the original poster could clarify the situation so
we could put this thread to rest...

		-Ken
-- 
 Dr. Kenneth H. Fairfield    |  Internet: Fairfield@Slac.Stanford.Edu
 SLAC, P.O.Box 4349, MS 98   |  DECnet:   45537::FAIRFIELD (45537=SLACVX)
 Stanford, CA   94309        |  BITNET    Fairfield@Slacvx
 ----------------------------------------------------------------------------
 These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
Newsgroups: comp.lang.fortran
From: michael@chpc.utexas.edu (Michael Lemke)
Subject: Re: SUMMARY: CHARACTER FUNCTION as dummy argument
Organization: The University of Texas System - CHPC
Date: Tue, 15 Dec 92 19:21:00 GMT

In article <BURLEY.92Dec15044825@apple-gunkies.gnu.ai.mit.edu> burley@apple-gunkies.gnu.ai.mit.edu (Craig Burley) writes:
[...]
>
>If anyone has a system that supports the code in Sample 1 (like VAX/VMS
>FORTRAN), it'd be interesting to see how well it handled the following:
>
>C Sample 6
>	CHARACTER*(*) CFUNC
>	EXTERNAL CFUNC
>	CALL X (CFUNC)
>	PRINT *, 'Done!'
>	END
[rest of code deleted]

Compiled on VMS:

$ for foo

%FORT-F-ADJLENUSE, Passed length character name used in invalid context 
 	[CFUNC] in module FOO$MAIN 
%FORT-F-ENDNOOBJ, IO$DUC0:[MICHAEL]FOO.FOR;2 completed with 1 diagnostic - objec
t deleted


So it doesn't seem to be legal but I can't quote the standard.

Michael
-- 
Michael Lemke
Astronomy, UT Austin, Texas
(michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
From: lionel@quark.enet.dec.com (Steve Lionel)
Subject: Re: swapping bytes on a two byte integer
Reply-To: lionel@quark.enet.dec.com (Steve Lionel)
Organization: Digital Equipment Corporation, Nashua NH
Date: Tue, 15 Dec 1992 17:24:55 GMT


In article <BzB6rI.LI7@acsu.buffalo.edu>, acscmaw@ubvmsb.cc.buffalo.edu 
(MARK WIECZOREK) writes:
|>
|>I have a very simple problem. I have a binary data file composed of two byte
|>integers. After reading the data I would like to change the order of the 
|>bytes and write the result to a file. I've looked through the vax fortran
|>manuals and couldn't find a way to do this. Any help would be greatly
|>appreciated. 
|>

The simplest way is to use ISHFTC(value,8,16).  If you have a lot of these to
do and want something faster, you can define the variable as a record structure
with two byte elements and swap the bytes yourself.

The next major release of Fortran for OpenVMS VAX will have a feature that will
do the byte-swapping for you on input or output, if selected.
--

Steve Lionel                    lionel@quark.enet.dec.com
SDT Languages Group
Digital Equipment Corporation
110 Spit Brook Road
Nashua, NH 03062
Newsgroups: comp.lang.fortran