How can I make the VB6 compiler fail when I forget to declare a variable?
This would stop various typing errors (both keyboard and data types) and errors like this when it tries to access something unexpected.
Problems caused by not correctly declaring variables:
You should use Option Explicit
. This should be put on the first line of every module and form's code section.
You can also configure the VB6 IDE to add this automatically to all new modules by going to Tools > Options > Require Variable Declaration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With