【求助】请问 IsDirectory := Line[1] = 'd';是什么意思?其中...

suihu suihu 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
有这个一段小函数:

function GetNameFromDirLine(Line: String; Var IsDirectory: Boolean): String;
Var
i: Integer;
DosListing: Boolean;
begin
------------------------------------------------------------------
IsDirectory := Line[1] = 'd';

//这句话是什么意思?
//Line是String型
------------------------------------------------------------------
DosListing := false;
for i := 0 to 7 do begin
if (i = 2) and not IsDirectory then begin
IsDirectory := Copy(Line, 1, Pos(' ', Line) - 1) = '<DIR>';
if not IsDirectory then
DosListing := Line[1] in ['0'..'9']
else DosListing := true;
end;
Delete(Line, 1, Pos(' ', Line));
While Line[1] = ' ' do Delete(Line, 1, 1);
if DosListing and (i = 2) then break;
end;
Result := Line;
end;
------------------------------------
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
suihu
非技术区 831 成员 53,568 内容