Jump to content

[VB6]Extract Extention from File

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
kresh7

kresh7

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 661 posts
Ok while ago ive coded this function it extracts the extention of a file so i thought lets post it here to maybe someone could need this Credit if u use it :D Peace out


Public Function ExtractFileExtention(FilePath As String)

    On Error GoTo Hell

    Dim i    As Integer

    Dim TPos As String


    For i = 0 To Len(FilePath) + 1


        TPos = Right$(FilePath, i)


        If InStr(1, TPos, ".") Then

            ExtractFileExtention = Right$(FilePath, Len(TPos))

            Exit Function

        End If


    Next


Hell:

    MsgBox "Application Error", vbInformation, "Error"

    Exit Function

End Function

Posted Image

#2
MathX

MathX

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 4,001 posts
Go to Hell :P

Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!