Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!watvlsi!peregier From: peregier@watvlsi.UUCP Newsgroups: comp.lang.fortran Subject: Re: "Interesting" error interpretation by f77. Message-ID: <3731@watvlsi.waterloo.edu> Date: Thu, 17-Sep-87 14:02:09 EDT Article-I.D.: watvlsi.3731 Posted: Thu Sep 17 14:02:09 1987 Date-Received: Sat, 19-Sep-87 05:33:11 EDT References: <5117@jade.BERKELEY.EDU> Reply-To: peregier@watvlsi.waterloo.edu (Phil Regier) Organization: U. of Waterloo, Ontario Lines: 22 Keywords: FORTRAN parsing, error interpretation. In article <5117@jade.BERKELEY.EDU> lagache@violet.berkeley.edu (Edouard Lagache) writes: > PROGRAM PRACT > REAL NUM1,NUM2,SUM > WRITE(*,*) 'Enter two numbers to be added to each other:' > READ(*,*) NUM1, NUM2 > SUM = NUM1 + NUM2 > WRITE(*,*) > WRITE(*,*) 'The sum of the two numbers is : ',SUM > STOP > END >Error on line 4 of practice.f: syntax error >Warning on line 9 of practice.f: local variable num2 never used >Warning on line 9 of practice.f: local variable read never used The compiler is doing exactly what it is told. The fifth line has an entry in column 6 and therefore is a continuation line. The compiler treats the fourth and fifth lines as READ(*,*) NUM1, NUM2M = NUM1 + NUM2 which is a syntax error. I'm not going to try to guess exactly how the compiler parses this line, but when it does you get your error messages. Move line 5 to the right by two spaces and it works.