Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Q about if statement

ahasan
Beginner
649 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
649 Views
No. That's perfectly acceptable. Note, however, that changing a DO-loop control variable inside the loop is not allowed.
0 Kudos
Reply