N/APosted on - 09/08/2011
I am working in VB6 to develop a customized desktop application. The following code is a simple part of my software, and it normally works well. However, sometimes when I press the associated button, it mimics a shut down operation (Ctrl+Alt+Del, End Task). As only that code is associated with the button, I think the problem lies with the code. Can I get an answer to this mysterious problem?
For Loop in VB6 doesn’t respond. Why?
As you have deduced, the problem is in the for loop. Check your logical expression to make sure you are not getting into an infinite loop in your loop structure. Verify the code to ensure that your loop has an exit for all conditions – it is common to miss some conditions, especially if you have complicated code. One way to prove that the fault lies in the loop structure is simply to force it to stop on the first or second loop. If this resolves the issue, then the loop structure is really the culprit.