title: How to get only a filename?
body: <p>Using VB6</p>
  
  <p>Code.</p>
  
  <pre><code>Dim posn As Integer, i As Integer
      Dim fName As String
      posn = 0
      For i = 1 To Len(flname)
          If (Mid(flname, i, 1) = "\") Then posn = i
      Next i
      fName = Right(flname, Len(flname) - posn)
      posn = InStr(fName, ".")
          If posn &lt;&gt; 0 Then
             fName = Left(fName, posn - 1)
         End If
      GetFileName = fName
  
  
  
  FileName: Clockings8.mis06042009 120442.fin
  </code></pre>
  
  <p>But it is showing a filename is “Clockings8”. It should show “Clockings8.mis06042009 120442”</p>
  
  <p>How to modify a code?</p>
  
  <p>Need vb6 code Help</p>