|
CodeShine Requirements |
Top Previous Next |
|
If you can run Microsoft Visual Basic 6 or any of the Microsoft Office applications from about 1998 on, then you can run CodeShine.
CodeShine has one very important code requirement: all variables must be DECLARED in order for CodeShine to work properly!
This means that every variable must be declared in either a Dim, Private, Public, or Static statement. This is a programming Best Practice in many, many ways (the most important is that it lets the compiler help find errors for you. And we need all the help we can get - programming is complicated!) CodeShine needs to look for those declarations in order to understand and manipulate your code without errors.
Option Explicit
Microsoft knows that declaring variables is important, which is why it gives the programmer a way to ensure that he/she has not forgotten to declare any variables - the Option Explicit statement. You can read about this in your Visual Basic documentation.
If you haven't already done so, you should insert an Option Explicit statement as the first statement in every module (and, for many applications, an Option Compare Text statement couldn't hurt either).
Then, start your program with a Full Compile (Ctrl-F5). This will notify you of any undeclared variables. Add declarations for these variables, and keep hitting Ctrl-F5 to identify the next one, until the program compiles fully.
There is a handy way to ensure that all your future code includes Option Explicit. From VB's Tools menu, check the box labeled "Require Variable Declaration":
Henceforth, every module you create will start with Option Explicit. Too bad they didn't provide a similar option for Option Compare Text - that would be useful. |