MakeFileName – Create a file name out of its parts

MakeFileName – Create a file name out of its parts

' Make a complete file name by assemblying its individual parts' if Extension isn't omitted, it overwrites any extension held in BaseNameFunction MakeFileName(Drive As String, Path As String, BaseName As String, _    Optional Extension As String)    ' add a trailing colon to the drive name, if needed    MakeFileName = Drive & IIf(Right$(Drive, 1) <> ":", ":", "")    ' add a trailing backslash to the path, if needed    MakeFileName = MakeFileName & Path & IIf(Right$(Path, 1) <> "", "", "")        If Len(Extension) = 0 Then        ' no extension has been provided        MakeFileName = MakeFileName & BaseName    ElseIf InStr(BaseName, ".") = 0 Then        ' the base name doesn't contain any extension        MakeFileName = MakeFileName & BaseName & "." & Extension    Else        ' we need to drop the extension in the base name        Dim i As Long        For i = Len(BaseName) To 1 Step -1            If Mid$(BaseName, i, 1) = "." Then                MakeFileName = MakeFileName & Left$(BaseName, i) & Extension                Exit For            End If        Next    End IfEnd Function

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved