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.

Q about if statement

ahasan
Beginner
564 Views
Is there a hard rule about not changing control variables in if() statements?
The following code simplifies some Win32 programming, but not sure if I am creating problems:
if(bFlag) then ! bFlag is the ctl variable
bFlag = .FALSE.
Call Subroutine
bFlag = .TRUE.
end if
Thanks for any input.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
564 Views
No. That's perfectly acceptable. Note, however, that changing a DO-loop control variable inside the loop is not allowed.
0 Kudos
Reply