All pastes #626 Raw Edit

me

public text v1 · immutable
#626 ·published 2004-08-14 23:38 UTC
rendered paste body
    'Generate a default output file name, if none is specified, using source file name
    Private Function GetDefaultName(ByVal strPath As String) As String
        Dim sTemp As String
        Dim sArray() As String = Split(strPath, "\")

        'get the final part of the array containing the file name
        sTemp = sArray(UBound(sArray))

        'Check for conversion of source to HTML. Default is none (0)
        If mvarConvertsToHTML Then
            'Remove the original file extension and replace with ".html"
            sTemp = Mid(sTemp, 1, Len(sTemp) - 4)
            sTemp = "(formatted)" & sTemp & ".html"
        Else
            sTemp = "(formatted)" & sTemp
        End If

        Return sTemp
    End Function

    'Generate a default output path, if none is specified, using the source file path
    Private Function GetDefaultPath(ByVal strPath As String) As String
        Dim nPlace As Integer

        'Get the position of final "\" character
        nPlace = InStrRev(strPath, "\")
        'Return the default path
        Return Mid(strPath, 1, nPlace)
    End Function