One other side note, EXITs in general are bad practice. They are a part of spaghetti code. as your not allowing what ever loop is using them to end normally and return as a finished line or section of code.
Not saying they can't be used, just that it might be a better way to think of your code as something that wants to flow smoothly from start to finish with out abrupt turns or changes.
So far I have yet to find an situation where the only choice was an EXIT to do something. At least with QB BASICs.
One other side note, EXITs in general are bad practice. They are a part of spaghetti code.
Hardly.+1
Oh, I thought that EXIT (as opposed to GOTO) to finish a FOR/NEXT, DO/LOOP, WHILE/WEND was terminating the loop properly: effectively it sets the loop to the finish condition(?). In my most recent program, I did use EXIT for the first time. I hate bad practice, however. Is it bad practice?
Thanks, Steve. I see that EXIT is just a brute force GOTO execution. I see why Cobalt finds this "bad practice".
So what exactly is "bad" about the practice of using EXIT?
It's an extra option to exit a loop, specially a FOR loop which would otherwise have to run through it's entire range or use GOTO or short circuit it's index.
What say Steve? Bad practice or not?
It's an extra option to exit a loopso this option can be put on the LOOP branch with control statements...
our code wouldn’t work. X/Y continues to change...