VB compiler warning when I do not declare variables properly

How can I make the VB6 compiler crash when I forget to declare a variable?

This will stop various input errors (both keyboards and data types) and errors like this when it tries to access something unexpected.

Problems caused by incorrect variable declaration:

+4
source share
1 answer

You must use Option Explicit . This should be placed on the first line of each module and code form code.

You can also configure the VB6 IDE to automatically add it to all new modules by choosing Tools> Options> Require Variable.

+8
source

All Articles