- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
are there any rules/conventions regarding modifying the variable controlling the IF/SELECTCASE branching, eg,
IF(i==1)THEN
... (some codeA)
i=2
ELSEIF(i==2)THEN
... (some codeB)
i=10
ENDIF
nextstatement
I would expect this to be legal and, since Fortran doesnt have the fall-through of C (thankfully), after the branch with codeA is executed, the control is transfered to "nextstatement", even though i=2 satisfies the next ELSEIF condition.
and similarly for a SELECTCASE construct.
IF(i==1)THEN
... (some codeA)
i=2
ELSEIF(i==2)THEN
... (some codeB)
i=10
ENDIF
nextstatement
I would expect this to be legal and, since Fortran doesnt have the fall-through of C (thankfully), after the branch with codeA is executed, the control is transfered to "nextstatement", even though i=2 satisfies the next ELSEIF condition.
and similarly for a SELECTCASE construct.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that's ok.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page