How might one retrieve the last element of a string array in visual basic 6?
I'm dealing with filenames with multiple dots which are split into an array, and I want to manipulate only the extension. The following code works, but has a hardcoded element I want to remove.
Private Sub Form_Load()
Dim aPath() As String
Dim FileName As String
Dim realExt As String
FileName = "A long dotty.file.name.txt"
aPath = Split(FileName, ".")
realExt = aPath(3) ' <-- how to not hardcode?'
MsgBox ("The real extension is: " & realExt)
Unload Me
End Sub