acsls@jetson.uh.edu (Eddie A. McCreary) (04/10/91)
Got a question about FORTRAN-4. I've never used it myself but I had a user come in today trying to compile a F-4 program on our F77 compiler. It crashed at two types of statements whose syntax I've never seen: 1) WRITE(6'60)FOO,BAR ========^ Why is there an ' there instead of a comma?? 2) CALL MOVE(FOO,BAR,&1270) ==================^ What does the ampersand do?? These are not syntax errors, they occur all through the program. I appreciate any ideas or guesses. Please e-mail them as I do not regularly read this group. Thanks in advance, -- Eddie McCreary |`The time has come,' the Walrus said, EMcCreary@uh.edu, Internet| `To talk of many things: EMcCreary@UHOU, BITNET |Of shoes-and ships-and sealing wax- University of Houston | Of cabbages-and-kings-'
ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) (04/12/91)
In article <9093.2802d2f5@jetson.uh.edu>, acsls@jetson.uh.edu (Eddie A. McCreary) writes: > 1) WRITE(6'60)FOO,BAR > ========^ > Why is there an ' there instead of a comma?? Because a comma would be WRONG. The 60 is not a format label, it is a record number. Unit 6 is presumably connected to a file of unformatted fixed length records. > 2) CALL MOVE(FOO,BAR,&1270) > ==================^ > What does the ampersand do?? It says that 1270 is not a number, it is a statement label. The MOVE subroutine will have somewhere in it an "alternate return" statement, so that one possibility is for MOVE to return to statement 1270. -- It is indeed manifest that dead men are formed from living ones; but it does not follow from that, that living men are formed from dead ones. -- Tertullian, on reincarnation.
tom@itc.univie.ac.at (Tom Kovar) (04/12/91)
In article <5217@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: >In article <9093.2802d2f5@jetson.uh.edu>, acsls@jetson.uh.edu (Eddie A. McCreary) writes: >> 1) WRITE(6'60)FOO,BAR >> ========^ >> Why is there an ' there instead of a comma?? > >Because a comma would be WRONG. The 60 is not a format label, >it is a record number. Unit 6 is presumably connected to a file >of unformatted fixed length records. > ...it should be stated here that this form is no fIV standard, but just an IBM extension. Neither in f77 this is a standard - the full form of this statement is WRITE(6,rec=60)... Tom Kovar
jlg@cochiti.lanl.gov (Jim Giles) (04/12/91)
|> In article <9093.2802d2f5@jetson.uh.edu>, acsls@jetson.uh.edu (Eddie A. McCreary) writes: |> > 1) WRITE(6'60)FOO,BAR |> > ========^ |> > Why is there an ' there instead of a comma?? |> |> Because a comma would be WRONG. [...] Well, so is an apostrophe. Fortran 77 standard only recognizes apostrophe as teh delimiter for character constants. No other use is defined. |> [...] |> > 2) CALL MOVE(FOO,BAR,&1270) |> > ==================^ |> > What does the ampersand do?? |> |> It says that 1270 is not a number, it is a statement label. [...] Ampersand is not even in the Fortran standard character set! The Fortran character set consists of 26 letters, 10 digits, the blank, and the following: [=+-*/(),.$':]. (not counting the square brackets.) Fortran 90 uses the ampersand for statement continuation in the Free Form source syntax. J. Giles
KENCB@SLACVM.SLAC.STANFORD.EDU (04/13/91)
In article <21132@lanl.gov>, jlg@cochiti.lanl.gov (Jim Giles) says: > >|> In article <9093.2802d2f5@jetson.uh.edu>, acsls@jetson.uh.edu (Eddie A. >McCreary) writes: >|> [...] >|> > 2) CALL MOVE(FOO,BAR,&1270) >|> > ==================^ >|> > What does the ampersand do?? >|> >|> It says that 1270 is not a number, it is a statement label. [...] > >Ampersand is not even in the Fortran standard character set! The >Fortran character set consists of 26 letters, 10 digits, the blank, >and the following: [=+-*/(),.$':]. (not counting the square brackets.) >Fortran 90 uses the ampersand for statement continuation in the Free >Form source syntax. But the original poster *did* say this was Fortran 4, not Fortran 77. And he *didn't* say the code was STANDARD, only that it ran on another machine... Lastly, the ampersand alternate-return syntax was used in IBM's Fortran HX, an extended/enhanced Fortran 4 which only this past year finally met its demise when IBM announced it would no longer support the product. BTW: while IBM's VS FORTRAN (77) does *not* support the &, VAX Fortran does, no doubt in deference to the earlier IBM Fortran syntax :-) Ken Dr. Kenneth H. Fairfield Internet: Fairfield@Tpc.Slac.Stanford.Edu SLAC, P.O.Box 4349, Bin 98 DECnet: 45047::FAIRFIELD (TPC::) Stanford, CA 94309 BITNET Fairfield@SlacTpc "These opinions are worth what you paid for 'em... ...and they are mine, not SLAC's, Stanford's, nor the DOE's..."
acsls@jetson.uh.edu (Eddie A. McCreary) (04/16/91)
In article <91102.234604KENCB@SLACVM.SLAC.STANFORD.EDU>, KENCB@SLACVM.SLAC.STANFORD.EDU writes: > In article <21132@lanl.gov>, jlg@cochiti.lanl.gov (Jim Giles) says: >> >>Ampersand is not even in the Fortran standard character set! The >>Fortran character set consists of 26 letters, 10 digits, the blank, >>and the following: [=+-*/(),.$':]. (not counting the square brackets.) >>Fortran 90 uses the ampersand for statement continuation in the Free >>Form source syntax. > > > But the original poster *did* say this was Fortran 4, not Fortran 77. That's me. > And he *didn't* say the code was STANDARD, only that it ran on another > machine... Lastly, the ampersand alternate-return syntax was used > in IBM's Fortran HX, an extended/enhanced Fortran 4 which only this past > year finally met its demise when IBM announced it would no longer support > the product. BTW: while IBM's VS FORTRAN (77) does *not* support the &, > VAX Fortran does, no doubt in deference to the earlier IBM Fortran syntax :-) > It was written many, many years ago by a gentleman with the USGS. One problem was that the user did not know what the original platform was. Many thanks to all the people who sent replies. I tried to send thank you's to you all, if I didn't get one to you, sorry, but there were quite a few. > Ken > ...and they are mine, not SLAC's, Stanford's, nor the DOE's..." -- Eddie McCreary |`The time has come,' the Walrus said, EMcCreary@uh.edu, Internet| `To talk of many things: EMcCreary@UHOU, BITNET |Of shoes-and ships-and sealing wax- University of Houston | Of cabbages-and-kings-'