Get File in string

Blitz3D Forums/Blitz3D Programming/Get File in string

I want to obtain the file's name and not the entire DIR.
myfile$ = "C:\folder\myfile.txt")

I want to get "myfile.txt" and not the "C:\folder\" part. How would I do this? It would be from the last "\" right?

this help.

http://www.blitzbasic.com/codearcs/codearcs.php?code=648

I cam up with my own function... Thanks for that one... but I'll use mine.
Print Get_File("c:\documents\myfile.txt")
Delay 1000

Function Get_File$(file$)
	For i = 1 To Len(file$)
		If Mid$(file$,i,1) = "" Then
			c = 0
		EndIf
		c = c + 1
	Next
	Return Right(file$, c-1)
End Function