{
StrRScan example
 This function behaves much like ExtractFileName
 except that it uses null-terminated strings and
 it will not work with multi-byte character sets (MBCS). 
}
uses SysUtils;
function NamePart(FileName: PChar): PChar;
 var
  P: PChar;
begin
  P := StrRScan(FileName, '\/');
  if P = nil then
  begin
    P := StrRScan(FileName, ':');
    if P = nil then P := FileName;
  end;
  NamePart := P;
end;
var
  S : string;
begin
  S := string(NamePart('C:\Test.fil'));
  Canvas.TextOut(10, 10, S);
end; 
