Originally Posted by mitakeet
You don't have to trust me, you can continue along hoping for the best, but I am telling you with extensive professional experience that the code you have is dead wrong and will cause no end of problems. The fact that you just happened to get it to work as expected is a pure accident (I could detail why it works, but that isn't likely to make you any smarter, particularlly when you are convinced my advice is not helpful anyway), any number of events (inside and outside of your control) could cause the program's behavior to change.