devxlogo

Tip Bank

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

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)

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

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