Resetting Code

Visual Basic displays a message and gives you the option of resetting your code in some circumstances, such as when you’ve changed a variable declaration as mentioned in the preceding section. However, there are other times when you may want to reset your code. Perhaps you think you’ve fixed all the bugs and want to run your code again to make sure. Whatever the reason, you can reset your code when it’s running and execution is suspended.

Û To reset your code

When you reset your code, all variables lose their current values. Variant variables are reset to the Empty keyword, object variables are reset to the Nothing keyword, numeric variables are reset to 0 (zero), variable-length string variables are reset to zero-length strings (""), and fixed-length string variables are filled with ANSI zeros.