'= , = , = ; = , =, = , = ,= , = 'how to resolve windows-filenames.. ' 2006 by ytwinky, MD Const MaxStr=255 ' Type NameRec FSpec(4) As String*MaxStr' 0=Drive:, 1=\Dir\, 2=FileName, 3=.Ext End Type Declare Function FSplit(byVal FSpec As String) As NameRec Function FSplit(byVal FSpec As String) As NameRec Dim s As String=FSpec, FileSpec As NameRec Var dp=Instr(s, ":"), pt=0, i=0, bsl=0 For i=0 To 3 FileSpec.FSpec(i)="" Next If FSpec="" Then Return FileSpec 'nothing to do, all done ;) If dp Then 'DriveLetter okay FileSpec.FSpec(0)=Left(s, dp) End If For bsl=Len(s) To 1 Step-1 'Path okay.. If Chr(s[bsl-1])=Chr(92) Or Chr(s[bsl-1])=":" Then 'this is the path FileSpec.FSpec(1)=Mid(s, dp+1, bsl-dp) s=Mid(s, bsl+1) 's=name[+.ext] Exit For End If Next For pt=Len(s) To 1 Step-1 'is there at least one extension? If Chr(s[pt-1])="." Then 'is there a dot FileSpec.FSpec(2)=Left(s, pt-1) 'FName okay.. FileSpec.FSpec(3)=Mid(s, pt) 'FExt as well.. Exit For 'Yes, it is.. End If Next If pt=0 Then 'no dot => no extension FileSpec.FSpec(2)=Mid(s, 1) 'No Ext, FName is the rest.. 'Caution:If FSpec doesn't end with '\', but is in fact a subdir, then the last subdir is in FName End If Return FileSpec End Function ' Sub FSplitIt(byVal FSpec As String) Print "FileSpecification=" &FSpec With FSplit(FSpec) 'Gee, it wrx ;) Print "Drive=" &.FSpec(0) Print "Path=" &.FSpec(1) Print "Name=" &.FSpec(2) Print "Ext=" &.FSpec(3) Print End With End Sub Print "FSplit.Bas V3 2006 by ytwinky, MD" FSplitIt "C:\Dokumente und Einstellungen\NetworkService\Lokale Einstellungen\Temporary Internet Files\Content.IE5\RTJCN2OL\DeskTop.Ini" FSplitIt "c:ntldr" FSplitIt CurDir FSplitIt CurDir &Chr(92) FSplitIt "c:ntldr." Print "tested with FB0.17f using FBIDE 0.4.6"; GetKey End