Use Sleep API to add pauses to your programs
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
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
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,
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 fill your code with unnecessary DoEvents statements, especially within time-critical loops. If you can’t avoid that, at least you can reduce the overhead by invoking DoEvents only every N
This is an evergreen, but it’s still popular. It is very easy to create a window that always stays on top of the others, thanks to the SetWindowPos API function.
‘ 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
Private Declare Function GetShortPathName Lib “kernel32” Alias _ “GetShortPathNameA” (ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long’ Convert a long filename into the
Private Declare Function GetSystemMetrics Lib “user32” (ByVal nIndex As Long) _ As Long’ Returns True if a Network is found (read-only)Function IsNetworkInstalled() As Boolean Const SM_NETWORK = 63 IsNetworkInstalled =
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