Tip Bank

DevX - Software Development Resource

Never use the End statement

There are a lot of risks involved in using End in VB programs: your databases might not be correctly closed, your objects are not correctly terminated, etc. You should always

DevX - Software Development Resource

DirExists – Check that a directory exists

‘ Return True if a directory exists’ (the directory name can also include a trailing backslash)Function DirExists(DirName As String) As Boolean On Error GoTo ErrorHandler ‘ test the directory attribute

DevX - Software Development Resource

FileExists – Check that a file exists

‘ Return True if a file existsFunction FileExists(FileName As String) As Boolean On Error GoTo ErrorHandler ‘ get the attributes and ensure that it isn’t a directory FileExists = (GetAttr(FileName)

DevX - Software Development Resource

Counting Bits

It seems that the only way to count the number of 1’s or 0’s in a binary value is creating a loop that iterates on all the 16 or 32

DevX - Software Development Resource

Items of ParamArray can be Missing

When using the ParamArray keyword within a procedure, always remember that when the procedure is invoked from elsewhere in the program one of the argument might be omitted, and you