Implemented originally by Thomas Ganss:
function JustFName(tcString)
local lnDivider
lnDivider = max(rat("/",m.tcString), rat("\",m.tcString))
do case
case m.lnDivider=1
RETURN JustFName_E_DoubDot(m.tcString)
case m.lnDivider>1
return substr(m.tcString,m.lnDivider+1)
otherwise
RETURN JustFName_E_DoubDot(m.tcString)
endcase
--
function JustFName_E_DoubDot(tcString)
if substr(m.tcString, 2, 1) ==":"
if len(m.tcString)>2
RETURN substr(m.tcString, 3)
else
return ""
endif
else
return m.tcString
endif