- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No. That's perfectly acceptable. Note, however, that changing a DO-loop control variable inside the loop is not allowed.

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