









Use the right type for constants
VB stores symbolic and literal constants internally using the simplest data type possible; this means that most common numeric constants-such as zero or one-are stored as Integers. If you use
VB stores symbolic and literal constants internally using the simplest data type possible; this means that most common numeric constants-such as zero or one-are stored as Integers. If you use
Don’t use an empty For…Next loop to add pauses to your programs; instead, use the Sleep API function, that releases the CPU and lets other apps in the system effectively
In VB applications compiled as native code, GoSubs are 5-6 times slower than calls to regular Subs or Functions; conversely, in p-code they are considerably faster. This is one of
OK, this is a silly suggestion, but I personally know a lot of developers that complain about Visual Basic’s bugs that were fixed in more recent Service Packs. This is
Use the And operator instead of Mod when the divisor is a number in the form 2^N. For instance, there are two methods to extract the least significant byte in
‘ ShellSort an array of any type” ShellSort behaves pretty well with arrays of any size, even’ if the array is already “nearly-sorted”, even though in’ particular cases BubbleSort or
If your application uses objects from external components, either third-party or your own libraries, a good rule of thumb is to include the complete servername.classname string in the Dim statement,
The StartLogging and LogEvent methods of the App object only work in compiled applications. This behavior is by design and shouldn’t be considered a bug, even though it isn’t documented
You can’t reliably test an auto-instancing object variable using the Is Nothing test, because as soon as you reference the variable Visual Basic silently creates an object of the given