Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sei.cmu.edu!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!br0w+ From: br0w+@andrew.cmu.edu (Bruno W. Repetto) Newsgroups: comp.lang.fortran Subject: Questions about IF Message-ID: Date: 23 Jun 91 16:55:59 GMT Organization: Graduate School of Industrial Administration, Carnegie Mellon, Pittsburgh, PA Lines: 20 Suppose there is this IF command: IF(.AND..AND. ... .AND.)statement (The intent is to execute 'statement' ONLY IF all expressions 'expression-i', for i=1 to n, evaluate to .TRUE.) My questions are about the STANDARD for executing such a command: 1) Are the expressions evaluated from "left to right"? 2) Supposing 1) above is true, if expressions 1 to i evaluate to .TRUE., and expression i+1 evaluates to .FALSE., are the subsequent expressions evaluated (if any remain), or is the execution of the IF command concluded right then? I know that at least Microsoft FORTRAN (v5.0) and Sun f77 (v1.3.1) "do it right", i.e., they evaluate the expressions from left to right. The execution of the command is concluded as soon as one of the expressions evaluate to .FALSE.; otherwise, 'statement' is executed. Thanks. Bruno. br0w+@andrew.cmu.edu