Re: dumb question #1 re: DO loops



StevO wrote:
| I am an long-time C programmer converting an old Fortran program to C.
|
| Given the following construct:
|
| DO 370 J=1,100
| IF(ID(J).LT.0) GOTO 370
| c (some other code here)
| 370 CONTINUE
|
| What does GOTO 370 do? Does it simply skip the "some other code here"
| section and continue with the next loop iteration (like a C "continue"
| statement within a C for() loop)? Or does it exit the loop?

The former ("continue") -- the end-label-line is part of the loop.
--
Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.
.



Relevant Pages

  • dumb question #1 re: DO loops
    ... I am an long-time C programmer converting an old Fortran program to C. ... What does GOTO 370 do? ... section and continue with the next loop iteration (like a C "continue" ...
    (comp.lang.fortran)
  • Re: Iteration in lisp
    ... state machine is just a tagbody and goto. ... But if you need to change the state-transition-matrix in the middle ... loop and either table-driven or separate-functions for defining the ... (tagbody state1 (trace-state1 aux) ...
    (comp.lang.lisp)
  • Re: COBOL aint quite dead - yet !
    ... of control there is nothing wrong with goto. ... The loop is entirely abstracted away. ... Then we have well-formed loops with a single invariant and a looping ...
    (comp.lang.cobol)
  • Re: acceptable use of goto?
    ... loop, forward within the loop at various points, then forward out of ... Then you give every statement a label. ... No goto statements. ... Then I build a framework (of if or switch statements) to eliminate the ...
    (comp.lang.c)
  • Re: GSoft BASIC Ramble
    ... Leave and exit statement are not simply "goto statement without a line ... They are structure and proper ways of leaving a loop when a ... small system programming community--and the result was not pretty! ...
    (comp.sys.apple2)