ListO
Señor Member
- Local time
- Today, 23:52
- Joined
- Feb 2, 2000
- Messages
- 167
Greetings
I know this is kind of a basic question, but I'm having trouble finding the answer.
Does it matter how an If / Endif block is exited? Would the following code cause problems when executed a lot of times?
I'm concerned that when condition1 and condition2 are true, I'm exiting both IF blocks without passing their End If code, thus leaving debris in the processor.
I have a number of places in my code with two or three nested IF blocks. It is all working nicely, but every now and again things seem to choke up and require a restart, after which everything is fine. Until it isn't again. I can be working in the application for hours on end without problems.
If I'm not exiting correctly, what IS the correct way to exit nested IF blocks?
I know this is kind of a basic question, but I'm having trouble finding the answer.
Does it matter how an If / Endif block is exited? Would the following code cause problems when executed a lot of times?
I'm concerned that when condition1 and condition2 are true, I'm exiting both IF blocks without passing their End If code, thus leaving debris in the processor.
I have a number of places in my code with two or three nested IF blocks. It is all working nicely, but every now and again things seem to choke up and require a restart, after which everything is fine. Until it isn't again. I can be working in the application for hours on end without problems.
If I'm not exiting correctly, what IS the correct way to exit nested IF blocks?
Code:
If condition1 = True then
Dosomething
If condition2 = True then
Dosomething
Goto GetOut
End If
Do_anotherthing
Do_anotherthing
End If
Domorethings_that_I_don't_want_done_if_condition2_is_True
GetOut:
Exit function