Get Type

Private Function Get_Type(FullFileName As String)
'find file type, EMS, Xport/Sharkport V1 or V2
'Main code by gothi, updated code by DCLXVI 29a
'updated 16/03/2003
    Dim Extension As String 'Store the FullFileName in a temporary variable
    Extension = FullFileName
    'If there's no "." in the name
    If InStr(Extension, ".") = 0 Then
        'There's no extension
        Extension = ""
        'Strip-off everything from right until the first "." 
        Do Until InStr(Extension, ".") = 0
            Extension = Mid(Extension, InStr(Extension, ".") + 1)
    End If
    Select Case Ucase(Extension)
        Case "EMS"
            Get_Type = "ems"
        Case "XPS", "SPS"
            Get_Type = "xv2"
        case "XPO", "SPO" 
            Get_Type = "xv1"
        case "NPO"
            Get_Type = "npo"
        Case Else MsgBox "File appears to be mislabled or is not a PS2 Save." & vbCrLf & "Please rename the file or use files with the following extensions: *.xps/*.sps/*.xpo/*.spo/*.psu/*.psd/*.npo"
    End Select
End Function


Assuming txtload.Text contains the path to a save

Dim savetype As String
savetype = Get_Type(txtload.Text)
Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback.

Leave a Reply

Your email address will not be published. Required fields are marked *

Your email address will never be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.