






RefTools’ Algorithms: Look-up Strategies
his is the first in a short series of articles describing Visual Basic components from the RefTools add-in. A first conclusion is that simple binary search of a sorted list
his is the first in a short series of articles describing Visual Basic components from the RefTools add-in. A first conclusion is that simple binary search of a sorted list
Shared Function _ SearchTreeForFile(ByVal rootPath As String, ByVal inputPathName As String, _ ByVal outputPathBuffer As System.Text.StringBuilder) As BooleanEnd Function’ Returns the complete path+name of the filename or a null string
Shared Function _ SearchPath(ByVal tartPath As String, ByVal fileName As String, _ ByVal extension As String, ByVal bufferLength As Integer, _ ByVal buffer As System.Text.StringBuilder, ByVal filePart As String) As
‘ Returns a boolean indicating whether the file is an executableFunction IsExecutableFile(ByVal filePath As String) As Boolean ‘ add more extensions if you wish Dim extensions() As String = New
‘ Returns a boolean indicating whether the file is an imageFunction IsImageFile(ByVal filePath As String) As Boolean ‘ add more extensions if you wish Dim extensions() As String = New
‘ Returns a boolean indicating whether a given drive is ready’ Example: check if the floppy disk drive is ready’ Debug.WriteLine(IsDriveReady(“a”))Function IsDriveReady(ByVal driveLetter As String) As Boolean If driveLetter.Length =