function MPathAndFile(const strFull: String; var strPath, strName: String): Boolean;
var
iCnt, iPos : Integer;
begin
iPos := -1;
for iCnt := 1 to Length(strFull) do begin
if strFull[iCnt] = ‘\’ then iPos := iCnt;
end;
if iPos <> -1 then begin
strPath := Copy(strFull, 1, iPos);
strName := Copy(strFull, iPos+1, Length(strFull)-iPos);
Result := True;
end
else Result := False;
end;
////////////////////////////////////////////////////////////////////////
// 从文件名中分离出名称和扩展名.
function MNameAndExt(const strFull: String; var strName, strExt: String): Boolean;
var
iCnt, iPos : Integer;
begin
iPos := -1;
for iCnt := 1 to Length(strFull) do begin
if strFull[iCnt] = ‘.’ then iPos := iCnt;
end;
if iPos <> -1 then begin
strName := Copy(strFull, 1, iPos-1);
strExt := Copy(strFull, iPos+1, Length(strFull)-iPos);
Result := True;
end
else Result := False;
end;
比格高
逼格更高