Compiler for .NET Wiki

JustFName Function

Modified: 2007/04/05 23:53 by SamuelDavid - Categorized as: VFP Functions
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

--
  • Support function
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

ScrewTurn Wiki version 2.0.2. Some of the icons created by FamFamFam.