Home  |  Programs  |  Tips & Tricks  |  Subs & Functions  |  Links  |  Laz's Liberty Basic Site


GetFileName Function

Call the function like this:
FileName$ = GetFileName$(CompletePath)


function GetFileName$(FName$)
'Get the file name from a complete path (strip the path)
S$ = "null"
leng = len(FName$)
while right$(S$,1) <> "\" and leng <> 0
S$ = left$(FName$,leng)
s = s+1
leng = leng - 1
wend
if leng = 0 then
GetFileName$ = FName$
else
s=s-1
GetFileName$ = right$(FName$,s)
end if
end function

Hosted by www.Geocities.ws

1