Re: A question about loop with CONTINUE



Simon wrote:

> I'm new to Fortran. Just have a simple question about GO TO and CONTINUE
> in loop. See the following example:
>
> DO 10 I=1,N
> (Code..........)
> IF (A.GT.B)GO TO 10
> (Code.........)
> 10 CONTINUE
> (subsequent code........)
>
> I am not sure what "GO TO 10" will do:
> - get out of the loop, and execute subsequent code.
> OR
> - go to "10 CONTINUE", and get back to "DO 10 I=1,N", keep looping till N
> reached.
>
> Thank you in advance!

Why are you using such ancient dialect of Fortran (curiosity aside) ?
Fortran 77 is about 20-25 years old.
.



Relevant Pages

  • Re: About alternatives to Matlab
    ... But whether a single loop is faster than several BLAS calls does not ... Bad Fortran 95 can easily be 25% lower than well-tuned C99. ... NumPy can be slower than equivalent C by an order of magnitude. ... manipulated within Python, not the speed of python code using NumPy ...
    (comp.lang.python)
  • Re: should every thing be zero indexed?
    ... Jim Rogers wrote: ... >> This for loop would have the structure of a quantification: ... >> as, arrays. ... > I acknowledge that the concept of arrays was used heavily in Fortran, ...
    (comp.programming)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... >> both less efficient and less safe than the Fortran and Basic standard. ... >> The C for loop is actually trying to do what a do loop does. ... sloppy thinking that results from confusing a programming language ... > I do not believe that you are capable of writing a conforming C compiler. ...
    (comp.programming)
  • Re: OT: The Most Unexpected AND Interesting Discovery about QBasic
    ... writing code with subtle changes in loop counters (in Fortran IV)... ... I'd put a call to a subroutine... ... course all about rockets and rocket engines. ...
    (sci.stat.math)
  • Re: You are my hope. Please
    ... >>> I'm working on my thesis and I'm porting a software from fortran to C. ... some code jumps out of a DO loop. ... Keeping in mind where the flow of control goes, ... ENDIF ...
    (comp.lang.fortran)