Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vb6: interrupt endless msgbox loop

I am writing a program in VB6.

By mistake many times my code contains an endless loop, inside which there is a message box. For example:

while a>0
    msgbox "a is positive"
wend

Then I press the play/run and I realize what has happened. Is there any way to stop the debugging/running of my program?

The only thing that works so far is Ctrl+Alt+Del and end task. But this way the whole visual basic closes and I lose my unsaved data. (please don't comment that I should save my program more often. I know it (now)).

Edit: I found on the internet that maybe esc or ctrl+c or ctrl+break could do the job. The first two do nothing and my laptop doesn't have a break key

Solution: I have the insert key in my laptop. on the key there is also written pause for use along with the Fn key. So I was able to break the application by pressing Ctrl+Fn+Insert (which maybe could be translated in Ctrl+Pause)

edit: link to photo of my keyboard:

like image 685
Thanos Darkadakis Avatar asked Feb 24 '14 20:02

Thanos Darkadakis


People also ask

How do I stop the message box loop?

Ctrl + Break To break out of a loop, the conventional technique is the keyboard Ctrl + Break combination.

How do I stop VBA script once it goes into the infinite loop?

Option 1: Hold the Esc key down for more than a few seconds. Option 2: Press CTRL+BREAK. Option 3: CTRL + ALT + DEL to end process & have Auto recover when you re-open.

How do you exit a while loop in VBA?

We can exit any Do loop by using the Exit Do statement.

Do Loop until cell is empty?

A do until loop needs a statement that resolves to TRUE or FALSE. In this case, we're using IsEmpty, which checks a specific cell to see if it's empty; if that cell contains a value, it returns FALSE. If it doesn't contain a value, it returns TRUE.


1 Answers

ctrl + break will work. If you don't have those keys, use the on screen keyboard.

Start | Run | osk

Then press ctrl + break.

like image 163
Mark Avatar answered Oct 01 '22 18:10

Mark