My level editor was being silly when I loaded levels, because it wouldn't accept thing like "C:\Program Files..." etc. Only things like "Object1.x", so I put together this function, and since I haven't seen it around here, I'll post it.
function getLastSeg(st$)
local slashes as integer : local slashpos as integer
local length as integer : length=len(st$)
local seg as string
for l=1 to length
if mid$(st$,l)="/" or mid$(st$,l)="\" then slashpos=l
next l
for l=slashpos+1 to length
seg=seg+mid$(st$,l)
next l
endfunction seg
There you go, simple as that.