Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: blmblm@myrealbox.com Newsgroups: comp.programming Subject: Re: fortran 77 errors Date: 24 Jun 2011 20:09:09 GMT Organization: None Lines: 59 Message-ID: <96k974F6crU3@mid.individual.net> References: <4e025412$0$1945$bbae4d71@news.suddenlink.net> <4e03b413$0$1929$bbae4d71@news.suddenlink.net> X-Trace: individual.net qzAFXDJS2+jA8n3SVbZVZQRCXUzgoSYQXmrjSzzqoYw79rcBxM X-Orig-Path: not-for-mail Cancel-Lock: sha1:HFINrgowsYIHOtxCye0Ol9AR3aQ= X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: x330-a1.tempe.blueboxinc.net comp.programming:535 In article , Geoff wrote: > On Thu, 23 Jun 2011 17:45:04 -0400, "Bill Cunningham" > wrote: > > >Geoff wrote: [ snip ] > > Well here's a paste of stderr in bash from my linux machine. I don't > >know what it's trying to say. > > > >g.f:1: > > 1 program hello > > ^ > >Non-numeric character at (^) in label field [info -f g77 M LEX] > >g.f:2: > > 2 print *,'hello world' > > ^ > >Non-numeric character at (^) in label field [info -f g77 M LEX] > >g.f:3: > > 3 stop > > ^ > >Non-numeric character at (^) in label field [info -f g77 M LEX] > >g.f:4: > > 4 end > > ^ > >Non-numeric character at (^) in label field [info -f g77 M LEX] > > > >Bill > > > > You un-indented the code and removed the line numbers. If you had > copied it exactly it might have worked but you modified it. > > A significant difference between Fortran77 and C is that in Fortran, > position of the characters in the lines is very important, spaces must > be correct or it's an error and only certain characters can exist in > certain columns. In C, white space is essentially ignored by the > compiler except to separate tokens so you are free to space your code > any way you like. > > Go back to C++ and be happy. Forget ancient languages. Or if FORTRAN 77 appeals to you because of its simplicity, you might try writing F77 code but using the "free-form" syntax of "modern" Fortran (Fortran 90 and beyond) and compiling with the "-ffree-form" option. I tried this with your version of Geoff's example, and while the f77 on my Linux system complained about the "c" comments, once I changed "c" to "!" the code compiled okay. Just sayin', maybe, since I'm not really optimistic that you'll get on any better with any version of Fortran than you've done with C. But there's something to be said for persisting in the face of adversity, maybe. -- B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.