Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!unmvax!brainerd From: brainerd@unmvax.unm.edu (Walt Brainerd) Newsgroups: comp.lang.fortran Subject: Re: Is this a correct Fortran 88 subroutine? Summary: OOPS Message-ID: <362@unmvax.unm.edu> Date: 6 Sep 89 22:07:09 GMT References: <1018@key.COM> <325@unmvax.unm.edu> <1024@key.COM> Organization: University of New Mexico at Albuquerque Lines: 41 In article <1024@key.COM>, sjc@key.COM (Steve Correll) writes: > > > SUBROUTINE X(L) > > > LOGICAL L > > > IF: IF ( L ) THEN > > > ELSEIF ! This is not an ELSEIF statement > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > ENDIF IF > > > END > > Is this an ELSE token followed by an optional if-construct-name "IF", or does > the standard prohibit that interpretation? This is a nice example of why I have been fighting putting construct names on the ELSE and ELSE IF statements. You can really construct some awful looking stuff, but I had forgotten about it myself! This would be perfectly OK using the old fixed source form, but I think it is not legal in the new free source form. The proposed standard says: "A blank must be used to separate names, constants, or labels from adjacent keywords, names, constants, or labels." ELSE is a keyword and IF is a (construct) name. (This is not offered as an excuse for my goof.) If you put a blank between ELSE and IF, it would be legal in both forms, so your point is still valid. I don't think much of the readability of the following either: COMPUTE_TAX: IF (INCOME < 1000) THEN TAX = ... ESLE IF (INCOME < 5000) THEN COMPUTE_TAX TAX = ... The construct name looks like a branch back to the IF statement or a procedure call or something to someone not experienced with Fortran 8x. In short, it doesn't seem to say what it is doing. Bracketing an IF construct with a name on the IF and again on the END IF I think is a great idea, however. -- Walt Brainerd Unicomp, Inc. brainerd@unmvax.cs.unm.edu 2002 Quail Run Dr. NE Albuquerque, NM 87122 505/275-0800