Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

modifying IF/SELECTCASE control variable inside IF/SELECTCASE block

forall
Beginner
539 Views
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.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
539 Views
I think that's ok.
0 Kudos
Reply